From ed5c76bdd9edf7543a3a643922e160618582f320 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Mon, 27 Jul 2026 22:36:42 +0000 Subject: [PATCH] uutils-coreutils: Exclude from world unless it is the selected provider uutils-coreutils sets PROVIDES/RPROVIDES = "coreutils" and is a drop-in replacement that cannot coexist with GNU coreutils; both ship the same update-alternatives links. meta-oe/conf/layer.conf already selects between them with PREFERRED_PROVIDER_coreutils{,-native,nativesdk-}, defaulting to GNU coreutils. PREFERRED_PROVIDER only disambiguates providers reached through a dependency, not recipes built as explicit targets. Since uutils-coreutils was in world, 'bitbake world' and 'bitbake universe' pulled both recipes into the same task graph as targets, so bitbake reported: NOTE: Multiple .bb files are due to be built which each provide coreutils: NOTE: Multiple .bb files are due to be built which each provide coreutils-native: NOTE: Multiple .bb files are due to be built which each provide nativesdk-coreutils: Key EXCLUDE_FROM_WORLD off the selected provider so only the chosen implementation is built in world/universe. Building uutils-coreutils explicitly, or selecting it via PREFERRED_PROVIDER_coreutils, still works. This follows the existing conditional EXCLUDE_FROM_WORLD idiom used by mpv, sox and vlc. Signed-off-by: Khem Raj --- .../uutils-coreutils/uutils-coreutils_0.9.0.bb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/meta-oe/recipes-core/uutils-coreutils/uutils-coreutils_0.9.0.bb b/meta-oe/recipes-core/uutils-coreutils/uutils-coreutils_0.9.0.bb index 2c7d3a3200..9d16342e5c 100644 --- a/meta-oe/recipes-core/uutils-coreutils/uutils-coreutils_0.9.0.bb +++ b/meta-oe/recipes-core/uutils-coreutils/uutils-coreutils_0.9.0.bb @@ -18,6 +18,13 @@ require ${BPN}-crates.inc PROVIDES = "coreutils" RPROVIDES:${PN} = "coreutils" +# This recipe is a drop-in replacement for coreutils and cannot coexist with it, +# so only build it in world/universe when it is the selected provider. Otherwise +# both recipes end up in the same task graph as explicit targets (PREFERRED_PROVIDER +# only disambiguates dependencies, not targets) and bitbake warns that multiple +# .bb files provide coreutils. +EXCLUDE_FROM_WORLD = "${@'0' if d.getVar('PREFERRED_PROVIDER_coreutils') == 'uutils-coreutils' else '1'}" + PACKAGECONFIG ?= "${@bb.utils.filter('DISTRO_FEATURES', 'selinux systemd', d)}" PACKAGECONFIG[selinux] = "--features feat_selinux,,clang-native libselinux-native libselinux" PACKAGECONFIG[systemd] = "--features feat_systemd_logind,,systemd"