On Wed, Jan 3, 2024 at 4:27 AM Richard Purdie
<[email protected]> wrote:
>
> On Tue, 2024-01-02 at 23:47 +0000, Richard Purdie via
> lists.openembedded.org wrote:
> > It isn't every day I propose new syntax and the bar for doing so is
> > high but I think we have a good case for making his change.
> >
> > I've put together a proof of concept patch here:
> >
> > https://lists.openembedded.org/g/bitbake-devel/message/15738
> >
> > The idea is to add syntax for:
> >
> > inherit_deferred ${SOME_VARIABLE}
> >
> > which would handle the inherit at the end of parsing rather than
> > immediately.
> >
> > The reason is that currently people don't realise that in order for
> > bitbake to parse that, it has to immediately expand the variable at
> > that point in parsing. This means:
> >
> > SOME_VARIABLE = "a"
> > inherit ${SOME_VARIABLE}
> > SOME_VARIABLE = "b"
> >
> > will inherit class a, whilst with inherit_deferred, it would inherit
> > class b.
> >
> > SOME_VARIABLE = "a"
> > inherit_deferred ${SOME_VARIABLE}
> > SOME_VARIABLE += "b"
>
> Having thought a bit more about this, I've wondered if "inherit_defer"
> is slightly better phrasing than "inherit_deferred".
>

FWIW. I like the new syntax, as the semantics of variable use in the
inherits was not obvious to us plebs (me) in the past (since not a lot
of deeper reflection usually goes on when creating a recipe).

This makes it clear that something different is going on, even if exactly
the point to which things are deferred is not front of mind for most. It
gives someone a thread to pull on to learn more.

I can definitely leverage it in meta-virt.

As for the tense of the syntax, I can see an argument for either. I
lean towards "inherit_defer" as it is shorter and the defer matches
the tense of inherit. ("inherited_deferred" anyone ? :)

Bruce

> Cheers,
>
> Richard
>
>
>
> 
>


-- 
- Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end
- "Use the force Harry" - Gandalf, Star Trek II
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#1908): 
https://lists.openembedded.org/g/openembedded-architecture/message/1908
Mute This Topic: https://lists.openembedded.org/mt/103493127/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-architecture/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to