On Tue, 2024-01-02 at 14:28 +0100, Adrian Freihofer wrote:
> On Wed, 2023-12-27 at 07:03 +0000, Peter Kjellerstedt via
> lists.openembedded.org wrote:
> > > -----Original Message-----
> > > From:
> > > openembedded-architecture@lists.openembedded.org <openembedded-
> > > architect...@lists.openembedded.org> On Behalf Of Joshua Watt
> > > Sent: den 22 december 2023 15:25
> > > To: Adrian Freihofer <adrian.freiho...@gmail.com>
> > > Cc: openembedded-architecture@lists.openembedded.org
> > > Subject: Re: [Openembedded-architecture] Weak PACKAGECONFIG removal
> > > 
> > > On Fri, Dec 22, 2023 at 3:46 AM Adrian Freihofer
> > > <adrian.freiho...@gmail.com> 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
> > > > > <Qi.Chen=windriver....@lists.openembedded.org> 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?

The challenge is how do these interact with the other operators and
existing conventions. Can a user reasonable predict what they might do
just from seeing them?

I've wondered about some other kinds of operator but as others have
said, people barely understand how the existing ones interact with each
other so adding more of them to the mix may make the problem worse, not
better :/.

Cheers,

Richard


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

Reply via email to