[PATCH 4/5] meta/dummy-sdk-package: Improve SDK dummy package handling

Richard Purdie
2026-03-14T09:48:14Z

Currently, the dummy SDK packages are re-running for different SDKMACHINE values
when they should not. The usage of allarch is broken and not triggering the right
PACKAGE_ARCH value due to the deferred nature of nativesdk. This was probably
broken when we switched to add deferred classes.

To try and make this all more explict and less prone to breakage, switch to calling
oe.utils.make_arch_independent() directly.

Add the 'special' package architecture values to SSTATE_ARCHS so the system cna properly
track them.

Remove the pointless tasks we don't need from the dummy recipes, mark the packagedata
as machine independent and then remove from the conflict list in sstate.bbclass.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
meta/classes-global/sstate.bbclass | 6 ++---
meta/lib/oe/sstatesig.py | 6 ++++-
meta/recipes-core/meta/dummy-sdk-package.inc | 25 +++++++++++++------
.../meta/nativesdk-buildtools-perl-dummy.bb | 2 ++
.../meta/nativesdk-sdk-provides-dummy.bb | 3 +++
.../meta/target-sdk-provides-dummy.bb | 2 ++
6 files changed, 33 insertions(+), 11 deletions(-)

diff --git a/meta/classes-global/sstate.bbclass b/meta/classes-global/sstate.bbclass
index fec4d88c4cf..f124f33b2d3 100644
--- a/meta/classes-global/sstate.bbclass
+++ b/meta/classes-global/sstate.bbclass
@@ -57,9 +57,6 @@ SSTATE_EXTRAPATHWILDCARD[vardepvalue] = ""

# Avoid docbook/sgml catalog warnings for now
SSTATE_ALLOW_OVERLAP_FILES += "${STAGING_ETCDIR_NATIVE}/sgml ${STAGING_DATADIR_NATIVE}/sgml"
-# sdk-provides-dummy-nativesdk and nativesdk-buildtools-perl-dummy overlap for different SDKMACHINE
-SSTATE_ALLOW_OVERLAP_FILES += "${DEPLOY_DIR_RPM}/sdk_provides_dummy_nativesdk/ ${DEPLOY_DIR_IPK}/sdk-provides-dummy-nativesdk/"
-SSTATE_ALLOW_OVERLAP_FILES += "${DEPLOY_DIR_RPM}/buildtools_dummy_nativesdk/ ${DEPLOY_DIR_IPK}/buildtools-dummy-nativesdk/"
# target-sdk-provides-dummy overlaps that allarch is disabled when multilib is used
SSTATE_ALLOW_OVERLAP_FILES += "${COMPONENTS_DIR}/sdk-provides-dummy-target/ ${DEPLOY_DIR_RPM}/sdk_provides_dummy_target/ ${DEPLOY_DIR_IPK}/sdk-provides-dummy-target/"
# Archive the sources for many architectures in one deploy folder
@@ -90,6 +87,9 @@ SSTATE_ARCHS = " \
${BUILD_ARCH}_${SDK_ARCH}_${SDK_OS} \
${SDK_ARCH}_${SDK_OS} \
${SDK_ARCH}_${SDK_ARCH}-${SDKPKGSUFFIX} \
+ buildtools-dummy-${SDKPKGSUFFIX} \
+ sdk-provides-dummy-target \
+ sdk-provides-dummy-${SDKPKGSUFFIX} \
allarch \
${SSTATE_ARCHS_TUNEPKG} \
${PACKAGE_EXTRA_ARCHS} \
diff --git a/meta/lib/oe/sstatesig.py b/meta/lib/oe/sstatesig.py
index 1e07c71e944..4693b73375e 100644
--- a/meta/lib/oe/sstatesig.py
+++ b/meta/lib/oe/sstatesig.py
@@ -513,7 +513,10 @@ def find_sstate_manifest(taskdata, taskdata2, taskname, d, multilibcache):
if taskdata.endswith("-native"):
pkgarchs = ["${BUILD_ARCH}", "${BUILD_ARCH}_${ORIGNATIVELSBSTRING}"]
elif taskdata.startswith("nativesdk-"):
- pkgarchs = ["${SDK_ARCH}_${SDK_OS}", "allarch"]
+ pkgarchs = ["${SDK_ARCH}_${SDK_OS}",
+ "allarch",
+ "buildtools-dummy-${SDKPKGSUFFIX}",
+ "sdk-provides-dummy-${SDKPKGSUFFIX}"]
elif "-cross-canadian" in taskdata:
pkgarchs = ["${SDK_ARCH}_${SDK_ARCH}-${SDKPKGSUFFIX}"]
elif "-cross-" in taskdata:
@@ -524,6 +527,7 @@ def find_sstate_manifest(taskdata, taskdata2, taskname, d, multilibcache):
pkgarchs = ['${MACHINE_ARCH}']
pkgarchs = pkgarchs + list(reversed(d2.getVar("PACKAGE_EXTRA_ARCHS").split()))
pkgarchs.append('allarch')
+ pkgarchs.append('sdk-provides-dummy-target')
pkgarchs.append('${SDK_ARCH}_${SDK_ARCH}-${SDKPKGSUFFIX}')

searched_manifests = []
diff --git a/meta/recipes-core/meta/dummy-sdk-package.inc b/meta/recipes-core/meta/dummy-sdk-package.inc
index bf453cac9be..60dfe9f73bb 100644
--- a/meta/recipes-core/meta/dummy-sdk-package.inc
+++ b/meta/recipes-core/meta/dummy-sdk-package.inc
@@ -1,18 +1,21 @@
SUMMARY = "Dummy packages which handle excluding packages from the sdk, e.g. ensuring perl is excluded from buildtools"
LICENSE = "MIT"

-PACKAGE_ARCH = "all"
-
-inherit allarch
-
INHIBIT_DEFAULT_DEPS = "1"

python() {
+ pkgdata_var = d.getVar("DUMMYSDK_PKGDATA_VARNAME")
+ # Expand PKGDATA_DIR_SDK/SDK_SYS and stamp-extra-info before we lose the values
+ d.setVar(pkgdata_var, d.getVar(pkgdata_var))
+ stampinfo = d.getVar("DUMMYSDK_EXTRASTAMP_VARNAME")
+ d.setVarFlag("do_packagedata", "stamp-extra-info", d.getVar(stampinfo))
+
+ oe.utils.make_arch_independent(d)
+
# Put the package somewhere separate to ensure it's never used except
# when we want it
- # (note that we have to do this in anonymous python here to avoid
- # allarch.bbclass disabling itself)
- d.setVar('PACKAGE_ARCH', '${DUMMYARCH}')
+ # Need to set PACKAGE_ARCH after deferred nativesdk inherit
+ d.setVar("PACKAGE_ARCH", "${DUMMYARCH}")
}

ALLOW_EMPTY:${PN} = "1"
@@ -31,3 +34,11 @@ python populate_packages:prepend() {
d.appendVar("RREPLACES:%s" % p, "${DUMMYPROVIDES_PACKAGES_MULTILIB}")
}

+deltask fetch
+deltask unpack
+deltask patch
+deltask prepare_recipe_sysroot
+deltask configure
+deltask compile
+deltask install
+deltask populate_sysroot
diff --git a/meta/recipes-core/meta/nativesdk-buildtools-perl-dummy.bb b/meta/recipes-core/meta/nativesdk-buildtools-perl-dummy.bb
index 0ba1ca6e426..f97a28cab56 100644
--- a/meta/recipes-core/meta/nativesdk-buildtools-perl-dummy.bb
+++ b/meta/recipes-core/meta/nativesdk-buildtools-perl-dummy.bb
@@ -1,4 +1,6 @@
DUMMYARCH = "buildtools-dummy-${SDKPKGSUFFIX}"
+DUMMYSDK_PKGDATA_VARNAME = "PKGDATA_DIR_SDK"
+DUMMYSDK_EXTRASTAMP_VARNAME = "SDK_SYS"

DUMMYPROVIDES_PACKAGES = "\
nativesdk-perl \
diff --git a/meta/recipes-core/meta/nativesdk-sdk-provides-dummy.bb b/meta/recipes-core/meta/nativesdk-sdk-provides-dummy.bb
index 1d71f373a4e..37dad54409f 100644
--- a/meta/recipes-core/meta/nativesdk-sdk-provides-dummy.bb
+++ b/meta/recipes-core/meta/nativesdk-sdk-provides-dummy.bb
@@ -1,5 +1,8 @@
DUMMYARCH = "sdk-provides-dummy-${SDKPKGSUFFIX}"

+DUMMYSDK_PKGDATA_VARNAME = "PKGDATA_DIR_SDK"
+DUMMYSDK_EXTRASTAMP_VARNAME = "SDK_SYS"
+
DUMMYPROVIDES_PACKAGES = "\
pkgconfig \
"
diff --git a/meta/recipes-core/meta/target-sdk-provides-dummy.bb b/meta/recipes-core/meta/target-sdk-provides-dummy.bb
index 849407cca57..65b87fd97dd 100644
--- a/meta/recipes-core/meta/target-sdk-provides-dummy.bb
+++ b/meta/recipes-core/meta/target-sdk-provides-dummy.bb
@@ -1,4 +1,6 @@
DUMMYARCH = "sdk-provides-dummy-target"
+DUMMYSDK_PKGDATA_VARNAME = "PKGDATA_DIR"
+DUMMYSDK_EXTRASTAMP_VARNAME = "MACHINE"

DUMMYPROVIDES_PACKAGES = "\
busybox \