On Sun, 19 Apr 2020 18:04:34 +0100
"Richard Purdie" <[email protected]> wrote:

> I'm a bit worried about some of the mulitlib issues we've seen
> recently. In particular we have a bug where license exclusion doesn't
> work properly in multilib builds, which is fairly serious.
> 
> To dive into the details of what I found, as things stand today, the
> code sequence is:
> 
> a) bb.event.RecipePreFinalise
> b) bb.data.expandKeys()
> c) base.bbclass anonymous python
> d) multilib.bbclass anonymous python
> 
> The mutlilib code does half the work in a) but delays half to d) since
> it has to happen after python key expansion, there is no way to avoid
> that.
> 
> The issue is that there is code in base.bbclass's anonymous python
> (step c) that assumes the package information in the datastore is
> correct, yet it isn't under after d).
> 
> For example if you set: 
> 
> PACKAGES += "X-bar"
> LICENSE_${PN}-bar = "Y"
> (and PN is X)
> 
> then base.bbclass can't see the LICENSE value by iterating PACKAGES.
> Yes, you could argue PACKAGES should match the keys used but that is
> hard to enforce and really shouldn't be necessary.

At first glance this appears to be a mismatch between PACKAGES and the
override used on LICENSE. It should either be:

    PACKAGES += "X-bar"
    LICENSE_X-bar = "Y"

or

    PACKAGES += "${PN}-bar"
    LICENSE_${PN}-bar = "Y"

but mixing those is always going to lead to pain somewhere in my
experience.

Of the two I think using `${PN}` is the correct one otherwise you'd get
a clash between the package names when building with multilib (so you
get `X-bar` and `lib32-X-bar` for example instead of two packages both
named `X-bar`).

We've already got warnings for `${PN}` used in places where `${BPN}`
should really be used. Perhaps this is a case for something similar
like raising a warning if PACKAGES contains the value of PN as a
literal instead of using `${PN}`?

Thanks,

-- 
Paul Barker
Konsulko Group
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#1055): 
https://lists.openembedded.org/g/openembedded-architecture/message/1055
Mute This Topic: https://lists.openembedded.org/mt/73131657/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-architecture/unsub  
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to