[PATCH 5/5] sstate: Tweak SDK sstate package architecture

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

While in this area of the code, it is worth noting that PACKAGE_ARCH + PN are
already designed to capture the needed information that we need in SSTATE_PKGARCH.

We can therefore simplify things by just using the standard fallack for SSTATE_PKGARCH
instead of more complex manipulations.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
meta/classes-global/sstate.bbclass | 7 +------
meta/lib/oe/sstatesig.py | 8 +++-----
2 files changed, 4 insertions(+), 11 deletions(-)

diff --git a/meta/classes-global/sstate.bbclass b/meta/classes-global/sstate.bbclass
index f124f33b2d3..a7c3f5332a2 100644
--- a/meta/classes-global/sstate.bbclass
+++ b/meta/classes-global/sstate.bbclass
@@ -85,8 +85,7 @@ SSTATE_ARCHS = " \
${BUILD_ARCH} \
${BUILD_ARCH}_${ORIGNATIVELSBSTRING} \
${BUILD_ARCH}_${SDK_ARCH}_${SDK_OS} \
- ${SDK_ARCH}_${SDK_OS} \
- ${SDK_ARCH}_${SDK_ARCH}-${SDKPKGSUFFIX} \
+ ${SDK_ARCH}-${SDKPKGSUFFIX} \
buildtools-dummy-${SDKPKGSUFFIX} \
sdk-provides-dummy-target \
sdk-provides-dummy-${SDKPKGSUFFIX} \
@@ -140,10 +139,6 @@ python () {
d.setVar('SSTATE_PKGARCH', d.expand("${BUILD_ARCH}_${SDK_ARCH}_${SDK_OS}"))
elif bb.data.inherits_class('cross', d):
d.setVar('SSTATE_PKGARCH', d.expand("${BUILD_ARCH}"))
- elif bb.data.inherits_class('nativesdk', d):
- d.setVar('SSTATE_PKGARCH', d.expand("${SDK_ARCH}_${SDK_OS}"))
- elif bb.data.inherits_class('cross-canadian', d):
- d.setVar('SSTATE_PKGARCH', d.expand("${SDK_ARCH}_${PACKAGE_ARCH}"))
elif bb.data.inherits_class('allarch', d) and d.getVar("PACKAGE_ARCH") == "all":
d.setVar('SSTATE_PKGARCH', "allarch")
# Fall back to the default of SSTATE_PKGARCH=PACKAGE_ARCH
diff --git a/meta/lib/oe/sstatesig.py b/meta/lib/oe/sstatesig.py
index 4693b73375e..86d159ed209 100644
--- a/meta/lib/oe/sstatesig.py
+++ b/meta/lib/oe/sstatesig.py
@@ -512,13 +512,11 @@ 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}",
+ elif taskdata.startswith("nativesdk-") or "-cross-canadian" in taskdata:
+ pkgarchs = ["${SDK_ARCH}-${SDKPKGSUFFIX}",
"allarch",
"buildtools-dummy-${SDKPKGSUFFIX}",
"sdk-provides-dummy-${SDKPKGSUFFIX}"]
- elif "-cross-canadian" in taskdata:
- pkgarchs = ["${SDK_ARCH}_${SDK_ARCH}-${SDKPKGSUFFIX}"]
elif "-cross-" in taskdata:
pkgarchs = ["${BUILD_ARCH}"]
elif "-crosssdk" in taskdata:
@@ -528,7 +526,7 @@ def find_sstate_manifest(taskdata, taskdata2, taskname, d, multilibcache):
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}')
+ pkgarchs.append('${SDK_ARCH}-${SDKPKGSUFFIX}')

searched_manifests = []