diff mbox series

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

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

Commit Message

Hiago De Franco April 17, 2026, 6:36 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 on uutils-coreutils but
haven't add clang-layer.

Signed-off-by: Hiago De Franco <hfranco@baylibre.com>
---
Hello,

This is the result of a dissussion from a patch I sent to the master branch [0].
On master, this issue is actually already fixed, but not on Scarthgap.

This patch will behave like the same as before, however it now trigers a warning
instead of forcing the user to have meta-clang layer added even if is not being
used at all.

[0] https://lore.kernel.org/openembedded-devel/20260416191754.3910026-1-hfranco@baylibre.com/

Regards,
Hiago.
---
 .../uutils-coreutils/uutils-coreutils_0.0.28.bb        | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/meta-oe/recipes-core/uutils-coreutils/uutils-coreutils_0.0.28.bb b/meta-oe/recipes-core/uutils-coreutils/uutils-coreutils_0.0.28.bb
index 76cecac5a6..3d94d4c985 100644
--- a/meta-oe/recipes-core/uutils-coreutils/uutils-coreutils_0.0.28.bb
+++ b/meta-oe/recipes-core/uutils-coreutils/uutils-coreutils_0.0.28.bb
@@ -22,7 +22,15 @@  require ${BPN}-crates.inc
 PROVIDES = "coreutils"
 RPROVIDES:${PN} = "coreutils"
 
-PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'selinux', d)}"
+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] = "--with-selinux,--without-selinux,libselinux"