From: "Antonin Godard" <antonin.godard@bootlin.com>
To: <bijak.dawid@gmail.com>, <bitbake-devel@lists.openembedded.org>
Cc: <docs@lists.yoctoproject.org>, <quentin.schulz@cherry.de>,
<richard.purdie@linuxfoundation.org>,
<mathieu.dubois-briand@bootlin.com>
Subject: Re: [docs] [PATCH v4] doc: bitbake-user-manual-metadata: document inherit_defer limitations
Date: Fri, 22 May 2026 17:39:34 +0200 [thread overview]
Message-ID: <DIPBH4ELBFTQ.224CE5TZWAOUH@bootlin.com> (raw)
In-Reply-To: <20260516191137.11033-1-bijak.dawid@gmail.com>
On Sat May 16, 2026 at 9:11 PM CEST, Dawid Bijak via lists.yoctoproject.org wrote:
> Add a warning explaining that anonymous Python functions cannot be
> used to influence inherit_defer, since they run after the directive has
> already been resolved.
>
> Also rename VARNAME to VARIABLE for consistency throughout the
> documentation.
>
> Suggested-by: Quentin Schulz <quentin.schulz@cherry.de>
> Signed-off-by: Dawid Bijak <bijak.dawid@gmail.com>
> ---
> .../bitbake-user-manual-metadata.rst | 18 +++++++++++++-----
> 1 file changed, 13 insertions(+), 5 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..134cf8ff1 100644
> --- a/doc/bitbake-user-manual/bitbake-user-manual-metadata.rst
> +++ b/doc/bitbake-user-manual/bitbake-user-manual-metadata.rst
> @@ -827,17 +827,17 @@ the variable after the line is parsed will take effect. With the :ref:`inherit
>
> Here is an example::
>
> - inherit_defer ${VARNAME}
> + inherit_defer ${VARIABLE}
>
> One way to achieve a conditional inherit in this case is to use
> overrides::
>
> - VARNAME = ""
> - VARNAME:someoverride = "myclass"
> + VARIABLE = ""
> + VARIABLE:someoverride = "myclass"
>
> :ref:`inherit_defer <ref-bitbake-user-manual-metadata-inherit-defer>`
> -defers the evaluation of ``${VARNAME}`` until the end of
> -parsing. Assuming ``someoverride`` is in :term:`OVERRIDES`, ``${VARNAME}``
> +defers the evaluation of ``${VARIABLE}`` until the end of
> +parsing. Assuming ``someoverride`` is in :term:`OVERRIDES`, ``${VARIABLE}``
> expands to ``myclass``, which is then inherited.
>
> Alternatively, you could use an inline Python expression in the
> @@ -853,6 +853,14 @@ 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.
>
> +.. warning::
> +
> + Setting or modifying variables within an :ref:`anonymous Python function
> + <bitbake-user-manual/bitbake-user-manual-metadata:Anonymous Python Functions>`
> + will have no impact on the value of that variable in an
> + :ref:`inherit_defer <ref-bitbake-user-manual-metadata-inherit-defer>` directive
> + as the function runs after the directive has been resolved.
> +
> See also :term:`BB_DEFER_BBCLASSES` for automatically promoting classes
> ``inherit`` calls to ``inherit_defer``.
>
Reviewed-by: Antonin Godard <antonin.godard@bootlin.com>
Thanks!
Antonin
prev parent reply other threads:[~2026-05-22 15:39 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-16 19:11 [PATCH v4] doc: bitbake-user-manual-metadata: document inherit_defer limitations Dawid Bijak
2026-05-16 19:18 ` Dawid Bijak
2026-05-22 15:39 ` Antonin Godard [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=DIPBH4ELBFTQ.224CE5TZWAOUH@bootlin.com \
--to=antonin.godard@bootlin.com \
--cc=bijak.dawid@gmail.com \
--cc=bitbake-devel@lists.openembedded.org \
--cc=docs@lists.yoctoproject.org \
--cc=mathieu.dubois-briand@bootlin.com \
--cc=quentin.schulz@cherry.de \
--cc=richard.purdie@linuxfoundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox