From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: alban.bedel@aerq.com, OE-core <openembedded-core@lists.openembedded.org>
Subject: Re: [OE-core] [PATCH] packagegroup: Properly track the enabling of complementary packages
Date: Thu, 24 Mar 2022 12:15:43 +0000 [thread overview]
Message-ID: <b0b7f6149c9396e6d961735369ab18eab2cf1237.camel@linuxfoundation.org> (raw)
In-Reply-To: <20220324114114.1665034-1-alban.bedel@aerq.com>
On Thu, 2022-03-24 at 12:41 +0100, Alban Bedel via lists.openembedded.org wrote:
> The set of packages included in a packagegroup depend on the
> PACKAGEGROUP_DISABLE_COMPLEMENTARY variable and, if that variable is
> not set to '1', on DISTRO_FEATURES. As this magic happen in a python
> function it can't be detected by the dependency system. We have to add
> these variables to the PACKAGEVARS list to have them added to the
> do_package vardeps list.
>
> Signed-off-by: Alban Bedel <alban.bedel@aerq.com>
> ---
> meta/classes/packagegroup.bbclass | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/meta/classes/packagegroup.bbclass b/meta/classes/packagegroup.bbclass
> index 557b1b6382ba..cffdaadbde0e 100644
> --- a/meta/classes/packagegroup.bbclass
> +++ b/meta/classes/packagegroup.bbclass
> @@ -31,9 +31,11 @@ python () {
> packages = [pkg + suffix for pkg in packages
> for suffix in types]
> d.setVar('PACKAGES', ' '.join(packages))
> + d.appendVar('PACKAGEVARS', ' DISTRO_FEATURES')
> for pkg in packages:
> d.setVar('ALLOW_EMPTY:%s' % pkg, '1')
> }
> +PACKAGEVARS += 'PACKAGEGROUP_DISABLE_COMPLEMENTARY'
>
That is a hugely heavy hammer to apply to the problem. We go to quite some
lengths to try and ensure changing DISTRO_FEATURES doesn't cause things to
rebuild unless they need to (e.g. by using contains()).
PACKAGEVARS is also the wrong thing for use here as it is for variables which
have per package versions (like ALLOW_EMPTY). Put another way,
PACKAGEGROUP_DISABLE_COMPLEMENTARY:${PN}-dbg makes no sense.
PACKAGES[vardeps] += "PACKAGEGROUP_DISABLE_COMPLEMENTARY"
would be the correct way to handle the first part of this. For the distro
features piece, something like this:
PACKAGES += "${@bb.utils.contains('DISTRO_FEATURES', 'ptest', '', '', d)}"
might cause the dependencies to work correctly.
Cheers,
Richard
prev parent reply other threads:[~2022-03-24 12:15 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-24 11:41 [PATCH] packagegroup: Properly track the enabling of complementary packages Alban Bedel
2022-03-24 12:15 ` Richard Purdie [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b0b7f6149c9396e6d961735369ab18eab2cf1237.camel@linuxfoundation.org \
--to=richard.purdie@linuxfoundation.org \
--cc=alban.bedel@aerq.com \
--cc=openembedded-core@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox