diff mbox series

[meta-oe] uutils-coreutils: make selinux PACKAGECONFIG dependend on clang-layer

Message ID 20260416191754.3910026-1-hfranco@baylibre.com
State New
Headers show
Series [meta-oe] uutils-coreutils: make selinux PACKAGECONFIG dependend on clang-layer | expand

Commit Message

Hiago De Franco April 16, 2026, 7:17 p.m. UTC
SELinux layer build fails if 'meta-clang' is not present, which
shouldn't happen, since 'meta-clang' isn't a dependency.

If 'selinux' is on DISTRO_FEATURES, PACKAGECONFIG calls
'clang-native' even if uutils-coreutils is not being used (this is
enough to make the recipe fails on parsing time if meta-clang is not
present).

Make 'selinux' PACKAGECONFIG dependend on clang-layer, and print a
warning if the user wants selinux support o uutils-coreutils but haven't
add clang-layer.

Signed-off-by: Hiago De Franco <hfranco@baylibre.com>
---
 .../uutils-coreutils/uutils-coreutils_0.8.0.bb       | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

Comments

Gyorgy Sarvari April 16, 2026, 7:33 p.m. UTC | #1
On 4/16/26 21:17, Hiago De Franco via lists.openembedded.org wrote:
> SELinux layer build fails if 'meta-clang' is not present, which
> shouldn't happen, since 'meta-clang' isn't a dependency.
> 
> If 'selinux' is on DISTRO_FEATURES, PACKAGECONFIG calls
> 'clang-native' even if uutils-coreutils is not being used (this is
> enough to make the recipe fails on parsing time if meta-clang is not
> present).
> 


But meta-clang doesn't provide clang-native anymore, it's a shadow of
what it used to be - clang-native comes from oe-core. Or am I
misunderstanding the problem here? I don't really get the role of
meta-clang with this recipe.



