From: Jan Kiszka <jan.kiszka@siemens.com>
To: isar-users <isar-users@googlegroups.com>
Cc: Uladzimir Bely <ubely@ilbers.de>,
"Moessbauer, Felix (T CED SES-DE)" <felix.moessbauer@siemens.com>
Subject: [PATCH v2] base: Fix HOST_ARCH for native builds
Date: Mon, 25 Sep 2023 13:41:27 +0200 [thread overview]
Message-ID: <a82dc778-0c7b-4895-a90f-a69c8458752c@siemens.com> (raw)
From: Jan Kiszka <jan.kiszka@siemens.com>
HOST_ARCH must be DISTRO_ARCH when we are not cross-building. Otherwise,
recipes that set PACKAGE_ARCH to it will fail in native builds.
Use late expansion for ISAR_CROSS_COMPILE to avoid recursion issues.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
That "expand=False" seems to work fine, so let's move forward with it.
meta/classes/base.bbclass | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
index 88004120..8ca089a2 100644
--- a/meta/classes/base.bbclass
+++ b/meta/classes/base.bbclass
@@ -49,13 +49,15 @@ def oe_import(d):
# We need the oe module name space early (before INHERITs get added)
OE_IMPORTED := "${@oe_import(d)}"
-def get_deb_host_arch():
+def get_deb_host_arch(d):
import subprocess
+ if d.getVar("ISAR_CROSS_COMPILE", expand=False) != "1":
+ return d.getVar("DISTRO_ARCH")
host_arch = subprocess.check_output(
["dpkg", "--print-architecture"]
).decode('utf-8').strip()
return host_arch
-HOST_ARCH ??= "${@get_deb_host_arch()}"
+HOST_ARCH ??= "${@get_deb_host_arch(d)}"
HOST_DISTRO ??= "${DISTRO}"
die() {
--
2.35.3
next reply other threads:[~2023-09-25 11:41 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-25 11:41 Jan Kiszka [this message]
2023-09-29 16:36 ` Uladzimir Bely
2023-09-29 17:25 ` Uladzimir Bely
2023-09-29 17:33 ` Uladzimir Bely
2023-10-01 8:17 ` Jan Kiszka
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a82dc778-0c7b-4895-a90f-a69c8458752c@siemens.com \
--to=jan.kiszka@siemens.com \
--cc=felix.moessbauer@siemens.com \
--cc=isar-users@googlegroups.com \
--cc=ubely@ilbers.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox