public inbox for docs@lists.yoctoproject.org
 help / color / mirror / Atom feed
* [PATCH 0/1] doc: bitbake-user-manual-metadata: clarify inherit_defer documentation
@ 2026-04-24  6:23 Dawid Bijak
  2026-04-24  6:23 ` [PATCH 1/1] doc: bitbake-user-manual-metadata: fix " Dawid Bijak
  0 siblings, 1 reply; 8+ messages in thread
From: Dawid Bijak @ 2026-04-24  6:23 UTC (permalink / raw)
  To: bitbake-devel; +Cc: docs, Dawid Bijak

Hi,
I've been reading through the inherit_defer documentation, and granted my limited knowledge of bitbake,
I think the current documentation is incorrect or misleading in a few places:

1)
    The sentence "If VARNAME is going to be set, it needs to be set before the inherit_defer statement is parsed"
    seems plainly wrong and defeats the purpose of inherit_defer.
    As I understand it, the whole point of deferred evaluation is that assignments made after the directive are taken into account.

2)
    The examples using inline Python, e.g. inherit_defer ${@'classname' if condition else ''},
    are not specific to inherit_defer - they would work equally well with plain inherit.
    They probably belong in the inherit section.

3)
    The suggested technique of assigning the class name from an anonymous Python function does not appear to work:

    python () {
        if d.getVar('SOMETHING') == 'value':
            d.setVar('VARIABLE', 'someclass')
        else:
            d.setVar('VARIABLE', '')
    }
    inherit_defer ${VARIABLE}

    From my experiments, inherit_defer is resolved before anonymous Python functions run, so ${VARIABLE} always expands to empty
    and the inherit is a no-op.

    Is that the intended order and the documentation is wrong, or is this a bug in bitbake, or did I just get it wrong?

Anyway, just in case, the attached patch rewords the documentation to address points 1 and 2, and adds a note about point 3.
Happy to revise if I've misunderstood any of it.

Thanks,
Dawid

Dawid Bijak (1):
  doc: bitbake-user-manual-metadata: fix inherit_defer documentation

 .../bitbake-user-manual-metadata.rst          | 61 ++++++++++---------
 1 file changed, 32 insertions(+), 29 deletions(-)

-- 
2.48.1



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2026-04-29 14:25 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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       ` [bitbake-devel] " Richard Purdie
2026-04-29 14:11         ` Dawid Bijak
2026-04-29 14:24           ` Quentin Schulz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox