From patchwork Fri May 1 09:14:15 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dawid Bijak X-Patchwork-Id: 87302 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 166B5FF885A for ; Fri, 1 May 2026 09:14:51 +0000 (UTC) Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.10684.1777626880463553141 for ; Fri, 01 May 2026 02:14:40 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20251104 header.b=BXxjYHVV; spf=pass (domain: gmail.com, ip: 209.85.128.41, mailfrom: bijak.dawid@gmail.com) Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-488b0e1b870so28382085e9.2 for ; Fri, 01 May 2026 02:14:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1777626879; x=1778231679; darn=lists.yoctoproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=EbkVjOYX2ZTYDmcV+w119AsgVq2edC5qOkWuWs4zWTQ=; b=BXxjYHVVtPPnHDhL7k93kRrOcOimBoj7jIa/SYEHDZtMNAIKSfyZoRQ8pnqg3nM7rY MP4DnmkCuVWZuVdSyd19DrsPVxrBhuX1ngAHxLVX+j+TAEPr7/QbekwatQQI8yLICaPi 5d6AnyGjbduqoNIdcMSK33DHN0OZePgrduzgMeGQVm59W/HY8OQU0DLQLC40O1yMMeiF xABnnIlvTWmSE+h+fbFnkexEmr+oxMweycbk+0uA+o9VYKBTghmT0B5LHTe5Tz+VP9nP GjzSYJS9CNhIbHYS9beyJbQ8vfPJ9eUsAALUR9Jp8dbhTkGY5NPm7MamMMeEWBbfK7Is kVMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777626879; x=1778231679; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=EbkVjOYX2ZTYDmcV+w119AsgVq2edC5qOkWuWs4zWTQ=; b=fg7Aj76U0Wi0SAWXDtoKIU1yrFpynJ32hkwoiFOiS1/34H0131VyMIqv0PMM9/dYgq nZWYbfyXbz8pk8ktHK7jhf4eQk/HJ/LLajzZg/8gUT49mffpQHKdVbu2HvZAe63xN5dG OYoFz5LMWtLX3L/VmvvRNE4PKaVOP2ut99CoE12KYWFsWkzXa5ep0hB0krZ5uKksubUi cyXolzdXZaW3qg+/p+zpeGQmkgufFkjU7prUx/SMOgGowyW2XJ+uFOsjKMX6KaceCJVz llWQ785vKpCcAfll9OtNhZAepsM1TD2kzA3MLbm/jpap1FA4oPhJXy3nUQwOmbK3c/E8 790w== X-Gm-Message-State: AOJu0YxgNnnl28W4QEDa3WUid+296xx4cIcuRMq0fOM8+jpcjUyorgHK SLQHCXZykBIsfVSybfn8ZgdzpULaY/13DUFXbA2MGU9Jnio96bkQA0lJ9TR1gYmUJKg= X-Gm-Gg: AeBDietj21BkVQFG/VBGo4bmBWhiOfv37Rs4LcdJSgeyBjJqXY7oUlcuNzALJv8iLVm 0CbNKiklpCsXo1/N2xU0AlIJxl1UwegrEcxjzUBGRo1ZoCgUWyORda1itdxXOTkxbF4DI6EQxfu KxH8TRbMPIXUYy/xgo7p0pYlzR8XFQQGRRZ9IJ3XtJAtJc7pMrm8lK/poPyAHVbDbuKv+ovxuim SpKSGS9EINsKP2T5g8zA/FA9proAEfdB4NV84biRftd36S0/DM8KKgqfCpwcSJIq1xo64FJ0A0i 4a6H0cCBPm8pvEePSVpHvnUDM2SYakK+Fb3lfBcwobuT4W6Kvq1Rt3B5uPTRWk1LJwKL9tt3UAF De1m1X+3j5ydSyCbjtc0Hi3dAk3+nKLr4cZ8P2FD9tGBnvf/lOqUMFmL8kxIXVcUhN7Bk5wpACo n5ZEiUGSKkoayU3bYWXkdFJYwzqk96ijPht2kZBXN57AuKFnPegb5p+xpKhnuKt9lxP8pP/FDqc UWcLV3mcOuedGmyFzb6cofZQxyT//OKjyH9TMkKzhXxedv8I0EZ849KMZYUpOcH1xJYr/1JkQ== X-Received: by 2002:a05:600c:350c:b0:488:f453:b976 with SMTP id 5b1f17b1804b1-48a8449e51amr108314065e9.27.1777626878747; Fri, 01 May 2026 02:14:38 -0700 (PDT) Received: from thinkpad.fritz.box ([2a02:8070:d188:380:6a5d:7450:e8b3:758]) by smtp.googlemail.com with ESMTPSA id 5b1f17b1804b1-48a8fe953besm12097955e9.2.2026.05.01.02.14.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 May 2026 02:14:37 -0700 (PDT) From: Dawid Bijak To: bitbake-devel@lists.openembedded.org Cc: docs@lists.yoctoproject.org, quentin.schulz@cherry.de, richard.purdie@linuxfoundation.org, Dawid Bijak Subject: [PATCH v2 1/4] doc: bitbake-user-manual-metadata: remove incorrect claim Date: Fri, 1 May 2026 11:14:15 +0200 Message-ID: <20260501091418.76994-2-bijak.dawid@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20260501091418.76994-1-bijak.dawid@gmail.com> References: <20260501091418.76994-1-bijak.dawid@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 01 May 2026 09:14:51 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/docs/message/9389 The documentation for inherit_defer contained the claim "If VARNAME is going to be set, it needs to be set before the inherit_defer statement is parsed" which is incorrect and contradicts the purpose of inherit_defer. Drop the incorrect statement. Signed-off-by: Dawid Bijak --- doc/bitbake-user-manual/bitbake-user-manual-metadata.rst | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/doc/bitbake-user-manual/bitbake-user-manual-metadata.rst b/doc/bitbake-user-manual/bitbake-user-manual-metadata.rst index 40cae6b05..ee6919dc4 100644 --- a/doc/bitbake-user-manual/bitbake-user-manual-metadata.rst +++ b/doc/bitbake-user-manual/bitbake-user-manual-metadata.rst @@ -829,9 +829,7 @@ Here is an example:: inherit_defer ${VARNAME} -If ``VARNAME`` is -going to be set, it needs to be set before the ``inherit_defer`` statement is -parsed. One way to achieve a conditional inherit in this case is to use +One way to achieve a conditional inherit in this case is to use overrides:: VARIABLE = "" From patchwork Fri May 1 09:14:16 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dawid Bijak X-Patchwork-Id: 87301 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id DC695CD3424 for ; Fri, 1 May 2026 09:14:50 +0000 (UTC) Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.10686.1777626882289041584 for ; Fri, 01 May 2026 02:14:42 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20251104 header.b=PUcWEXkt; spf=pass (domain: gmail.com, ip: 209.85.128.43, mailfrom: bijak.dawid@gmail.com) Received: by mail-wm1-f43.google.com with SMTP id 5b1f17b1804b1-4891e86fabeso22306985e9.1 for ; Fri, 01 May 2026 02:14:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1777626881; x=1778231681; darn=lists.yoctoproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=8yWOulaSOL62l7Wg08B9kXAJdma9fT8Nk2Tg1J8MlHA=; b=PUcWEXktdonOvdXe+qy7drYJMod72YU5N2D1mR7OUWMWrFK16C7kLKgTZpTzmohdND zAtf/lg+RcscV5fDbReT05AfgzzTSDtAjY6HBd6QijT5F1RBJTjEBQGKAAK7B1GC1VFf 1aeHsNtZniFqKsfuRXe1Qvverulraz/G0UihRWdBHwLpgOkb90PghUK4hGPEj7IxXzVr aJGTdmTPiGQ8lixJ678KNvWCWgRP7t97a1qRay7rq0wdbShzjkmkbkgKMr6YtKWDyBiH H+cw4nk/8PvI/z2jfMo+OLJL90Y2NtEYtfHqTvNs2DSr0/5iAjpnyOJ7KQfGZvD3jqvc 8Xzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777626881; x=1778231681; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=8yWOulaSOL62l7Wg08B9kXAJdma9fT8Nk2Tg1J8MlHA=; b=qDIw5HCxdBiu9oJisBIsb9dSwJe1hTZd0XXomPhrJpfrCM0UUkAQh18tlv0cQQUWx5 Ue+B3HctNrxps+/X1Y6zuGbs93FCKOEBnxOkR/VAbi5KgqzQizSIS89LCRR0VXvGjkCb pTsACZSIym2mn9+/qjIxr6MZdZ9IXOWsVoSYBEPMP9KQXt8eTL8jb/6iaYu2uhVcxO39 5QRX7eSMxSGe0CmQX+53zLiJ57aqp1IuRYuxha8mKnGAMKWQeZup0JN3resDjc4T5VIk xATUiY68FGsNScwmmEEx7Ku0QBR3va7+5qHWG427zGFi0UEZqTpnvCfzFBr9LduU/yDO 8Vuw== X-Gm-Message-State: AOJu0Ywkz2pvkCHRZg4iz+uCngavmz/lV6xoiV4lwYj0+eOIR7XE1jXb x6DQkF3IKV7xKtSHcUzlJhqcSVo9JCgRn99wf3UCMZyYLIr17jSu+RmT X-Gm-Gg: AeBDiesK8VcNHofiJjRbUiT/OVBLd6JkwGsS0IadQV8FwfEuTZoEAc3mD+5qmL+mbYW sevtWr5XEC38lR43rsAaIlAGbWe6pOUrJfRNXUlFDEukNPAIlGS67jx2+VOYqmpMZxko9eGeLNJ fRa72FZBMt3Yrnb6wmXauK1XTZqXCArnjdwqYDJtG6NGY3FSJIEO6Ov0oONxcugG/eE/KqNe7Xd Nx4vVBU/ZBO8MOxn5JSIS0ZxKLS6U/IUKMKZOz7Ydo12wFkw7QOfQq2+TEhtCkhp2Njl9wQ8fgF gsEeOXWGyDNX+pvUwwls+ZeUESexOS9K9F2LiowoQIxns9lJmmU3gU4362PifEEc7W1hemWAjry 8bq5NuxE1qOfDz8nUBXdeu2RNEFYoxKwBdKJDRf/wOf+dilPZEFt8I7yreaglk8RBq/EYMMZq/L fal/vfrqw44WCnryuqLsHz1GrDuwBOlt8eMQdonqVz0+QIRWN71uRh24nBRaseyo1rc6rTPQnm9 iUCzjmCYNiTvaIflsB66bZBaA+W4i7nPMGj6ZvR854ZXqfLGjMCxCTv4FRdL5Q6VlcWs/JDrg== X-Received: by 2002:a05:600c:4e02:b0:488:a639:b772 with SMTP id 5b1f17b1804b1-48a83d6ec66mr107583445e9.7.1777626880650; Fri, 01 May 2026 02:14:40 -0700 (PDT) Received: from thinkpad.fritz.box ([2a02:8070:d188:380:6a5d:7450:e8b3:758]) by smtp.googlemail.com with ESMTPSA id 5b1f17b1804b1-48a8fe953besm12097955e9.2.2026.05.01.02.14.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 May 2026 02:14:40 -0700 (PDT) From: Dawid Bijak To: bitbake-devel@lists.openembedded.org Cc: docs@lists.yoctoproject.org, quentin.schulz@cherry.de, richard.purdie@linuxfoundation.org, Dawid Bijak Subject: [PATCH v2 2/4] doc: bitbake-user-manual-metadata: remove invalid anonymous Python example Date: Fri, 1 May 2026 11:14:16 +0200 Message-ID: <20260501091418.76994-3-bijak.dawid@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20260501091418.76994-1-bijak.dawid@gmail.com> References: <20260501091418.76994-1-bijak.dawid@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 01 May 2026 09:14:50 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/docs/message/9390 The documentation for inherit_defer suggested that conditional inheritance can be achieved by setting a variable inside an anonymous python function and then referencing it from inherit_defer. This does not work: inherit_defer is resolved before the anonymous Python functions run. Remove the incorrect example. Signed-off-by: Dawid Bijak --- .../bitbake-user-manual-metadata.rst | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/doc/bitbake-user-manual/bitbake-user-manual-metadata.rst b/doc/bitbake-user-manual/bitbake-user-manual-metadata.rst index ee6919dc4..b886e0578 100644 --- a/doc/bitbake-user-manual/bitbake-user-manual-metadata.rst +++ b/doc/bitbake-user-manual/bitbake-user-manual-metadata.rst @@ -835,17 +835,6 @@ overrides:: VARIABLE = "" VARIABLE:someoverride = "myclass" -Another method is by using :ref:`anonymous Python -`. -Here is an example:: - - python () { - if condition == value: - d.setVar('VARIABLE', 'myclass') - else: - d.setVar('VARIABLE', '') - } - Alternatively, you could use an inline Python expression in the following form:: From patchwork Fri May 1 09:14:17 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dawid Bijak X-Patchwork-Id: 87304 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4703DCD3428 for ; Fri, 1 May 2026 09:14:51 +0000 (UTC) Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.10753.1777626883087895100 for ; Fri, 01 May 2026 02:14:43 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20251104 header.b=kwRrU5v9; spf=pass (domain: gmail.com, ip: 209.85.128.42, mailfrom: bijak.dawid@gmail.com) Received: by mail-wm1-f42.google.com with SMTP id 5b1f17b1804b1-4891e5b9c1fso15517725e9.2 for ; Fri, 01 May 2026 02:14:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1777626881; x=1778231681; darn=lists.yoctoproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Tnd5tMe0mzHOFOqdiub+GjHo4JwZADonyrUyx8I5sHk=; b=kwRrU5v9w9wNN8AuSt1TU5pnVdYyxMdsuDETc23I+gZEfWuUXj4Qw3SsbusQ+BxVSy TwdorCwdrSwYOm1kwCkKClLWTMjxzraQ10MWiODw/HKodyXjdpqdRta7Yz5iG5lcPfS8 xdI5MeR//hxlncmSwgzchAkOakkpe1XhunSg9MLk5Z2y4Y7YDrUgYLbIUcPVshV5igsx i0i79WPBPVKtfrfwFnkDahIMau9sMeG1WqBnUbRacfvRuniqiWnayE/yfQ1GNpyTHcZ8 YKzJSJGQ5Ib5kBaK94rJTayirRkQLFoYD0DExuoEgzHc8jmhSFqXX3Ezw9wkp/83yt9u bCXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777626881; x=1778231681; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=Tnd5tMe0mzHOFOqdiub+GjHo4JwZADonyrUyx8I5sHk=; b=lCv51BMy+ZpkxEFcWfw8eOBCFF1ojocEcM1XxUpTIddUHVmdDgGmyXSrArdC0ZUrq+ 3PGnniteFxb8mdiX3kO0eoRTKgjgrNbR2vbNsVHfHDoZ1xG8RU8KsUtmwm9jc84oM0DB tzOfy1UAb1HDC8sdpBEyxfSQG4OGG2nT1ilPoZP3ss0YWrmZBbm7ca/iIERWDAfxIGUm OBBdm36dDIJ2TbXp4tsK+ID84OF3w4tOTnPDf7w1PPRPaU9iBFvP1r/tdgsI9VEnRdgt Uitq801DzzjNw5hGGF9b+O8dGgaS2+DhFhzBsj7tAezGi/iulXbiYOR+K+AlvZOKEWLd 7v4Q== X-Gm-Message-State: AOJu0Yy+yKegpx4HjHHgn3WKUZ7TM3ZCYRnHJot4ej8Uw0HioUT4yxCm FLnFsAknwSGdfy0L5ITR0d/EdHLjmbTNTiKC9tTeSTA7FcJERAf411Fp X-Gm-Gg: AeBDies5H9ia2Cu0aqz3GoEpw8gJWbZHH02QNs8rR/76hgROiAX5IYXeLhbWtgdfn4C Z4Cp9xbSxC8ocoRYUf0UXdCyuq7rtI0YcsVkmbmtauP/mLNVQDs72B5i86709XmDbGgvnhZ8TQV mjeCdoDX2C9hbIuiOCXmw9T9D020pRGSB1NfuzCDoCwhr6sS0R5x4c5iLcdycn3+biZ0OfkCNq3 WqdsDuE1uFeKfjIe20Eqqu2reTnZQNcG9NcQhxcH2cXH0WG6PyH6MoAOI32OX9sc9c+zYPLuC1w BlqAwV/TnOZ1RihZLGGdCMUsJ7j4D706qrCZ9f0XGQVEAH0e0/8rNDkiXx1oPt0Vy1+hAj/DItG QJx5hPOyZ74mPkn5lLzWQnZoeJbbPO+1+fX3xTsXiG3D9LlYVopQg2kK6TYzpkUsk0PuMsfD3Q1 VBkMDRHvTnMMH1q8pEs0ZrnTrYkK6s5IHE2N/kZRzrgxculp8t02aeY8o15N1rEpWFV/qKf6kDj GsSN2phpPQbwuQgYQe0CxFTkK07ApDUNzjhUVo2zLAmNDWmd3+sto1maKGFWSM= X-Received: by 2002:a05:600c:c174:b0:480:1c69:9d36 with SMTP id 5b1f17b1804b1-48a84468397mr100076575e9.17.1777626881503; Fri, 01 May 2026 02:14:41 -0700 (PDT) Received: from thinkpad.fritz.box ([2a02:8070:d188:380:6a5d:7450:e8b3:758]) by smtp.googlemail.com with ESMTPSA id 5b1f17b1804b1-48a8fe953besm12097955e9.2.2026.05.01.02.14.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 May 2026 02:14:41 -0700 (PDT) From: Dawid Bijak To: bitbake-devel@lists.openembedded.org Cc: docs@lists.yoctoproject.org, quentin.schulz@cherry.de, richard.purdie@linuxfoundation.org, Dawid Bijak Subject: [PATCH v2 3/4] doc: bitbake-user-manual-metadata: explain inherit_defer example Date: Fri, 1 May 2026 11:14:17 +0200 Message-ID: <20260501091418.76994-4-bijak.dawid@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20260501091418.76994-1-bijak.dawid@gmail.com> References: <20260501091418.76994-1-bijak.dawid@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 01 May 2026 09:14:51 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/docs/message/9391 Add a short paragraph describing how the inherit_defer makes use of override syntax to achieve conditional inheritance, and rename VARIABLE to VARNAME so the example uses the same identifier as the preceding code block. Signed-off-by: Dawid Bijak --- doc/bitbake-user-manual/bitbake-user-manual-metadata.rst | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/doc/bitbake-user-manual/bitbake-user-manual-metadata.rst b/doc/bitbake-user-manual/bitbake-user-manual-metadata.rst index b886e0578..0c7c3ff99 100644 --- a/doc/bitbake-user-manual/bitbake-user-manual-metadata.rst +++ b/doc/bitbake-user-manual/bitbake-user-manual-metadata.rst @@ -832,8 +832,13 @@ Here is an example:: One way to achieve a conditional inherit in this case is to use overrides:: - VARIABLE = "" - VARIABLE:someoverride = "myclass" + VARNAME = "" + VARNAME:someoverride = "myclass" + +:ref:`inherit_defer ` +defers the evaluation of ``${VARNAME}`` until the end of +parsing. Assuming ``someoverride`` is in :term:`OVERRIDES`, ``${VARNAME}`` +expands to ``myclass``, which is then inherited. Alternatively, you could use an inline Python expression in the following form:: From patchwork Fri May 1 09:14:18 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dawid Bijak X-Patchwork-Id: 87303 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1C53ECD3425 for ; Fri, 1 May 2026 09:14:51 +0000 (UTC) Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.10755.1777626884001472259 for ; Fri, 01 May 2026 02:14:44 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20251104 header.b=Dpsa+Qgh; spf=pass (domain: gmail.com, ip: 209.85.128.53, mailfrom: bijak.dawid@gmail.com) Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-4891e86fabeso22307195e9.1 for ; Fri, 01 May 2026 02:14:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1777626882; x=1778231682; darn=lists.yoctoproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=dPYOvIXYVVLcRB7cc8+Q6H0pGIMrwUSocsGb/HeRdXE=; b=Dpsa+Qgh23wsjc1egfXDj/8AySC3oEvuUuo2Rc7fkOOWZEzyILwNDe038fbovwKtVJ 2bjNJwcTU1iqi9yauM8jL+IaY0LOfWoQ9mxlk1YRVcQEe9q4L7I0ewqAiKy7LuknGXb3 gluLiCDun/2wHWberiDWteQxGgmtZqi1hAqUzTRz2gZ6RDe8rksr3vwtBhGnFVzAt0ww QYJybV4PiomxRTROMCBWKNsRvQQVNnw1JobIdB08YMpHmXCm92oJ5IMM32QHLq1Fvv4z Nxm9TrMhw6sdod5mnTbHZDFs4UEg7Y/I86/JGGSna15S82AjdGEw93cUfbPsrTUw36EC iaaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777626882; x=1778231682; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=dPYOvIXYVVLcRB7cc8+Q6H0pGIMrwUSocsGb/HeRdXE=; b=kdI/6ErabVBPVVouGJvuGdi4C0WYk1SphBqrqVH+rlyb5Cm+VCRip+avZWrj6Ldkub WDEqrcjI0j3zwF1RRq5wLQkwlKSTFLQ7Kh8LbG6R/yPtExzLYOZcsYqhs1hEpVwAYXh3 FBCi4ZAssm+Axskm//ROE5yHNOBJJCGq4pGbhsn46zbWVKKsKDZyLF6dMGQ/BH4zjpXT 49TR9tJAA29SZTXkgpNepOo9HzghPqQzIeqcoo5ASU/eWKZwIBAOKHz6BZsTvp+ZOOEu LseAMARmoTMaTuIYUZbcKBaCkJqCtqwGJaJTHCZjFRM9j1Gr6Ito6p9yrwhzkwVNLvQr lNUw== X-Gm-Message-State: AOJu0YxqUluyXpu8InfYa80PitQHbLHivPYWLPvpsqxdKGymkwrCxxsB Dx5GllijqZ7VwzpO2TdeKM89Iu9UQfGfnlCc2BB+uRz1cp3ceOCem2xP X-Gm-Gg: AeBDies/ubiCeU3UpAN1z2yTSP3iuHTIc3pR0IRzDz6Y+DAAz7uSVmDATm9e8DmJAAi pqoNE8MG+TxS5o8xyj4Qq/aRKEeh2T//0HhEe56j0VDTuKgwlmKcn+/rNQ99veHoXwkbILkujTg B39DP93UyoUGJVWUmO0UTJdc5aYe2DdslmmFlXrlEJLCL0GwRpoGJmoUp1deeRoxv92ljUp2C7A QHJpnkztP75w816Q0bMnyB65k5UOVLxHqG7/wNzHLv8vVS3w+mO4a8ab5tX59cX5WlDUHu/RPHY z5tTT0htB8/ij1b6ECLsIPTUsSrowXD8PDOicKcLDBzB75V7Oy3rhYBZptExwl6Rlc1hEAd5Kes uiACg7rj6n17JbpeQfl6dISS8WGtDYDkm/QKukzG3VwnFJ2bu61Ym3szRTg98xChZ9v2+30dcNL i7SGBUzBFrxCfSuM4qsMjp624r/hXmLAMTUgrcJ/LTTDlz8pcZIL1WN6tDJe0anDeRRNrNK27Y6 f7CzIKDXbLYezVv1f4+xKan9G5DLxbq8Z/8sHqXB+UK71ABCPm9BxPP5SQkmFQ= X-Received: by 2002:a05:600c:c058:b0:487:4eb:d125 with SMTP id 5b1f17b1804b1-48a83d6f154mr79813585e9.9.1777626882376; Fri, 01 May 2026 02:14:42 -0700 (PDT) Received: from thinkpad.fritz.box ([2a02:8070:d188:380:6a5d:7450:e8b3:758]) by smtp.googlemail.com with ESMTPSA id 5b1f17b1804b1-48a8fe953besm12097955e9.2.2026.05.01.02.14.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 May 2026 02:14:41 -0700 (PDT) From: Dawid Bijak To: bitbake-devel@lists.openembedded.org Cc: docs@lists.yoctoproject.org, quentin.schulz@cherry.de, richard.purdie@linuxfoundation.org, Dawid Bijak Subject: [PATCH v2 4/4] doc: bitbake-user-manual-metadata: move inline python examples to inherit section Date: Fri, 1 May 2026 11:14:18 +0200 Message-ID: <20260501091418.76994-5-bijak.dawid@gmail.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20260501091418.76994-1-bijak.dawid@gmail.com> References: <20260501091418.76994-1-bijak.dawid@gmail.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 01 May 2026 09:14:51 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/docs/message/9392 The two inline Python examples, inherit_defer ${@'classname' if condition else ''} inherit_defer ${@bb.utils.contains('VARIABLE', 'something', 'classname', '', d)} are presented as inherit_defer-specific techniques, but they work with plain inherit too. Their placement under inherit_defer suggests deferred evaluation is required, which is not the case: the ${@...} expression is evaluated when the inherit line is parsed in both forms. Move the inline Python expression examples from the inherit_defer section up to the inherit section, since they apply to both directives. Signed-off-by: Dawid Bijak --- .../bitbake-user-manual-metadata.rst | 25 ++++++++----------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/doc/bitbake-user-manual/bitbake-user-manual-metadata.rst b/doc/bitbake-user-manual/bitbake-user-manual-metadata.rst index 0c7c3ff99..4b1aeedc1 100644 --- a/doc/bitbake-user-manual/bitbake-user-manual-metadata.rst +++ b/doc/bitbake-user-manual/bitbake-user-manual-metadata.rst @@ -803,7 +803,17 @@ An advantage with the inherit directive as compared to both the :ref:`include ` and :ref:`require ` directives is that you can inherit class files conditionally. You can accomplish this by using a variable expression after the ``inherit`` -statement. +statement, as in:: + + inherit ${@'classname' if condition else ''} + +Or:: + + inherit ${@bb.utils.contains('VARIABLE', 'something', 'classname', '', d)} + +In both cases, if the expression evaluates to an +empty string, the statement does not trigger a syntax error because it +becomes a no-op. For inheriting classes conditionally, using the :ref:`inherit_defer ` directive is advised as @@ -840,19 +850,6 @@ defers the evaluation of ``${VARNAME}`` until the end of parsing. Assuming ``someoverride`` is in :term:`OVERRIDES`, ``${VARNAME}`` expands to ``myclass``, which is then inherited. -Alternatively, you could use an inline Python expression in the -following form:: - - inherit_defer ${@'classname' if condition else ''} - -Or:: - - inherit_defer ${@bb.utils.contains('VARIABLE', 'something', 'classname', '', d)} - -In all cases, if the expression evaluates to an -empty string, the statement does not trigger a syntax error because it -becomes a no-op. - See also :term:`BB_DEFER_BBCLASSES` for automatically promoting classes ``inherit`` calls to ``inherit_defer``.