> Make 'selinux' PACKAGECONFIG dependend on clang-layer, and print a
> warning if the user wants selinux support o uutils-coreutils but haven't
> add clang-layer.
> 
> Signed-off-by: Hiago De Franco <hfranco@baylibre.com>
> ---
>  .../uutils-coreutils/uutils-coreutils_0.8.0.bb       | 12 +++++++++++-
>  1 file changed, 11 insertions(+), 1 deletion(-)
> 
> diff --git a/meta-oe/recipes-core/uutils-coreutils/uutils-coreutils_0.8.0.bb b/meta-oe/recipes-core/uutils-coreutils/uutils-coreutils_0.8.0.bb
> index 8b9b4dc199..99beb70104 100644
> --- a/meta-oe/recipes-core/uutils-coreutils/uutils-coreutils_0.8.0.bb
> +++ b/meta-oe/recipes-core/uutils-coreutils/uutils-coreutils_0.8.0.bb
> @@ -18,7 +18,17 @@ require ${BPN}-crates.inc
>  PROVIDES = "coreutils"
>  RPROVIDES:${PN} = "coreutils"
>  
> -PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'selinux systemd', d)}"
> +PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}"
> +# This is required since uutils-coreutils uses selinux features that require clang-layer
> +python __anonymous() {
> +    if bb.utils.contains('DISTRO_FEATURES', 'selinux', True, False, d):
> +        if bb.utils.contains('BBFILE_COLLECTIONS', 'clang-layer', True, False, d):
> +            d.appendVar('PACKAGECONFIG', ' selinux')
> +        else:
> +            bb.warn("selinux is enabled but clang-layer is not in BBFILE_COLLECTIONS, "
> +                "selinux support will be disabled. Add meta-clang to your bblayers.conf "
> +                "if selinux support on uutils-coreutils is required.")
> +}
>  PACKAGECONFIG[selinux] = "--features feat_selinux,,clang-native libselinux-native libselinux"
>  PACKAGECONFIG[systemd] = "--features feat_systemd_logind,,systemd"
>  
> 
> 
> 
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#126407): https://lists.openembedded.org/g/openembedded-devel/message/126407
> Mute This Topic: https://lists.openembedded.org/mt/118863961/6084445
> Group Owner: openembedded-devel+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [skandigraun@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
Hiago De Franco April 16, 2026, 9:07 p.m. UTC | #2
On Thu, Apr 16, 2026 at 09:33:48PM +0200, Gyorgy Sarvari wrote:
> On 4/16/26 21:17, Hiago De Franco via lists.openembedded.org wrote:
> > SELinux layer build fails if 'meta-clang' is not present, which
> > shouldn't happen, since 'meta-clang' isn't a dependency.
> > 
> > If 'selinux' is on DISTRO_FEATURES, PACKAGECONFIG calls
> > 'clang-native' even if uutils-coreutils is not being used (this is
> > enough to make the recipe fails on parsing time if meta-clang is not
> > present).
> > 
> 
> 
> But meta-clang doesn't provide clang-native anymore, it's a shadow of
> what it used to be - clang-native comes from oe-core. Or am I
> misunderstanding the problem here? I don't really get the role of
> meta-clang with this recipe.

You are correct, actually this is only affecting Scarthgap branch. I
fist spotted this on scarthgap, changed to master to test it too but I
probably did something wrong and kept the clang-layer or something
during my test. Sorry, my mistake.

Thanks for letting me know clang-native is actually on oe-core now, I
fount the commit [0]. So maybe I should propose a backport of this to
fix the scarthgap issue?

I will do a test now on Scarthgap, cherry-picking this commit to see how
it goes.

[0] https://github.com/openembedded/openembedded-core/commit/43ba5ed17e069b13cd43c36650524a0113c81955

Thanks,
Hiago.
> 
> 
> 
> > Make 'selinux' PACKAGECONFIG dependend on clang-layer, and print a
> > warning if the user wants selinux support o uutils-coreutils but haven't
> > add clang-layer.
> > 
> > Signed-off-by: Hiago De Franco <hfranco@baylibre.com>
> > ---
> >  .../uutils-coreutils/uutils-coreutils_0.8.0.bb       | 12 +++++++++++-
> >  1 file changed, 11 insertions(+), 1 deletion(-)
> > 
> > diff --git a/meta-oe/recipes-core/uutils-coreutils/uutils-coreutils_0.8.0.bb b/meta-oe/recipes-core/uutils-coreutils/uutils-coreutils_0.8.0.bb
> > index 8b9b4dc199..99beb70104 100644
> > --- a/meta-oe/recipes-core/uutils-coreutils/uutils-coreutils_0.8.0.bb
> > +++ b/meta-oe/recipes-core/uutils-coreutils/uutils-coreutils_0.8.0.bb
> > @@ -18,7 +18,17 @@ require ${BPN}-crates.inc
> >  PROVIDES = "coreutils"
> >  RPROVIDES:${PN} = "coreutils"
> >  
> > -PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'selinux systemd', d)}"
> > +PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}"
> > +# This is required since uutils-coreutils uses selinux features that require clang-layer
> > +python __anonymous() {
> > +    if bb.utils.contains('DISTRO_FEATURES', 'selinux', True, False, d):
> > +        if bb.utils.contains('BBFILE_COLLECTIONS', 'clang-layer', True, False, d):
> > +            d.appendVar('PACKAGECONFIG', ' selinux')
> > +        else:
> > +            bb.warn("selinux is enabled but clang-layer is not in BBFILE_COLLECTIONS, "
> > +                "selinux support will be disabled. Add meta-clang to your bblayers.conf "
> > +                "if selinux support on uutils-coreutils is required.")
> > +}
> >  PACKAGECONFIG[selinux] = "--features feat_selinux,,clang-native libselinux-native libselinux"
> >  PACKAGECONFIG[systemd] = "--features feat_systemd_logind,,systemd"
> >  
> > 
> > 
> > 
> > -=-=-=-=-=-=-=-=-=-=-=-
> > Links: You receive all messages sent to this group.
> > View/Reply Online (#126407): https://lists.openembedded.org/g/openembedded-devel/message/126407
> > Mute This Topic: https://lists.openembedded.org/mt/118863961/6084445
> > Group Owner: openembedded-devel+owner@lists.openembedded.org
> > Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [skandigraun@gmail.com]
> > -=-=-=-=-=-=-=-=-=-=-=-
> > 
>
Hiago De Franco April 16, 2026, 10:04 p.m. UTC | #3
On Thu, Apr 16, 2026 at 06:07:05PM -0300, Hiago De Franco via lists.openembedded.org wrote:
> On Thu, Apr 16, 2026 at 09:33:48PM +0200, Gyorgy Sarvari wrote:
> > On 4/16/26 21:17, Hiago De Franco via lists.openembedded.org wrote:
> > > SELinux layer build fails if 'meta-clang' is not present, which
> > > shouldn't happen, since 'meta-clang' isn't a dependency.
> > > 
> > > If 'selinux' is on DISTRO_FEATURES, PACKAGECONFIG calls
> > > 'clang-native' even if uutils-coreutils is not being used (this is
> > > enough to make the recipe fails on parsing time if meta-clang is not
> > > present).
> > > 
> > 
> > 
> > But meta-clang doesn't provide clang-native anymore, it's a shadow of
> > what it used to be - clang-native comes from oe-core. Or am I
> > misunderstanding the problem here? I don't really get the role of
> > meta-clang with this recipe.
> 
> You are correct, actually this is only affecting Scarthgap branch. I
> fist spotted this on scarthgap, changed to master to test it too but I
> probably did something wrong and kept the clang-layer or something
> during my test. Sorry, my mistake.
> 
> Thanks for letting me know clang-native is actually on oe-core now, I
> fount the commit [0]. So maybe I should propose a backport of this to
> fix the scarthgap issue?
> 
> I will do a test now on Scarthgap, cherry-picking this commit to see how
> it goes.
> 
> [0] https://github.com/openembedded/openembedded-core/commit/43ba5ed17e069b13cd43c36650524a0113c81955

So it is actually harder than only cherry-picking this commit, there are
more commits needed and they do not actually fit into Scarthgap.

A BBMASK on uutils-coreutils will fix the issue for now, until I move to
the next LTS.

Sorry for the noise, please ignore this patch since it is not suitable
for master branch.

Regards,
Hiago.
> 
> Thanks,
> Hiago.
> > 
> > 
> > 
> > > Make 'selinux' PACKAGECONFIG dependend on clang-layer, and print a
> > > warning if the user wants selinux support o uutils-coreutils but haven't
> > > add clang-layer.
> > > 
> > > Signed-off-by: Hiago De Franco <hfranco@baylibre.com>
> > > ---
> > >  .../uutils-coreutils/uutils-coreutils_0.8.0.bb       | 12 +++++++++++-
> > >  1 file changed, 11 insertions(+), 1 deletion(-)
> > > 
> > > diff --git a/meta-oe/recipes-core/uutils-coreutils/uutils-coreutils_0.8.0.bb b/meta-oe/recipes-core/uutils-coreutils/uutils-coreutils_0.8.0.bb
> > > index 8b9b4dc199..99beb70104 100644
> > > --- a/meta-oe/recipes-core/uutils-coreutils/uutils-coreutils_0.8.0.bb
> > > +++ b/meta-oe/recipes-core/uutils-coreutils/uutils-coreutils_0.8.0.bb
> > > @@ -18,7 +18,17 @@ require ${BPN}-crates.inc
> > >  PROVIDES = "coreutils"
> > >  RPROVIDES:${PN} = "coreutils"
> > >  
> > > -PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'selinux systemd', d)}"
> > > +PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}"
> > > +# This is required since uutils-coreutils uses selinux features that require clang-layer
> > > +python __anonymous() {
> > > +    if bb.utils.contains('DISTRO_FEATURES', 'selinux', True, False, d):
> > > +        if bb.utils.contains('BBFILE_COLLECTIONS', 'clang-layer', True, False, d):
> > > +            d.appendVar('PACKAGECONFIG', ' selinux')
> > > +        else:
> > > +            bb.warn("selinux is enabled but clang-layer is not in BBFILE_COLLECTIONS, "
> > > +                "selinux support will be disabled. Add meta-clang to your bblayers.conf "
> > > +                "if selinux support on uutils-coreutils is required.")
> > > +}
> > >  PACKAGECONFIG[selinux] = "--features feat_selinux,,clang-native libselinux-native libselinux"
> > >  PACKAGECONFIG[systemd] = "--features feat_systemd_logind,,systemd"
> > >  
> > > 
> > > 
> > > 
> > > 
> > > 
> > 

