On Fri, 2023-12-08 at 08:15 +0000, Alex Kiernan wrote:
> On Thu, Dec 7, 2023 at 10:40 PM Richard Purdie
> <richard.pur...@linuxfoundation.org> wrote:
> > 
> > On Thu, 2023-12-07 at 13:39 +0000, Alex Kiernan wrote:
> > > cargo_common_do_configure uses CARGO_MANIFEST_PATH (which depends on
> > > CARGO_SRC_DIR), but their definition was in cargo.bbclass.
> > > 
> > > Match the other variables here and change to default values, rather
> > > than weak defaults.
> > 
> > FWIW "single value" class variables tend to work much better as ??=
> > (which I'd call default value) since than it doesn't matter if the
> > recipe setting comes before or after the inherit and the inherit
> > position in the recipe doesn't matter.
> > 
> 
> Ah, I guess that makes sense - for "single value" :append/:remove
> aren't really useful, so leaving the actual assignment as late as
> possible works?

??= means "fall back to this value if nothing else is ever set".

For a single value, append or += never makes sense so the fallback is
probably what we want from a class regardless of order.

If you use ?= it just adds some ordering constraints.

> TBH I've never really been very clear what the "right" thing to use is
> between ?= and ??=

For the above case it is one of the few "clearer" cases. As soon as you
have multiple values, it becomes fuzzy sadly. I'm not sure how we
improve things either.

Cheers,

Richard
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#192017): 
https://lists.openembedded.org/g/openembedded-core/message/192017
Mute This Topic: https://lists.openembedded.org/mt/103034028/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to