mbox series

[v2,0/4] doc: bitbake-user-manual-metadata: clarify inherit_defer documentation

Message ID 20260501091418.76994-1-bijak.dawid@gmail.com
Headers show
Series doc: bitbake-user-manual-metadata: clarify inherit_defer documentation | expand

Message

Dawid Bijak May 1, 2026, 9:14 a.m. UTC
This is v2 of [1].

The previous single patch has been split into 4 smaller, independently reviewable patches
as suggested by Quentin in [1].

The series addresses a few inaccuracies I came across while reading the inherit_defer documentation.

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

2)
    Drop the anonymous Python example of assigning the class name from an anonymous Python function, which does not work:

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

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

3)
    Add a short explanation of how inherit_defer interacts with conditional overrides, and rename VARIABLE to
    VARNAME for consistency with the preceding code block.

4)
    Move the inline Python examples up into the inherit section. They work with both plain inherit
    and inherit_defer, so presenting them only under inherit_defer is misleading.

Changes since v1:
  - Split single patch into four
  - Shorten the override example explanation
  - Drop the "footgun" example from the previous patch

[1] https://lore.kernel.org/all/20260424062327.820993-1-bijak.dawid@gmail.com/

Greets,
Dawid

Dawid Bijak (4):
  doc: bitbake-user-manual-metadata: remove incorrect claim
  doc: bitbake-user-manual-metadata: remove invalid anonymous Python
    example
  doc: bitbake-user-manual-metadata: explain inherit_defer example
  doc: bitbake-user-manual-metadata: move inline python examples to
    inherit section

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