> 
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#126414): https://lists.openembedded.org/g/openembedded-devel/message/126414
> Mute This Topic: https://lists.openembedded.org/mt/118863961/10204532
> Group Owner: openembedded-devel+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [hfranco@baylibre.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
Gyorgy Sarvari April 17, 2026, 4:14 a.m. UTC | #4
On 4/17/26 00:04, Hiago De Franco wrote:
> On Thu, Apr 16, 2026 at 06:07:05PM -0300, Hiago De Franco via lists.openembedded.org wrote:
>> On Thu, Apr 16, 2026 at 09:33:48PM +0200, Gyorgy Sarvari wrote:
>>> On 4/16/26 21:17, Hiago De Franco via lists.openembedded.org wrote:
>>>> SELinux layer build fails if 'meta-clang' is not present, which
>>>> shouldn't happen, since 'meta-clang' isn't a dependency.
>>>>
>>>> If 'selinux' is on DISTRO_FEATURES, PACKAGECONFIG calls
>>>> 'clang-native' even if uutils-coreutils is not being used (this is
>>>> enough to make the recipe fails on parsing time if meta-clang is not
>>>> present).
>>>>
>>>
>>>
>>> But meta-clang doesn't provide clang-native anymore, it's a shadow of
>>> what it used to be - clang-native comes from oe-core. Or am I
>>> misunderstanding the problem here? I don't really get the role of
>>> meta-clang with this recipe.
>>
>> You are correct, actually this is only affecting Scarthgap branch. I
>> fist spotted this on scarthgap, changed to master to test it too but I
>> probably did something wrong and kept the clang-layer or something
>> during my test. Sorry, my mistake.
>>
>> Thanks for letting me know clang-native is actually on oe-core now, I
>> fount the commit [0]. So maybe I should propose a backport of this to
>> fix the scarthgap issue?
>>
>> I will do a test now on Scarthgap, cherry-picking this commit to see how
>> it goes.
>>
>> [0] https://github.com/openembedded/openembedded-core/commit/43ba5ed17e069b13cd43c36650524a0113c81955
> 
> So it is actually harder than only cherry-picking this commit, there are
> more commits needed and they do not actually fit into Scarthgap.

That commit was a very major change in oe-core that took months to sort
out, it wouldn't be considered for acceptance in Scarthgap.

> 
> A BBMASK on uutils-coreutils will fix the issue for now, until I move to
> the next LTS.


I think your patch could be acceptable and useful for Scarthgap, if you
are interested in that.


> 
> Sorry for the noise, please ignore this patch since it is not suitable
> for master branch.
> 
> Regards,
> Hiago.
>>
>> Thanks,
>> Hiago.
>>>
>>>
>>>
>>>> Make 'selinux' PACKAGECONFIG dependend on clang-layer, and print a
>>>> warning if the user wants selinux support o uutils-coreutils but haven't
>>>> add clang-layer.
>>>>
>>>> Signed-off-by: Hiago De Franco <hfranco@baylibre.com>
>>>> ---
>>>>  .../uutils-coreutils/uutils-coreutils_0.8.0.bb       | 12 +++++++++++-
>>>>  1 file changed, 11 insertions(+), 1 deletion(-)
>>>>
>>>> diff --git a/meta-oe/recipes-core/uutils-coreutils/uutils-coreutils_0.8.0.bb b/meta-oe/recipes-core/uutils-coreutils/uutils-coreutils_0.8.0.bb
>>>> index 8b9b4dc199..99beb70104 100644
>>>> --- a/meta-oe/recipes-core/uutils-coreutils/uutils-coreutils_0.8.0.bb
>>>> +++ b/meta-oe/recipes-core/uutils-coreutils/uutils-coreutils_0.8.0.bb
>>>> @@ -18,7 +18,17 @@ require ${BPN}-crates.inc
>>>>  PROVIDES = "coreutils"
>>>>  RPROVIDES:${PN} = "coreutils"
>>>>  
>>>> -PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'selinux systemd', d)}"
>>>> +PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}"
>>>> +# This is required since uutils-coreutils uses selinux features that require clang-layer
>>>> +python __anonymous() {
>>>> +    if bb.utils.contains('DISTRO_FEATURES', 'selinux', True, False, d):
>>>> +        if bb.utils.contains('BBFILE_COLLECTIONS', 'clang-layer', True, False, d):
>>>> +            d.appendVar('PACKAGECONFIG', ' selinux')
>>>> +        else:
>>>> +            bb.warn("selinux is enabled but clang-layer is not in BBFILE_COLLECTIONS, "
>>>> +                "selinux support will be disabled. Add meta-clang to your bblayers.conf "
>>>> +                "if selinux support on uutils-coreutils is required.")
>>>> +}
>>>>  PACKAGECONFIG[selinux] = "--features feat_selinux,,clang-native libselinux-native libselinux"
>>>>  PACKAGECONFIG[systemd] = "--features feat_systemd_logind,,systemd"
>>>>  
>>>>
>>>>
>>>>
>>>>
>>>>
>>>
> 
>>
>> -=-=-=-=-=-=-=-=-=-=-=-
>> Links: You receive all messages sent to this group.
>> View/Reply Online (#126414): https://lists.openembedded.org/g/openembedded-devel/message/126414
>> Mute This Topic: https://lists.openembedded.org/mt/118863961/10204532
>> Group Owner: openembedded-devel+owner@lists.openembedded.org
>> Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [hfranco@baylibre.com]
>> -=-=-=-=-=-=-=-=-=-=-=-
>>
>
Clayton Casciato April 17, 2026, 1:18 p.m. UTC | #5
>>
>> A BBMASK on uutils-coreutils will fix the issue for now, until I move to
>> the next LTS.

This is my current workaround.

> 
> 
> I think your patch could be acceptable and useful for Scarthgap, if you
> are interested in that.
> 
> 

This was an attempt to fix the problem on Scarthgap:
https://lists.openembedded.org/g/openembedded-devel/topic/118522554
Hiago De Franco April 17, 2026, 1:56 p.m. UTC | #6
On Fri, Apr 17, 2026 at 06:14:14AM +0200, Gyorgy Sarvari wrote:
> 
> 
> On 4/17/26 00:04, Hiago De Franco wrote:
> > On Thu, Apr 16, 2026 at 06:07:05PM -0300, Hiago De Franco via lists.openembedded.org wrote:
> >> On Thu, Apr 16, 2026 at 09:33:48PM +0200, Gyorgy Sarvari wrote:
> >>> On 4/16/26 21:17, Hiago De Franco via lists.openembedded.org wrote:
> >>>> SELinux layer build fails if 'meta-clang' is not present, which
> >>>> shouldn't happen, since 'meta-clang' isn't a dependency.
> >>>>
> >>>> If 'selinux' is on DISTRO_FEATURES, PACKAGECONFIG calls
> >>>> 'clang-native' even if uutils-coreutils is not being used (this is
> >>>> enough to make the recipe fails on parsing time if meta-clang is not
> >>>> present).
> >>>>
> >>>
> >>>
> >>> But meta-clang doesn't provide clang-native anymore, it's a shadow of
> >>> what it used to be - clang-native comes from oe-core. Or am I
> >>> misunderstanding the problem here? I don't really get the role of
> >>> meta-clang with this recipe.
> >>
> >> You are correct, actually this is only affecting Scarthgap branch. I
> >> fist spotted this on scarthgap, changed to master to test it too but I
> >> probably did something wrong and kept the clang-layer or something
> >> during my test. Sorry, my mistake.
> >>
> >> Thanks for letting me know clang-native is actually on oe-core now, I
> >> fount the commit [0]. So maybe I should propose a backport of this to
> >> fix the scarthgap issue?
> >>
> >> I will do a test now on Scarthgap, cherry-picking this commit to see how
> >> it goes.
> >>
> >> [0] https://github.com/openembedded/openembedded-core/commit/43ba5ed17e069b13cd43c36650524a0113c81955
> > 
> > So it is actually harder than only cherry-picking this commit, there are
> > more commits needed and they do not actually fit into Scarthgap.
> 
> That commit was a very major change in oe-core that took months to sort
> out, it wouldn't be considered for acceptance in Scarthgap.
> 
> > 
> > A BBMASK on uutils-coreutils will fix the issue for now, until I move to
> > the next LTS.
> 
> 
> I think your patch could be acceptable and useful for Scarthgap, if you
> are interested in that.

I am interested. Just for clarification, you mean the original patch I
sent, not the BBMASK patch, right?

If this is about the original patch, I can add it to Scarthgap and
re-send.

Regards,
Hiago.

> 
> 
> > 
> > Sorry for the noise, please ignore this patch since it is not suitable
> > for master branch.
> > 
> > Regards,
> > Hiago.
> >>
> >> Thanks,
> >> Hiago.
> >>>
> >>>
> >>>
> >>>> Make 'selinux' PACKAGECONFIG dependend on clang-layer, and print a
> >>>> warning if the user wants selinux support o uutils-coreutils but haven't
> >>>> add clang-layer.
> >>>>
> >>>> Signed-off-by: Hiago De Franco <hfranco@baylibre.com>
> >>>> ---
> >>>>  .../uutils-coreutils/uutils-coreutils_0.8.0.bb       | 12 +++++++++++-
> >>>>  1 file changed, 11 insertions(+), 1 deletion(-)
> >>>>
> >>>> diff --git a/meta-oe/recipes-core/uutils-coreutils/uutils-coreutils_0.8.0.bb b/meta-oe/recipes-core/uutils-coreutils/uutils-coreutils_0.8.0.bb
> >>>> index 8b9b4dc199..99beb70104 100644
> >>>> --- a/meta-oe/recipes-core/uutils-coreutils/uutils-coreutils_0.8.0.bb
> >>>> +++ b/meta-oe/recipes-core/uutils-coreutils/uutils-coreutils_0.8.0.bb
> >>>> @@ -18,7 +18,17 @@ require ${BPN}-crates.inc
> >>>>  PROVIDES = "coreutils"
> >>>>  RPROVIDES:${PN} = "coreutils"
> >>>>  
> >>>> -PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'selinux systemd', d)}"
> >>>> +PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}"
> >>>> +# This is required since uutils-coreutils uses selinux features that require clang-layer
> >>>> +python __anonymous() {
> >>>> +    if bb.utils.contains('DISTRO_FEATURES', 'selinux', True, False, d):
> >>>> +        if bb.utils.contains('BBFILE_COLLECTIONS', 'clang-layer', True, False, d):
> >>>> +            d.appendVar('PACKAGECONFIG', ' selinux')
> >>>> +        else:
> >>>> +            bb.warn("selinux is enabled but clang-layer is not in BBFILE_COLLECTIONS, "
> >>>> +                "selinux support will be disabled. Add meta-clang to your bblayers.conf "
> >>>> +                "if selinux support on uutils-coreutils is required.")
> >>>> +}
> >>>>  PACKAGECONFIG[selinux] = "--features feat_selinux,,clang-native libselinux-native libselinux"
> >>>>  PACKAGECONFIG[systemd] = "--features feat_systemd_logind,,systemd"
> >>>>  
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>
> > 
> >>
> >> -=-=-=-=-=-=-=-=-=-=-=-
> >> Links: You receive all messages sent to this group.
> >> View/Reply Online (#126414): https://lists.openembedded.org/g/openembedded-devel/message/126414
> >> Mute This Topic: https://lists.openembedded.org/mt/118863961/10204532
> >> Group Owner: openembedded-devel+owner@lists.openembedded.org
> >> Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [hfranco@baylibre.com]
> >> -=-=-=-=-=-=-=-=-=-=-=-
> >>
> > 
>
Khem Raj April 17, 2026, 3:19 p.m. UTC | #7
On Thu, Apr 16, 2026 at 12:18 PM Hiago De Franco via lists.openembedded.org
<hfranco=baylibre.com@lists.openembedded.org> wrote:

> SELinux layer build fails if 'meta-clang' is not present, which
> shouldn't happen, since 'meta-clang' isn't a dependency.
>
> If 'selinux' is on DISTRO_FEATURES, PACKAGECONFIG calls
> 'clang-native' even if uutils-coreutils is not being used (this is
> enough to make the recipe fails on parsing time if meta-clang is not
> present).
>
> Make 'selinux' PACKAGECONFIG dependend on clang-layer, and print a
> warning if the user wants selinux support o uutils-coreutils but haven't
> add clang-layer.
>
> Signed-off-by: Hiago De Franco <hfranco@baylibre.com>
> ---
>  .../uutils-coreutils/uutils-coreutils_0.8.0.bb       | 12 +++++++++++-
>  1 file changed, 11 insertions(+), 1 deletion(-)
>
> diff --git a/meta-oe/recipes-core/uutils-coreutils/
> uutils-coreutils_0.8.0.bb b/meta-oe/recipes-core/uutils-coreutils/
> uutils-coreutils_0.8.0.bb
> index 8b9b4dc199..99beb70104 100644
> --- a/meta-oe/recipes-core/uutils-coreutils/uutils-coreutils_0.8.0.bb
> +++ b/meta-oe/recipes-core/uutils-coreutils/uutils-coreutils_0.8.0.bb
> @@ -18,7 +18,17 @@ require ${BPN}-crates.inc
>  PROVIDES = "coreutils"
>  RPROVIDES:${PN} = "coreutils"
>
> -PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'selinux
> systemd', d)}"
> +PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}"
> +# This is required since uutils-coreutils uses selinux features that
> require clang-layer
> +python __anonymous() {
> +    if bb.utils.contains('DISTRO_FEATURES', 'selinux', True, False, d):
> +        if bb.utils.contains('BBFILE_COLLECTIONS', 'clang-layer', True,
> False, d):
> +            d.appendVar('PACKAGECONFIG', ' selinux')
> +        else:
> +            bb.warn("selinux is enabled but clang-layer is not in
> BBFILE_COLLECTIONS, "
> +                "selinux support will be disabled. Add meta-clang to your
> bblayers.conf "
> +                "if selinux support on uutils-coreutils is required.")
> +}
>

