Re: New assignment operator?


Phil Blundell
 

On Tue, Jun 15, 2021 at 10:59:40PM +0100, Richard Purdie wrote:
It certainly could be a solution to the problem but I worry that having
variables that users should touch and not touch and variables shadowing
other variables is going to get complex rather quickly, even when you just
consider how you document or "enforce" it. Do we want to encourage what
could become many more intermiediate variables? It does sound like we're 
effectively starting to write class "functions" with a list of variables
they operate on which may or may not be a good thing depending on how 
common it became.
Yes, that's a fair point. As you say, I kind of have the sense that our
classes are drifting towards being more like classes in a "real" programming
language, complete with an actual API, and possibly we ought to start
thinking about them more in those terms. As in, "if you include image.bbclass,
this is the set of variables it takes as input, and you need to give them
appropriate values".

From descriptions from others it sounds like people have creatively worked
around this kind of issue with stronger overrides which I'd not considered
and would also work, it is just a little ugly in a different way. I'd consider 
use of the forcevariable override in oe-core a metadata failing (much like 
I view _remove similarly in core).
I agree. Although it's true that _forcevariable probably would fix this
particular issue I think there's a fair chance that it will just end up creating
the opposite problem at some point in the future. I don't honestly think there
is any situation where using _forcevariable in oe-core itself would be the
right thing to do.

I suppose the other obvious tactical answer to the problem at hand is for
meta-zaurus to stop using an override at all for what it's doing. Although
possibly not quite so elegant, there's no reason that it couldn't do:

IMAGE_FSTYPES = "ext3"
# nb, include not require...
include conf/machine/zaurus/${MACHINE}-special.conf

and then in conf/machine/zaurus/collie-special.conf it could just set
IMAGE_FSTYPES = "squashfs"

directly without needing any kind of override. That said I don't entirely
understand why meta-zaurus doesn't already have a collie.conf (assuming
MACHINE=collie) where it could be doing this...

p.

Join openembedded-architecture@lists.openembedded.org to automatically receive all group messages.