From: Jan Kiszka <jan.kiszka@siemens.com>
To: isar-users <isar-users@googlegroups.com>
Cc: Adriaan Schmidt <adriaan.schmidt@siemens.com>,
Felix Moessbauer <felix.moessbauer@siemens.com>,
Uladzimir Bely <ubely@ilbers.de>,
Cedric Hombourger <cedric.hombourger@siemens.com>
Subject: [PATCH v2 4/9] multiarch: Downgrade native dependencies when building in emulated environment
Date: Fri, 6 Oct 2023 17:34:57 +0200 [thread overview]
Message-ID: <7719e411f270ffa38eef3cf8eb363223b53e43d5.1696606502.git.jan.kiszka@siemens.com> (raw)
In-Reply-To: <cover.1696606502.git.jan.kiszka@siemens.com>
From: Jan Kiszka <jan.kiszka@siemens.com>
When a package that has -native build dependencies is forced into
non-cross building using qemu-user (ie. build arch != distro arch), its
dependency installation will generally fail. That is because
somedep-native will build somedep for the builder arch, not for the
distro arch that is needed during native builds.
Address that automatically by downgrading any such recipe dependency by
stripping for '-native'.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
meta/classes/multiarch.bbclass | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/meta/classes/multiarch.bbclass b/meta/classes/multiarch.bbclass
index c1846ab0..48cec9ab 100644
--- a/meta/classes/multiarch.bbclass
+++ b/meta/classes/multiarch.bbclass
@@ -21,6 +21,18 @@ python() {
d.appendVar('PROVIDES', f' {pn}-native')
else:
d.appendVar('BBCLASSEXTEND', ' native')
+
+ # drop own -native build dependencies at recipe level if building natively
+ # and not for the builder architecture
+ depends = d.getVar('DEPENDS')
+ if depends is not None and d.getVar('HOST_ARCH') != d.getVar('DISTRO_ARCH') \
+ and d.getVar('ISAR_CROSS_COMPILE') != '1':
+ new_deps = []
+ for dep in depends.split():
+ if dep.endswith('-native'):
+ dep = dep[:-7]
+ new_deps.append(dep)
+ d.setVar('DEPENDS', ' '.join(new_deps))
}
python multiarch_virtclass_handler() {
--
2.35.3
next prev parent reply other threads:[~2023-10-06 15:35 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-06 15:34 [PATCH v2 0/9] HOST_ARCH, -native, riscv64, and all the rest Jan Kiszka
2023-10-06 15:34 ` [PATCH v2 1/9] Rename BUILD_HOST_ARCH to BUILD_ARCH Jan Kiszka
2023-10-06 15:34 ` [PATCH v2 2/9] dpkg: Drop redundant PACKAGE_ARCH initialization Jan Kiszka
2023-10-06 15:34 ` [PATCH v2 3/9] crossvars: Adjust logic to account for -native package builds in non-cross setups Jan Kiszka
2023-10-06 15:34 ` Jan Kiszka [this message]
2023-10-06 15:34 ` [PATCH v2 5/9] meta-isar: jh7110-u-boot-spl-tool: Rely on native annotation Jan Kiszka
2023-10-06 15:34 ` [PATCH v2 6/9] meta-isar: jh7110-u-boot-spl-image: Fix native build Jan Kiszka
2023-10-06 15:35 ` [PATCH v2 7/9] meta-isar: u-boot-starfive-visionfive2: Simplify build dependencies Jan Kiszka
2023-10-06 15:35 ` [PATCH v2 8/9] linux-custom: Drop unused template variable Jan Kiszka
2023-10-06 15:35 ` [PATCH v2 9/9] Move riscv64 from sid-ports to regular sid Jan Kiszka
2023-10-11 10:49 ` [PATCH v2 0/9] HOST_ARCH, -native, riscv64, and all the rest Uladzimir Bely
2023-10-11 10:51 ` Jan Kiszka
2023-10-12 4:51 ` Jan Kiszka
2023-10-12 5:06 ` Uladzimir Bely
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=7719e411f270ffa38eef3cf8eb363223b53e43d5.1696606502.git.jan.kiszka@siemens.com \
--to=jan.kiszka@siemens.com \
--cc=adriaan.schmidt@siemens.com \
--cc=cedric.hombourger@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