Yocto Project Documentation
 help / color / mirror / Atom feed
From: "Robert P. J. Day" <rpjday@crashcourse.ca>
To: Richard Purdie <richard.purdie@linuxfoundation.org>
Cc: YP docs mailing list <docs@lists.yoctoproject.org>
Subject: Re: [docs] more docs curiosity: "inherit_defer" in the BB manual
Date: Wed, 9 Jul 2025 10:20:22 -0400 (EDT)	[thread overview]
Message-ID: <53128fdc-ad85-ec69-b5f8-ff70664e883e@crashcourse.ca> (raw)
In-Reply-To: <63ac037ab19af1c1fa58290261318bebcc2db6be.camel@linuxfoundation.org>

[-- Attachment #1: Type: text/plain, Size: 2215 bytes --]

On Wed, 9 Jul 2025, Richard Purdie wrote:

> On Wed, 2025-07-09 at 09:31 -0400, Robert P. J. Day via
> lists.yoctoproject.org wrote:
> >
> > here:
> >
> > https://docs.yoctoproject.org/bitbake/2.12/bitbake-user-manual/bitbake-user-manual-metadata.html#inherit-defer-directive
> >
> > that section strongly suggests that the sole reason to use
> > "inherit_defer" is that you want to inherit some class, but you're
> > not
> > sure which class *yet*, so you use a variable that will, at some
> > point, be set before parsing is complete. or possibly it will involve
> > a programmatic condition.
> >
> >   so what is the purpose of using "inherit_defer" on a fixed bbclass
> > name such as this?
> >
> > https://git.openembedded.org/openembedded-core/tree/meta/recipes-devtools/qemu/qemu-native.inc#n3
> >
> > what is the rationale of inherit_defer'ing a fixed class name? or is
> > there more to this that i'm missing?
>
> native has to be last. That means it has to be deferred.
>
> I think bitbake now happens to handle this magically after more recent
> changes, just to complicate the story.

  i had assumed the first bit, i am unfamiliar with the second bit, so
here's my thinking.

  the section on plain "inherit":

https://docs.yoctoproject.org/bitbake/2.12/bitbake-user-manual/bitbake-user-manual-metadata.html#inherit-directive

already explains (in the Note) that the placement of "inherit"
directives is important as that might affect what you will and will
not be allowed to override, so that part seems fine.

  the last line in that section, though:

"For inheriting classes conditionally, using the inherit_defer
directive is advised ..."

is now clearly(?) misleading since it suggests it is to be used solely
for conditional inheriting, which is not entirely true.

  i think a clearer way to explain this is to just drop that last
sentence from that section and then, in the following "inherit_defer"
section, explain that it is *mostly* used for conditional inheritance
(involving variables), but *might* be seen in cases like that "inherit
native" example (unless that last part is such a corner case that it
can remain unexplained, and not over-complicate the explanaton).

  thoughts?

rday

  reply	other threads:[~2025-07-09 14:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-09 13:31 more docs curiosity: "inherit_defer" in the BB manual Robert P. J. Day
2025-07-09 13:34 ` [docs] " Richard Purdie
2025-07-09 14:20   ` Robert P. J. Day [this message]
2025-07-14 14:40     ` 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=53128fdc-ad85-ec69-b5f8-ff70664e883e@crashcourse.ca \
    --to=rpjday@crashcourse.ca \
    --cc=docs@lists.yoctoproject.org \
    --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