what does it need from meta-clang these days, we have merged clang compiler
infrastructure in
core layer on master.


>  PACKAGECONFIG[selinux] = "--features feat_selinux,,clang-native
> libselinux-native libselinux"
>  PACKAGECONFIG[systemd] = "--features feat_systemd_logind,,systemd"
>
> --
> 2.51.0
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#126407):
> https://lists.openembedded.org/g/openembedded-devel/message/126407
> Mute This Topic: https://lists.openembedded.org/mt/118863961/1997914
> Group Owner: openembedded-devel+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [
> raj.khem@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
>
Gyorgy Sarvari April 17, 2026, 4:21 p.m. UTC | #8
On 4/17/26 15:56, Hiago De Franco wrote:
> On Fri, Apr 17, 2026 at 06:14:14AM +0200, Gyorgy Sarvari wrote:
>>
>>
>> On 4/17/26 00:04, Hiago De Franco wrote:
>>> On Thu, Apr 16, 2026 at 06:07:05PM -0300, Hiago De Franco via lists.openembedded.org wrote:
>>>> On Thu, Apr 16, 2026 at 09:33:48PM +0200, Gyorgy Sarvari wrote:
>>>>> On 4/16/26 21:17, Hiago De Franco via lists.openembedded.org wrote:
>>>>>> SELinux layer build fails if 'meta-clang' is not present, which
>>>>>> shouldn't happen, since 'meta-clang' isn't a dependency.
>>>>>>
>>>>>> If 'selinux' is on DISTRO_FEATURES, PACKAGECONFIG calls
>>>>>> 'clang-native' even if uutils-coreutils is not being used (this is
>>>>>> enough to make the recipe fails on parsing time if meta-clang is not
>>>>>> present).
>>>>>>
>>>>>
>>>>>
>>>>> But meta-clang doesn't provide clang-native anymore, it's a shadow of
>>>>> what it used to be - clang-native comes from oe-core. Or am I
>>>>> misunderstanding the problem here? I don't really get the role of
>>>>> meta-clang with this recipe.
>>>>
>>>> You are correct, actually this is only affecting Scarthgap branch. I
>>>> fist spotted this on scarthgap, changed to master to test it too but I
>>>> probably did something wrong and kept the clang-layer or something
>>>> during my test. Sorry, my mistake.
>>>>
>>>> Thanks for letting me know clang-native is actually on oe-core now, I
>>>> fount the commit [0]. So maybe I should propose a backport of this to
>>>> fix the scarthgap issue?
>>>>
>>>> I will do a test now on Scarthgap, cherry-picking this commit to see how
>>>> it goes.
>>>>
>>>> [0] https://github.com/openembedded/openembedded-core/commit/43ba5ed17e069b13cd43c36650524a0113c81955
>>>
>>> So it is actually harder than only cherry-picking this commit, there are
>>> more commits needed and they do not actually fit into Scarthgap.
>>
>> That commit was a very major change in oe-core that took months to sort
>> out, it wouldn't be considered for acceptance in Scarthgap.
>>
>>>
>>> A BBMASK on uutils-coreutils will fix the issue for now, until I move to
>>> the next LTS.
>>
>>
>> I think your patch could be acceptable and useful for Scarthgap, if you
>> are interested in that.
> 
> I am interested. Just for clarification, you mean the original patch I
> sent, not the BBMASK patch, right?
> 
> If this is about the original patch, I can add it to Scarthgap and
> re-send.
> 

Yes, I meant it for the original patch - I didn't realize that Clayton
took a stab at the very same issue also. This is an issue that I think
deserves a patch, it does have a hidden dependency on meta-clang which
is not nice, and apparently caused some headaches for multiple people.

I do see Anuj's issue with Clayton's patch, as it changes the default
behavior - I think this patch could have a better chance as it tries to
keep the original behavior.

But overall I don't have a strong opinion on the way it is solved, if
there is a patch that makes everyone happy.


> Regards,
> Hiago.
> 
>>
>>
>>>
>>> Sorry for the noise, please ignore this patch since it is not suitable
>>> for master branch.
>>>
>>> Regards,
>>> Hiago.
>>>>
>>>> Thanks,
>>>> Hiago.
>>>>>
>>>>>
>>>>>
>>>>>> Make 'selinux' PACKAGECONFIG dependend on clang-layer, and print a
>>>>>> warning if the user wants selinux support o uutils-coreutils but haven't
>>>>>> add clang-layer.
>>>>>>
>>>>>> Signed-off-by: Hiago De Franco <hfranco@baylibre.com>
>>>>>> ---
>>>>>>  .../uutils-coreutils/uutils-coreutils_0.8.0.bb       | 12 +++++++++++-
>>>>>>  1 file changed, 11 insertions(+), 1 deletion(-)
>>>>>>
>>>>>> diff --git a/meta-oe/recipes-core/uutils-coreutils/uutils-coreutils_0.8.0.bb b/meta-oe/recipes-core/uutils-coreutils/uutils-coreutils_0.8.0.bb
>>>>>> index 8b9b4dc199..99beb70104 100644
>>>>>> --- a/meta-oe/recipes-core/uutils-coreutils/uutils-coreutils_0.8.0.bb
>>>>>> +++ b/meta-oe/recipes-core/uutils-coreutils/uutils-coreutils_0.8.0.bb
>>>>>> @@ -18,7 +18,17 @@ require ${BPN}-crates.inc
>>>>>>  PROVIDES = "coreutils"
>>>>>>  RPROVIDES:${PN} = "coreutils"
>>>>>>  
>>>>>> -PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'selinux systemd', d)}"
>>>>>> +PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}"
>>>>>> +# This is required since uutils-coreutils uses selinux features that require clang-layer
>>>>>> +python __anonymous() {
>>>>>> +    if bb.utils.contains('DISTRO_FEATURES', 'selinux', True, False, d):
>>>>>> +        if bb.utils.contains('BBFILE_COLLECTIONS', 'clang-layer', True, False, d):
>>>>>> +            d.appendVar('PACKAGECONFIG', ' selinux')
>>>>>> +        else:
>>>>>> +            bb.warn("selinux is enabled but clang-layer is not in BBFILE_COLLECTIONS, "
>>>>>> +                "selinux support will be disabled. Add meta-clang to your bblayers.conf "
>>>>>> +                "if selinux support on uutils-coreutils is required.")
>>>>>> +}
>>>>>>  PACKAGECONFIG[selinux] = "--features feat_selinux,,clang-native libselinux-native libselinux"
>>>>>>  PACKAGECONFIG[systemd] = "--features feat_systemd_logind,,systemd"
>>>>>>  
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>
>>>>
>>>> -=-=-=-=-=-=-=-=-=-=-=-
>>>> Links: You receive all messages sent to this group.
>>>> View/Reply Online (#126414): https://lists.openembedded.org/g/openembedded-devel/message/126414
>>>> Mute This Topic: https://lists.openembedded.org/mt/118863961/10204532
>>>> Group Owner: openembedded-devel+owner@lists.openembedded.org
>>>> Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [hfranco@baylibre.com]
>>>> -=-=-=-=-=-=-=-=-=-=-=-
>>>>
>>>
>>
Hiago De Franco April 17, 2026, 6:32 p.m. UTC | #9
On Fri, Apr 17, 2026 at 06:21:12PM +0200, Gyorgy Sarvari wrote:
> On 4/17/26 15:56, Hiago De Franco wrote:
> > On Fri, Apr 17, 2026 at 06:14:14AM +0200, Gyorgy Sarvari wrote:
> >>
> >>
> >> On 4/17/26 00:04, Hiago De Franco wrote:
> >>> On Thu, Apr 16, 2026 at 06:07:05PM -0300, Hiago De Franco via lists.openembedded.org wrote:
> >>>> On Thu, Apr 16, 2026 at 09:33:48PM +0200, Gyorgy Sarvari wrote:
> >>>>> On 4/16/26 21:17, Hiago De Franco via lists.openembedded.org wrote:
> >>>>>> SELinux layer build fails if 'meta-clang' is not present, which
> >>>>>> shouldn't happen, since 'meta-clang' isn't a dependency.
> >>>>>>
> >>>>>> If 'selinux' is on DISTRO_FEATURES, PACKAGECONFIG calls
> >>>>>> 'clang-native' even if uutils-coreutils is not being used (this is
> >>>>>> enough to make the recipe fails on parsing time if meta-clang is not
> >>>>>> present).
> >>>>>>
> >>>>>
> >>>>>
> >>>>> But meta-clang doesn't provide clang-native anymore, it's a shadow of
> >>>>> what it used to be - clang-native comes from oe-core. Or am I
> >>>>> misunderstanding the problem here? I don't really get the role of
> >>>>> meta-clang with this recipe.
> >>>>
> >>>> You are correct, actually this is only affecting Scarthgap branch. I
> >>>> fist spotted this on scarthgap, changed to master to test it too but I
> >>>> probably did something wrong and kept the clang-layer or something
> >>>> during my test. Sorry, my mistake.
> >>>>
> >>>> Thanks for letting me know clang-native is actually on oe-core now, I
> >>>> fount the commit [0]. So maybe I should propose a backport of this to
> >>>> fix the scarthgap issue?
> >>>>
> >>>> I will do a test now on Scarthgap, cherry-picking this commit to see how
> >>>> it goes.
> >>>>
> >>>> [0] https://github.com/openembedded/openembedded-core/commit/43ba5ed17e069b13cd43c36650524a0113c81955
> >>>
> >>> So it is actually harder than only cherry-picking this commit, there are
> >>> more commits needed and they do not actually fit into Scarthgap.
> >>
> >> That commit was a very major change in oe-core that took months to sort
> >> out, it wouldn't be considered for acceptance in Scarthgap.
> >>
> >>>
> >>> A BBMASK on uutils-coreutils will fix the issue for now, until I move to
> >>> the next LTS.
> >>
> >>
> >> I think your patch could be acceptable and useful for Scarthgap, if you
> >> are interested in that.
> > 
> > I am interested. Just for clarification, you mean the original patch I
> > sent, not the BBMASK patch, right?
> > 
> > If this is about the original patch, I can add it to Scarthgap and
> > re-send.
> > 
> 
> Yes, I meant it for the original patch - I didn't realize that Clayton
> took a stab at the very same issue also. This is an issue that I think
> deserves a patch, it does have a hidden dependency on meta-clang which
> is not nice, and apparently caused some headaches for multiple people.
> 
> I do see Anuj's issue with Clayton's patch, as it changes the default
> behavior - I think this patch could have a better chance as it tries to
> keep the original behavior.
> 
> But overall I don't have a strong opinion on the way it is solved, if
> there is a patch that makes everyone happy.

Got it, thanks. I will submit the patch to scarthgap, let's seeh how it
goes.

> 
> 
> > Regards,
> > Hiago.
> > 
> >>
> >>
> >>>
> >>> Sorry for the noise, please ignore this patch since it is not suitable
> >>> for master branch.
> >>>
> >>> Regards,
> >>> Hiago.
> >>>>
> >>>> Thanks,
> >>>> Hiago.
> >>>>>
> >>>>>
> >>>>>
> >>>>>> Make 'selinux' PACKAGECONFIG dependend on clang-layer, and print a
> >>>>>> warning if the user wants selinux support o uutils-coreutils but haven't
> >>>>>> add clang-layer.
> >>>>>>
> >>>>>> Signed-off-by: Hiago De Franco <hfranco@baylibre.com>
> >>>>>> ---
> >>>>>>  .../uutils-coreutils/uutils-coreutils_0.8.0.bb       | 12 +++++++++++-
> >>>>>>  1 file changed, 11 insertions(+), 1 deletion(-)
> >>>>>>
> >>>>>> diff --git a/meta-oe/recipes-core/uutils-coreutils/uutils-coreutils_0.8.0.bb b/meta-oe/recipes-core/uutils-coreutils/uutils-coreutils_0.8.0.bb
> >>>>>> index 8b9b4dc199..99beb70104 100644
> >>>>>> --- a/meta-oe/recipes-core/uutils-coreutils/uutils-coreutils_0.8.0.bb
> >>>>>> +++ b/meta-oe/recipes-core/uutils-coreutils/uutils-coreutils_0.8.0.bb
> >>>>>> @@ -18,7 +18,17 @@ require ${BPN}-crates.inc
> >>>>>>  PROVIDES = "coreutils"
> >>>>>>  RPROVIDES:${PN} = "coreutils"
> >>>>>>  
> >>>>>> -PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'selinux systemd', d)}"
> >>>>>> +PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}"
> >>>>>> +# This is required since uutils-coreutils uses selinux features that require clang-layer
> >>>>>> +python __anonymous() {
> >>>>>> +    if bb.utils.contains('DISTRO_FEATURES', 'selinux', True, False, d):
> >>>>>> +        if bb.utils.contains('BBFILE_COLLECTIONS', 'clang-layer', True, False, d):
> >>>>>> +            d.appendVar('PACKAGECONFIG', ' selinux')
> >>>>>> +        else:
> >>>>>> +            bb.warn("selinux is enabled but clang-layer is not in BBFILE_COLLECTIONS, "
> >>>>>> +                "selinux support will be disabled. Add meta-clang to your bblayers.conf "
> >>>>>> +                "if selinux support on uutils-coreutils is required.")
> >>>>>> +}
> >>>>>>  PACKAGECONFIG[selinux] = "--features feat_selinux,,clang-native libselinux-native libselinux"
> >>>>>>  PACKAGECONFIG[systemd] = "--features feat_systemd_logind,,systemd"
> >>>>>>  
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>
> >>>
> >>>>
> >>>> -=-=-=-=-=-=-=-=-=-=-=-
> >>>> Links: You receive all messages sent to this group.
> >>>> View/Reply Online (#126414): https://lists.openembedded.org/g/openembedded-devel/message/126414
> >>>> Mute This Topic: https://lists.openembedded.org/mt/118863961/10204532
> >>>> Group Owner: openembedded-devel+owner@lists.openembedded.org
> >>>> Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [hfranco@baylibre.com]
> >>>> -=-=-=-=-=-=-=-=-=-=-=-
> >>>>
> >>>
> >>
>
diff mbox series

Patch

diff --git a/meta-oe/recipes-core/uutils-coreutils/uutils-coreutils_0.8.0.bb b/meta-oe/recipes-core/uutils-coreutils/uutils-coreutils_0.8.0.bb
index 8b9b4dc199..99beb70104 100644
--- a/meta-oe/recipes-core/uutils-coreutils/uutils-coreutils_0.8.0.bb
+++ b/meta-oe/recipes-core/uutils-coreutils/uutils-coreutils_0.8.0.bb
@@ -18,7 +18,17 @@  require ${BPN}-crates.inc
 PROVIDES = "coreutils"
 RPROVIDES:${PN} = "coreutils"
 
-PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'selinux systemd', d)}"
+PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}"
+# This is required since uutils-coreutils uses selinux features that require clang-layer
+python __anonymous() {
+    if bb.utils.contains('DISTRO_FEATURES', 'selinux', True, False, d):
+        if bb.utils.contains('BBFILE_COLLECTIONS', 'clang-layer', True, False, d):
+            d.appendVar('PACKAGECONFIG', ' selinux')
+        else:
+            bb.warn("selinux is enabled but clang-layer is not in BBFILE_COLLECTIONS, "
+                "selinux support will be disabled. Add meta-clang to your bblayers.conf "
+                "if selinux support on uutils-coreutils is required.")
+}
 PACKAGECONFIG[selinux] = "--features feat_selinux,,clang-native libselinux-native libselinux"
 PACKAGECONFIG[systemd] = "--features feat_systemd_logind,,systemd"