public inbox for docs@lists.yoctoproject.org
 help / color / mirror / Atom feed
From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: bijak.dawid@gmail.com, Quentin Schulz <quentin.schulz@cherry.de>
Cc: bitbake-devel@lists.openembedded.org, docs@lists.yoctoproject.org
Subject: Re: [bitbake-devel] [docs] [PATCH 1/1] doc: bitbake-user-manual-metadata: fix inherit_defer documentation
Date: Tue, 28 Apr 2026 21:42:28 +0100	[thread overview]
Message-ID: <eeab5758b01722f5474855d21f718ea2d5cabff8.camel@linuxfoundation.org> (raw)
In-Reply-To: <ljbjkwt32h72aziah2gepb6k5rfxygfrhkfysmulj5scnca5pu@o4vikz4hfmh3>

On Mon, 2026-04-27 at 20:14 +0200, Dawid Bijak via lists.openembedded.org wrote:
> On Mon, Apr 27, 2026 at 02:35:45PM +0200, Quentin Schulz wrote:
> > Hi Dawid,
> > 
> > On 4/24/26 8:23 AM, Dawid Bijak via lists.yoctoproject.org wrote:
> > > [You don't often get email from bijak.dawid=gmail.com@lists.yoctoproject.org. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
> > > 
> > > 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.
> > > The wrong claim is replaced with an example which demonstrates
> > > the contrast between a plain defer statement and the inherit_defer
> > > statement by using an override assignment placed after inherit_defer
> > > 
> > > Additionally the inline python expression examples have been
> > > moved from the inherit_defer section up to the inherit section, since
> > > they apply to both directives
> > > 
> > 
> > I'm pretty sure the whole inherit_defer thing started because an inline
> > Python expression didn't work. I vaguely remember a bbappend either adding
> > this new inherit based on PACKAGECONFIG containing a value, or having the
> > main recipe with this inherit <PACKAGECONFIG.contains> and a bbappend modify
> > PACKAGECONFIG. See commit 5c2e840eafeb ("ast/BBHandler: Add inherit_defer
> > support") in BitBake.
> > 
> > So I'm very skeptical this is correct.
> 
> Hi Quentin,
> Thanks for your response.
> I'm afraid I don't quite follow your point about PACKAGECONFIG.contains.
> I'm not sure what you're referring to exactly.
> But, as far as I can tell, the inherit statement works fine with inline python expressions. 
> I think, it evaluates the expression in place, much like := would.
> 
> For example, on current master I tried the following:
>  COND = ""
>  COND:append = " x"
>  inherit ${@bb.utils.contains('COND', 'x', 'foo', 'bar', d)}
> This inherits foo. 
> 
> However, if I move the :append below the inherit directive:
>  COND = ""
>  inherit ${@bb.utils.contains('COND', 'x', 'foo', 'bar', d)}
>  COND:append = " x"
> it inherits bar.

It works, as long as you are sure that COND won't be changed after the
inherit. When mutliple files altering the variables are involved, that
is often unclear. I think the doc's intent is therefore to recommend
anything with variable accesses is therefore deferred, unless the user
is sure they know what they're doing.

Cheers,

Richard







  reply	other threads:[~2026-04-28 20:42 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-24  6:23 [PATCH 0/1] doc: bitbake-user-manual-metadata: clarify inherit_defer documentation Dawid Bijak
2026-04-24  6:23 ` [PATCH 1/1] doc: bitbake-user-manual-metadata: fix " Dawid Bijak
2026-04-27 12:35   ` [docs] " Quentin Schulz
2026-04-27 12:47     ` Quentin Schulz
2026-04-27 18:14     ` Dawid Bijak
2026-04-28 20:42       ` Richard Purdie [this message]
2026-04-29 14:11         ` [bitbake-devel] " Dawid Bijak
2026-04-29 14:24           ` Quentin Schulz

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=eeab5758b01722f5474855d21f718ea2d5cabff8.camel@linuxfoundation.org \
    --to=richard.purdie@linuxfoundation.org \
    --cc=bijak.dawid@gmail.com \
    --cc=bitbake-devel@lists.openembedded.org \
    --cc=docs@lists.yoctoproject.org \
    --cc=quentin.schulz@cherry.de \
    /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