[v3,1/8] crossvars: Account for PACKAGE_ARCH = "${BUILD_ARCH}"

Message ID a8ceec3748d779b549c86389903a1efc22313f93.1705490373.git.jan.kiszka@siemens.com
State Accepted, archived
Headers show
Series Fix and update VisionFive 2 | expand

Commit Message

Jan Kiszka Jan. 17, 2024, 11:19 a.m. UTC
From: Jan Kiszka <jan.kiszka@siemens.com>

95427cc8 forgot about the case that PACKAGE_ARCH is to be derived from
BUILD_ARCH - while that is considering PACKAGE_ARCH before setting
BUILD_ARCH at all. Account for that case by adding the unresolved value
of PACKAGE_ARCH into the cross-build case because that is what the
statement is about: Set PACKAGE_ARCH to HOST_ARCH only if cross-building
is enabled for a package.

Fixes: 95427cc8a760 ("crossvars: Adjust logic to account for -native package builds in non-cross setups")
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 meta/classes/crossvars.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch

diff --git a/meta/classes/crossvars.bbclass b/meta/classes/crossvars.bbclass
index a7834b99..828afe46 100644
--- a/meta/classes/crossvars.bbclass
+++ b/meta/classes/crossvars.bbclass
@@ -22,7 +22,7 @@  python __anonymous() {
 
     if distro_arch != host_arch and \
         (package_arch == host_arch or \
-         (package_arch in [distro_arch, compat_arch] and mode == "1")):
+         (package_arch in [distro_arch, compat_arch, '${BUILD_ARCH}'] and mode == "1")):
         d.setVar('BUILD_ARCH', host_arch)
         schroot_dir = d.getVar('SCHROOT_HOST_DIR', False)
         sbuild_dep = "sbuild-chroot-host" + flavor_suffix + ":do_build"