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: 87299 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 5B706CD342D for ; Fri, 1 May 2026 09:14:51 +0000 (UTC) Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.10685.1777626880684882160 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=qrXaEeII; spf=pass (domain: gmail.com, ip: 209.85.128.46, mailfrom: bijak.dawid@gmail.com) Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-488b0e1b870so28382115e9.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.openembedded.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=qrXaEeIISbbF8GBxFBPirGM8//q1knjHQZmq58WusJDxVQIdZZMMgn/EDT9JnYRk2C 2v4CdejQkuG9495dR0PDL0apOBzrf0tfo5YMZNWs3Q1F7UBiu5B1rlDiTgW4qZAHMpDQ U9ZyfZnfY/LgJBTdSK//GVU99lMUidVmuuu78cGuqxM195eu7Nd+t1bYT2hsgU+VgSRc oqQkoyGIQMILba704EpyQaCUHTcEvGLnb/JOGOZNFchWVHT+vxWDdjLoAppfo5o524MW bYJVs+KDYBMIDP8kkB+uzrnglVpw1DT7W06yJGPQ38ksRForNi9V4Vv2mhE5BR+0M6wi nwNA== 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=UA9PlaYoYiy6vGAQ0MjDneyLfK8A+quwRxjrNUMNJgOsZYc78JWzmUyMOAxIp7J0BF +aNUrj2edRiLPKuiD3GYx9SoZXVvLx1ln2Z3rtvYcwlNHgXFlQDhtjEDo6xLlol2BeRk U+I1XmU1M0FSDi7Ur/1dCKa/7E5dyFnrz9WsN9SI/AshZ4Q2s+LeOdyVqVfSJYJLH7cT A4oEJ0uHzDEaEBq3HF4t27Ga6P+d83Gi6t6h80jbDldQvZ7lo0WhBhJpLOdyx+3ulPix zTowyAic+CA+lrD/IM3Z1URebXuX350xGnYbxp5e0flE76lwejM7WnnTlP0KPMNLRHjJ BGBw== X-Gm-Message-State: AOJu0YzgK5lN+/3Slmv0sN+GnDAWtgGrf9CM+DaMuXjAz/qbkmiq8Nk8 jpzhigyDK9PEakC+Ku9WrwXIMSrWNWMrtQBxF7P6a0siERI3eRLVeY2MqY/+sueeuZI= X-Gm-Gg: AeBDieuqT9QAw6N0sp46qWrTgxCBTUK/jMWSG3lYBgxSC2NtjOaRjaRG2gTyK4L8K/+ 3Mu9kzjR9UsMHHAn+dedq267Ym+RrWYVb1NbX2NDyczPKDh2Rb1A+5ZYrEApSQslT9Jz9azVqS7 BVNBviSCegcBlHUVz0hCemS3JrLffiK99J1XNbJ5aI2svEmaPN8aReCLj/Nbwg2MpOdruns9+zT R23lrGK0+LL3AZMjKQhAKu9GbQViu3kOd22MBO091SjJc+FSsEZX9m3jZfNRJ2XvKZSiBuZXCwj BtybVV0MULFywqovXUaFqkV6cis/Q5eNTGgbaqBeVzVm2rn+g+lQ/GssnUa9eaqxENiznMSRwLz aQKrHrsM+/B+ENX0Yn10a0dh7G7/kNcJFu9ROK6SKLelBT5VYtijM8797MLFpcfRmC8u7J8IOcr K/0q7O5I2mHr4+BBkFlEqEyf26KUyhoLKbNURgW9GlXzIldQ4qaPbiaJxlmet4G7lF/CsrZHiUZ EqpUNpUwzLS3GE1cWOkgWvZDTIhUTpUka2YzV9p+IfNiyJsd8zIpKtquU0drhhbejoy1IDpiw== 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.openembedded.org/g/bitbake-devel/message/19426 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 Reviewed-by: Quentin Schulz --- 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: 87300 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 7CCCACD342C for ; Fri, 1 May 2026 09:14:51 +0000 (UTC) Received: from mail-wm1-f45.google.com (mail-wm1-f45.google.com [209.85.128.45]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.10752.1777626882542923219 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=EprUSB+t; spf=pass (domain: gmail.com, ip: 209.85.128.45, mailfrom: bijak.dawid@gmail.com) Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-4891e86fabeso22307035e9.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.openembedded.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=EprUSB+tkwrg/uCB4BMDTgeZ2dKQF9T/V3SplEH9howaifyNNHz0CWY0EmLlLJpbX2 X9WPjg+WQKpAkIoWsQxdWFHMYYLCFp3LAwHmw61VWAsnGA97O87fJRAofzRdx2xFuWAH ncWgYadR5bxib/4nMLJEw6Tdz1Yb2Lz+G7+cFsRYITTMDiP+Y0bVgvpJROsQK2USVcf9 kc8W9+Xtu9O5YieZCIBvhpJVejRLX84xEFD7BnqB6FZHtsUzocTgYNoW0lZwDv8/zYV/ rRPPoiE+oNIklfJtM0eEFWrIM7Ub3ddO0IsRqagweCGQws6ftPCZfCBzTzvU4ZEzWXvM tBng== 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=cH199gzds49i9zLQ3AaI63V/4puILOfBNGvoMSqMxgsWSmmuofDS4lu0OxI43KyF/R w36UN5RMU9xOqdXCL/YZYl55KemdJZEXClZESONQiQBtBUxvux9XVluP6ig0kSaBgZhM JUdWRPQkn8sn9yS362RIhI9SzLVCJtvyoH8rWBLz+mlKbvcxgoXQaY0XLTxis9MZgFN8 +INOmlwvhrB45nWa1lj53eusbsK2Agw0ppiqp15dtBHZtYAAWsONEIfVHiTYROVAgCTt RyjIwmglEU1bQmzBnGsT+iHxN+c5SzG1rwKUfMzOHTL7IC4LEu1IVwFod98xjYA1awMd gOrg== X-Gm-Message-State: AOJu0YxRGrpChJ1Famm96aspoIuWTV25qLML5jkcNqXfGynDWqptIqNQ mkWmnwquTKeBX0+TmYKNmK2UTr8rOiWrtK+Sf0gAoAb5WEYjhdr6UqHptfxQuy2D1F0= X-Gm-Gg: AeBDiev8+A6tt14PxYD4U0zqvIxww7+oj7Q9TsDVVZdpOEVXo/duYh8D4q58mK/A35y vU+1pwHsaOsARqzSjt8QfylW/jUrgtsfNMO9Iguax25dWRl3IGdsQ+FzG1f5VMyri51WZRyoB4i gf7jolE7FECECx18GWKx74R9VNLkuq3YpkXClryj9hA6RaB3wvZEIXA5ouWa6PENqQ61JR3SNgH D7DjmJY8l3wR3s9tgHCIgnRWRiilIVFn6JXkvXn1tSgy4B0nqGcgDtofMt+oOpMS1C35T8hxEes WHFj+VzHAuMa/csrEX3g2xFurPuHAo+Ukm8d1wWMBW9SP4opbCnkX3vk75ZRpnI7S/M7sSKBlV5 3Vcy1V1hLcci5gBeLJT48w7bZ01CRQw5Z6km6P4vb/xXqR/zB8MKz/Ycu9QD2EbQiTE/m0/R98u ynvRxQCfFMiN0dvCJ6cHQo0NduphOWi8VJfDiwEfWkPiDtbwRcSLwJABsGWxy88GmDDFONZrE4H vBBsPGf4JNLUh1HICipg4VzDrNpfg/IQt9hZgXm6Z/CTl3uTpkFcQqgrtm5qhImrXLo34wwTg== 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:51 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/19427 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: 87298 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 58F46CD342A for ; Fri, 1 May 2026 09:14:51 +0000 (UTC) Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.10754.1777626883367916179 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=TiRB5ESd; spf=pass (domain: gmail.com, ip: 209.85.128.49, mailfrom: bijak.dawid@gmail.com) Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-488af9fdaa7so9945645e9.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=1777626881; x=1778231681; darn=lists.openembedded.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=TiRB5ESdVUchmOoaExwPGptWPXyFwEAZzdcL4raTp3uMSECAuhcMIStQ3lzzpQ5MeH M4ZvSg0hMLBEBFC3MsNWGcwx/R4BEdx6lzHj84BSkbvHpa3qzK6VjLPwJrfB6uyGcwI/ sEs5CTzmHlDcw+BQHuaJ2LlaV7n7Ikhk68sEiGoR9j0d2GKg0cQqgE89eohbVFV+fmKb CawJosc92EpmImqSevQSxhdb83dSXXjnYzLMy+7d1tdQgC7rukueqqB01hDvfskgMrdY erAtToTasRNO1JL2H8h4OYmcJOKlQ5vCu1Zq3+th/qoGMIUEY2vs1t7HjFqaTHuk5v10 hBCQ== 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=EQxtojO/RfkHAuh45XtA6cTXokprj6tXUJvbX8etNaUbHdezJ8E3BGo/3MM5g4bZpi lvlh+YEv8m3Rg/DAku3PJVL5UPrtC/bJ/k/VK4PLfu0hgYMntscG6u3gmLVOKL8KqQNL p46v+Hdv/GJNoI1/unlXvgdJVtvMbs1GOH6kId+a7KjMFt1mSto+0fl4907X9HxeR2gh EMjLrWoBEc+f8V2BETrTXdhUBhQrUFQSL+LbWQxpT1Ft+o6ZqQYp+8zvggRyK8LFGc1L n5/OvlVWRGtaFIPCYQpCKEUZMtr1kGehDUxLmJOEY1rBmRVqbqzXbPU179riCFg1oeet Aw/Q== X-Gm-Message-State: AOJu0YzJYIOhrR6VgABdQcVoACBr7Y0P8ikvsq9ZzHWl+tG31vAaoLOU pxds2IsIvOPyQdQVGbQOv8j4y29uvSxUAn0jTgtU+socDZPgouppu6AXRMLaJ4B6zhs= X-Gm-Gg: AeBDietVXPMuo19N1b1MLQJqYbSGfXaVlZxEUIZmcSi8mHF1n6sadl099DeCxn4HAdu Xm+EkjHn7mGXYTrmMDFfCm3GqjvgCJXLHuDtralJB3tFbiREavX3OWR/46Hyeh4lIFQV9MFz5ks oQ1tbbtPKCDVCnpuT0qvNbTecNzdf0V/sc2fb+UYXjDcsibzMp87HR5lqvffUf7XKEO2kAJ/eSd k5/lg9lEx9e9901ib53V8Fav5RjNDDG/Yy4/2RBdlTGH8J63g6l2MOtRwOn2iGTaxxmslW/UP89 MYT02ii5FqB9IbRzP4cIPPQWDam3H0fDD8VYhHygjPq94WzApWy463KriIx8i1PeGyW+05S7WDT dS3ut9AtDGO86BYPRlm20ftq4z+ODtdbvhv9tfHAzQ4YguSdaATLLoEkPveY3XY0q7ufYxcuD7/ x19kfPS2xc1hNewEPKebxmdg9KVKdqH/kLYBnjpYF+I/KXWsuM5CSv1h363VjIjxvPdk7HrE2Ad wuP3vsfvlgKzyQo/6lFj9bAZRkw6yHC6s+dzvfM+2zOkH+Z1OT7UiFFGuZolUI= 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.openembedded.org/g/bitbake-devel/message/19428 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: 87297 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 41630CD3429 for ; Fri, 1 May 2026 09:14:51 +0000 (UTC) Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.10756.1777626884318034605 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=feB5cecH; spf=pass (domain: gmail.com, ip: 209.85.128.54, mailfrom: bijak.dawid@gmail.com) Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-488ab2db91aso20812685e9.3 for ; Fri, 01 May 2026 02:14:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1777626882; x=1778231682; darn=lists.openembedded.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=feB5cecH1/u7/h/sAdYdJjEaYkuzK7qpZS7+auQVIXZ3ID77xRuPF+vvjselLvYoZF 7FKr2AeiD4BN3OcRtVpRlcjIi/RLOa/l7k2dyHrTe0O1A3Y+Sw4QZdih7Yqz9D2FTzZ9 43YW4E/hutAenfzHbi1L4/NwXSyRLZ1vzT/I+n891ZY60Fk7RbQb4IgiLlhyK6F9CrNf 1wmAu1uwjFIpoeBNKWCMfogRfl9cfLTmlJQztMn0ny0Ez3eq1FnCX4nCmKaq1NT1fzvh /0MlwxhdoptGCXiFvG1rfaz66eCIgSj6kEUtxTAvLlTXw+8zHgP+tIQpbfZh/ZEBhtmA muDw== 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=U4f5jCa8ZgIA8sSzNhyzCokUzaAk4967tJsJbMiDoIKAyqKVC2AeRpieqMVhFhDPDT R468xjcWW+8rRt3pEKsvT8hYlbkaheRWllwIcyxqs7OKBxB4jVqjjtJO66QyEPJm8tKo gfkuCqDdV1azwlvMi2/cw5GH64mD7mjK2X+3slOqASZ+MENBGGpl23sYFRc+eiVEQKn/ qRBM/L4vWdBn0E9SvFwgYhHrzyialiNzIjnRmwTM0j5ENh5XV2aHsCIaeerQ/nhUo1hr lxrjGJwc2DNvjweT1hER7C5gXmQ/F2QhWdCMjyjfdyhPD0PDSWsfmXdL7logL1xZddU1 uD4Q== X-Gm-Message-State: AOJu0YxiKcfYYux+lUrFlB0/VIxMAMtPdzm5BX2jGbrhGLipKaPCrwWY 5oYCvJVQjqWgz2GpkpH66QSX7ait+XCyyxwYn8T8L8edOd+RR4x3M/mNuJ0H1UuGs0Y= X-Gm-Gg: AeBDiesG4CdrriKwznGaC/KyL4j4IBdFaF4/vDjUxTG3ridqhkMrT0fzeOzLxo1WA+Q QMYtOOi7PHK0FdXjDajWbQoIsZGRX0H4tebSLfyqjh/trtFH5YRm5wSC9/U71FWkcKf2ABCuzHc nTuEKbBH2LbOma9fsYmk7Ruk9ONmOrUQT/2coB2UJiuVrXW+CXAA5WbiYhBeck7WrDRt848gs/F 4ciJcwnDVT+1A7p81/+W0oUis9Vzz3/weeLSe7fi6MoJ00tHHmos4AvVCden8u4b3o7/DA6WioW V8CiSs4+jsRBKy2gAU8LLbEFLcUM4f6gKwWzzmOZNKmwnkOMT67Q70NxvJKby/X2c0TQ1WUHFbP lhKxKPG1dge6gQGpPPSfXfrA9Zr6J0368Tc4O402Q29Czvu3roYI5lvLxVCqthPwa78BjZABlZm rSw0nvEzVjrWEfZU+wu3X3jBRuaJYWxvlh31Hr6KSI9Z7Wgd2MHAuWob3v0i/jMJJk6ioEaeQOx 4faJma6bVkyy24Io4Zp86NXiq8QoRsduKSVAdFYKsKy/alvaouxJLomPX2FKIk= 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.openembedded.org/g/bitbake-devel/message/19429 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``.