From: "'Felix Moessbauer' via isar-users" <isar-users@googlegroups.com>
To: isar-users@googlegroups.com
Cc: anaumann@emlix.com, adriaan.schmidt@siemens.com,
jan.kiszka@siemens.com, konrad.schwarz@siemens.com,
Felix Moessbauer <felix.moessbauer@siemens.com>
Subject: [PATCH v3 2/4] sbuild: do not build arch all packages on cross
Date: Wed, 6 May 2026 14:19:29 +0200 [thread overview]
Message-ID: <20260506121931.4167983-3-felix.moessbauer@siemens.com> (raw)
In-Reply-To: <20260506121931.4167983-1-felix.moessbauer@siemens.com>
Architecture all packages often cannot be built in cross mode, as the
dependencies cannot be resolved in the host architecture. This
especially applies to all packages which split their build dependencies
into Build-Depends-Arch and Build-Depends-Indep. We already have logic
in isar to built DPKG_ARCH=all packages non-cross, but this does not
work for packages that generate both arch specific and arch all binary
packages.
While sbuild automatically disables builds of arch-all packages on
cross, we previously explicitly overrode this setting. We now change
this by explicitly setting --no-arch-all flag on cross and --arch-all on
non-cross.
To bitbake depend on arch=all packages, we introduce an interface
similar to the -native: For mixed-architecture packages, the user needs
to extend the PROVIDES by adding -archall to the arch=all packages. This
internally is then dispatched to the -native target, not requiring any
changes on the consumer side (i.e. DEPENDS does not need to add the
-archall).
Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
---
RECIPE-API-CHANGELOG.md | 17 +++++++++++++++++
meta/classes-recipe/dpkg.bbclass | 3 ++-
meta/classes-recipe/multiarch.bbclass | 4 ++++
3 files changed, 23 insertions(+), 1 deletion(-)
diff --git a/RECIPE-API-CHANGELOG.md b/RECIPE-API-CHANGELOG.md
index 659a03b0..fe026580 100644
--- a/RECIPE-API-CHANGELOG.md
+++ b/RECIPE-API-CHANGELOG.md
@@ -1067,3 +1067,20 @@ Changes in next
The DEPLOY_DIR_IMAGE path and artifacts naming changes introduced in
13cb77dd (included in Isar v1.0) have been reverted. Deployment paths
and artifact names are the same as pre-v1.0.
+
+### No building of arch=all packages when cross building
+
+Architecture all packages often cannot be built in cross mode, as the
+dependencies cannot be resolved in the foreign architecture. This especially
+applies to all packages which split their build dependencies into
+`Build-Depends-Arch` and `Build-Depends-Indep`. We already have logic
+in isar to built `DPKG_ARCH = "all"` packages non-cross, but this does not
+work for packages that generate both arch specific and arch all binary packages.
+
+We now explicitly disable building `arch=all` binary packages during cross
+compilation (this only affects packages that produce both architecture-specific
+and `arch=all` binary packages). Recipes for such mixed packages should append
+`-all` to the `arch=all` binary packages listed in `PROVIDES` (e.g.,
+`PROVIDES="foo-doc-archall"` for an `arch=all` binary package `foo-doc`).
+Consumers can then simply reference the package by its original name (e.g.,
+`foo-doc`).
diff --git a/meta/classes-recipe/dpkg.bbclass b/meta/classes-recipe/dpkg.bbclass
index c1c38184..500aaefe 100644
--- a/meta/classes-recipe/dpkg.bbclass
+++ b/meta/classes-recipe/dpkg.bbclass
@@ -109,8 +109,9 @@ dpkg_runbuild() {
DSC_FILE=$(find ${WORKDIR} -maxdepth 1 -name "${DEBIAN_SOURCE}_*.dsc" -print)
- sbuild -A -n -c ${SBUILD_CHROOT} --chroot-mode=schroot \
+ sbuild -n -c ${SBUILD_CHROOT} --chroot-mode=schroot \
--host=${PACKAGE_ARCH} --build=${BUILD_ARCH} ${profiles} \
+ ${@'--no-arch-all' if 'cross' in isar_deb_build_profiles(d).split() else '--arch-all'} \
--no-run-lintian --no-run-piuparts --no-run-autopkgtest --resolve-alternatives \
--bd-uninstallable-explainer=apt \
--no-apt-update --apt-distupgrade \
diff --git a/meta/classes-recipe/multiarch.bbclass b/meta/classes-recipe/multiarch.bbclass
index cdd35f12..5f84fac2 100644
--- a/meta/classes-recipe/multiarch.bbclass
+++ b/meta/classes-recipe/multiarch.bbclass
@@ -83,6 +83,10 @@ python multiarch_virtclass_handler() {
for v in val.split():
if v.endswith('-compat') or v.endswith('-native'):
multiarch_var.append(v)
+ # dispatch -archall (arch=all) to native variant
+ if v.endswith('-archall'):
+ if suffix == '-native':
+ multiarch_var.append(v[:-len('-archall')])
else:
multiarch_var.append(v + suffix)
d.setVar(var, ' '.join(multiarch_var))
--
2.53.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/20260506121931.4167983-3-felix.moessbauer%40siemens.com.
next prev parent reply other threads:[~2026-05-06 12:20 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-06 12:19 [PATCH v3 0/4] Only build arch=all package from -native variant 'Felix Moessbauer' via isar-users
2026-05-06 12:19 ` [PATCH v3 1/4] mark cowsay package as architecture all 'Felix Moessbauer' via isar-users
2026-05-06 12:19 ` 'Felix Moessbauer' via isar-users [this message]
2026-05-06 12:19 ` [PATCH v3 3/4] Revert "Split up isar-apt into distro-arch specific instances" 'Felix Moessbauer' via isar-users
2026-05-06 12:19 ` [PATCH v3 4/4] add test for mixed arch all arch any packages 'Felix Moessbauer' via isar-users
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=20260506121931.4167983-3-felix.moessbauer@siemens.com \
--to=isar-users@googlegroups.com \
--cc=adriaan.schmidt@siemens.com \
--cc=anaumann@emlix.com \
--cc=felix.moessbauer@siemens.com \
--cc=jan.kiszka@siemens.com \
--cc=konrad.schwarz@siemens.com \
/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