public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH 1/1] native: fix unexpanded SSTATE_PKGARCH for -native variants
@ 2026-09-25  7:17 'Felix Moessbauer' via isar-users
  2026-10-06 10:25 ` Zhihang Wei
  0 siblings, 1 reply; 2+ messages in thread
From: 'Felix Moessbauer' via isar-users @ 2026-09-25  7:17 UTC (permalink / raw)
  To: isar-users; +Cc: adriaan.schmidt, Felix Moessbauer

sstate.bbclass (copied verbatim from Yocto) derives SSTATE_PKGARCH from
BUILD_ARCH in its anonymous python function. In Isar, BUILD_ARCH is not
defined at configuration level but only assigned later by the anonymous
function of crossvars.bbclass. As sstate is pulled in via INHERIT, its
anonymous function runs first, so BUILD_ARCH is still unset and
SSTATE_PKGARCH ends up undefined.

BitBake then leaves the literal ${SSTATE_PKGARCH} in SSTATE_PKGSPEC,
which propagates into the sstate artifact file names of all -native
variants:

  sstate:example-raw-native:amd64-isar:0.3:r0:${SSTATE_PKGARCH}:12:...

Overriding SSTATE_PKGARCH for class-native does not help: setVar() drops
all currently active overrides of the variable it sets, so the
assignment in sstate.bbclass wipes it again. Define BUILD_ARCH for
class-native instead, which is what crossvars.bbclass computes for that
variant anyway. -compat is not affected, as sstate.bbclass leaves
SSTATE_PKGARCH at its PACKAGE_ARCH default there.

Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
---
 meta/classes-recipe/native.bbclass | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/meta/classes-recipe/native.bbclass b/meta/classes-recipe/native.bbclass
index 7dad3bf9..4efa387a 100644
--- a/meta/classes-recipe/native.bbclass
+++ b/meta/classes-recipe/native.bbclass
@@ -8,3 +8,7 @@
 ################################################################################
 
 PACKAGE_ARCH:class-native = "${HOST_ARCH}"
+
+# Must match what crossvars.bbclass derives from PACKAGE_ARCH above, as
+# sstate.bbclass already reads BUILD_ARCH before crossvars.bbclass sets it.
+BUILD_ARCH:class-native = "${HOST_ARCH}"
-- 
2.55.0

-- 
You received this message because you are subscribed to the Google Groups "isar-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to isar-users+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/isar-users/20260925071744.1727072-1-felix.moessbauer%40siemens.com.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-10-06 10:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-25  7:17 [PATCH 1/1] native: fix unexpanded SSTATE_PKGARCH for -native variants 'Felix Moessbauer' via isar-users
2026-10-06 10:25 ` Zhihang Wei

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox