On Wed, 2023-12-27 at 07:03 +0000, Peter Kjellerstedt via
lists.openembedded.org wrote:
> > -----Original Message-----
> > From:
> > [email protected] <openembedded-
> > [email protected]> On Behalf Of Joshua Watt
> > Sent: den 22 december 2023 15:25
> > To: Adrian Freihofer <[email protected]>
> > Cc: [email protected]
> > Subject: Re: [Openembedded-architecture] Weak PACKAGECONFIG removal
> > 
> > On Fri, Dec 22, 2023 at 3:46 AM Adrian Freihofer
> > <[email protected]> wrote:
> > > 
> > > On Fri, 2023-12-22 at 10:25 +0000, Ross Burton via
> > > lists.openembedded.org wrote:
> > > > On 22 Dec 2023, at 04:59, Chen Qi via lists.openembedded.org
> > > > <[email protected]> wrote:
> > > > > > One of the major things that comes up frequently is that
> > > > > > the
> > > > > > PACKAGECONFIG for a recipe needs to be modified to remove
> > > > > > some
> > > > > > incompatible flag from the default options. This particular
> > > > > > option is
> > > > > > not very simple though, because most recipes set
> > > > > > PACKAGECONFIG
> > > > > > using
> > > > > > the "deferred weak" assignment, as in `PACKAGECONFIG ??=
> > > > > > "foo
> > > > > > bar"`.
> > > > > > Because of this, any operation that attempts to modify this
> > > > > > variable
> > > > > > will overwrite the default; commonly one might like to do
> > > > > > something
> > > > > > like `PACKAGECONFIG:remove = "foo"`, but since this happens
> > > > > > before
> > > > > > weak assignment, the result is an empty string instead of
> > > > > > just
> > > > > > the
> > > > > > value "bar".
> > > > > 
> > > > > Checking the master branch, and I get a different result.
> > > > 
> > > > Indeed. With this in local.conf, or split across a
> > > > recipe/bbappend:
> > > > 
> > > > FOOBAR ??= "foo bar"
> > > > FOOBAR:remove = “foo"
> > > > 
> > > > $ bitbake-getvar  FOOBAR
> > > > #
> > > > # $FOOBAR [2 operations]
> > > > #   set /yocto/ross/build/conf/local.conf:495
> > > > #     [_defaultval] "foo bar"
> > > > #   :remove /yocto/ross/build/conf/local.conf:496
> > > > #     "foo"
> > > > # pre-expansion value:
> > > > #   "foo bar"
> > > > FOOBAR=" bar”
> > > > 
> > > > $ bitbake-getvar  FOOBAR -r psplash
> > > > #
> > > > # $FOOBAR [2 operations]
> > > > #   set /home/ross/Yocto/poky/meta/recipes-
> > > > core/psplash/psplash_git.bb:133
> > > > #     [_defaultval] "foo bar"
> > > > #   :remove /home/ross/Yocto/poky/meta-poky/recipes-
> > > > core/psplash/psplash_git.bbappend:3
> > > > #     "foo"
> > > > # pre-expansion value:
> > > > #   "foo bar"
> > > > FOOBAR=" bar”
> > > > 
> > > > Josh: can you provide a minimal reproducer, or did this quietly
> > > > change behaviour at some point?
> > > 
> > > When I read this discussion a few days ago, I also wondered. For
> > > example, we have systemd on kirkstone which does:
> > > 
> > > PACKAGECONFIG ??= " \
> > >     ${@bb.utils.filter('DISTRO_FEATURES', 'acl audit efi...
> > >     ...
> > > "
> > > 
> > > and in the distro there is for example:
> > > 
> > > PACKAGECONFIG:append:pn-systemd = " cgroupv2"
> > > PACKAGECONFIG:remove:pn-systemd = "sysvinit"
> > > 
> > > The append and the remove operators do not reset the
> > > PACKAGECONFIG to
> > > "".
> > > 
> > > I see that e.g. += can be misleading. But append and remove seam
> > > to
> > > work as expected (by me) on kirkstone.
> > 
> > Yes,
> > 
> > You and Ross are correct. For some reason, I was mentally hung up
> > on
> > PACKAGECONFIG:pn-systemd:remove being the correct way to do this,
> > which is very obviously wrong after you think about it.
> > 
> > AFAICT, there is no reason to make any changes, and I sincerely
> > apologize for wasting everyone's time and sanity on this e-mail
> > chain.
> 
> Actually, I do not think it was a waste of time, because even if
> :append 
> and :remove do work with ??=, you are forced to use :append if you
> want to 
> add to PACKAGECONFIG in a bbappend. You cannot use +=. Changing the
> recipes 
> to use = instead of ??= would allow this, without changing anything
> else 
> (except for the case that Ross noted, which was wrong to begin with).
> 

Could some additional operators such as ?+=, ??+=, ?=+, ??=+, -=, ?-=,
??-=, =-, ?=-, ??=- make this behavior more obvious?

> > 
> > Joshua Watt
> > 
> > > Adrian
> > > 
> > > > Ross
> 
> //Peter
> 
> 
> 
> 

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#1902): 
https://lists.openembedded.org/g/openembedded-architecture/message/1902
Mute This Topic: https://lists.openembedded.org/mt/103269425/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-architecture/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to