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 <[email protected]>
> ---
> 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
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#163608):
https://lists.openembedded.org/g/openembedded-core/message/163608
Mute This Topic: https://lists.openembedded.org/mt/89997103/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-