[PATCH 0/3] Fixes for complex multiarch dependency propagation

5 views
Skip to first unread message

Felix Moessbauer

unread,
Jul 30, 2026, 7:11:20 AM (6 days ago) Jul 30
to isar-...@googlegroups.com, jan.k...@siemens.com, akarp...@ilbers.de, Felix Moessbauer
The corresponding errors have been spotted on the xenomai-images layer [1].
For details, see the individual commits.

This series has been tested on fast CI.

[1] https://source.denx.de/Xenomai/xenomai-images

Best regards,
Felix Moessbauer
Siemens AG

Felix Moessbauer (3):
fix(rootfs): copy isar-apt packages instead of downloading
fix: redirect archall dependency to native provider on non cross
builds
testsuite: check propagation of archall to deps on native

.../recipes-app/test-all-depnative/files/rules | 11 +++++++++++
.../test-all-depnative/test-all-depnative.bb | 13 +++++++++++++
meta/classes-recipe/multiarch.bbclass | 6 +++++-
meta/classes-recipe/rootfs.bbclass | 16 ++++------------
testsuite/citest.py | 13 +++++++++++++
5 files changed, 46 insertions(+), 13 deletions(-)
create mode 100644 meta-test/recipes-app/test-all-depnative/files/rules
create mode 100644 meta-test/recipes-app/test-all-depnative/test-all-depnative.bb

--
2.53.0

Felix Moessbauer

unread,
Jul 30, 2026, 7:11:21 AM (6 days ago) Jul 30
to isar-...@googlegroups.com, jan.k...@siemens.com, akarp...@ilbers.de, Felix Moessbauer
Previously, the arch part was stripped, hence on multiarch or compat
scenarios the wrong package might have been downloaded. We fix this by
considering the whole filename. For that, we switch to cp, as we
otherwise would have to reconstruct the package name from the filename.
As the whole path is urlencoded, we cannot directly pass the url to cp.
Instead, we reconstruct it based on the base-path (which is taken as-is,
as it does not have any special characters) and the second field emitted
on --print-uris, which provides the decoded filename.

As we now use cp, we also don't need any locking anymore (technically we
did not need it before either, but apt was called in a way that required
it).

Fixes: b90b722f ("rootfs: Deny packages download during install")
Signed-off-by: Felix Moessbauer <felix.mo...@siemens.com>
---
meta/classes-recipe/rootfs.bbclass | 16 ++++------------
1 file changed, 4 insertions(+), 12 deletions(-)

diff --git a/meta/classes-recipe/rootfs.bbclass b/meta/classes-recipe/rootfs.bbclass
index 77e6aefc..2ce8cee3 100644
--- a/meta/classes-recipe/rootfs.bbclass
+++ b/meta/classes-recipe/rootfs.bbclass
@@ -361,23 +361,15 @@ ROOTFS_INSTALL_COMMAND += "rootfs_install_pkgs_isar_download"
rootfs_install_pkgs_isar_download[weight] = "50"
rootfs_install_pkgs_isar_download[isar-apt-lock] = "acquire-before release-after"
rootfs_install_pkgs_isar_download() {
- mkdir -p "${WORKDIR}/dpkg"
-
- # Use our own dpkg lock files rather than those in the rootfs since we are not root
- # (this is safe as there are no concurrent apt/dpkg operations for that rootfs)
- touch "${WORKDIR}/dpkg/lock" "${WORKDIR}/dpkg/lock-frontend"
-
# Command apt-get install do not cache packages from local repos
# We can obtain non cached package URIs by recalling install command here
- # No need in export those files to dl_dir, so we can run it right after
+ # No need to export those files to dl_dir, so we can run it right after
rootfs_cmd --bind "${ROOTFSDIR}/var/cache/apt/archives" /var/cache/apt/archives \
- --bind "${WORKDIR}/dpkg/lock" /var/lib/dpkg/lock \
- --bind "${WORKDIR}/dpkg/lock-frontend" /var/lib/dpkg/lock-frontend \
--chdir "/var/cache/apt/archives" \
${ROOTFSDIR} \
- -- /usr/bin/sh -c "apt-get ${ROOTFS_APT_ARGS} --print-uris ${ROOTFS_PACKAGES} | \
- sed -n \"s|^.*/\\(.*\\)_[^_]*_[^_]*\\.deb'.*|\\1|p\" | \
- xargs -r apt-get download"
+ -- /usr/bin/sh -c 'apt-get ${ROOTFS_APT_ARGS} --print-uris ${ROOTFS_PACKAGES} | \
+ sed -n "s|^.file:\(/[^'\'']*/\)[^'\'']*\.deb. \([^ ]*\.deb\) .*|\1\2|p" | \
+ while read -r path; do cp -n "$path" ./ ; done'
}

ROOTFS_INSTALL_COMMAND += "${@ 'rootfs_install_clean_files' if (d.getVar('ROOTFS_CLEAN_FILES') or '').strip() else ''}"
--
2.53.0

Felix Moessbauer

unread,
Jul 30, 2026, 7:11:23 AM (6 days ago) Jul 30
to isar-...@googlegroups.com, jan.k...@siemens.com, akarp...@ilbers.de, Felix Moessbauer
The extend_provides needs to mirror the -archall pattern from fixup_depends:
when a provide ends in -archall, the arch-independent (native-equivalent)
provider must be exposed under its bare name, not <name>-archall-native.

We change it so that for the native case it strips -archall and emits
the bare name

Fixes: 327fb313 ("sbuild: do not build arch all packages on cross")
---
meta/classes-recipe/multiarch.bbclass | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/meta/classes-recipe/multiarch.bbclass b/meta/classes-recipe/multiarch.bbclass
index 5f84fac2..a30d530c 100644
--- a/meta/classes-recipe/multiarch.bbclass
+++ b/meta/classes-recipe/multiarch.bbclass
@@ -16,7 +16,11 @@ python() {
if not pn_multiarch_target(pn):
all_provides = (d.getVar('PROVIDES') or '').split()
for p in all_provides:
- if not pn_multiarch_target(p):
+ if p.endswith('-archall'):
+ # arch=all provider: expose bare name for the native-equivalent
+ if provides == 'native':
+ d.appendVar('PROVIDES', ' ' + p[:-len('-archall')])
+ elif not pn_multiarch_target(p):
d.appendVar('PROVIDES', f' {p}-{provides}')
d.appendVar('PROVIDES', f' {pn}-{provides}')

--
2.53.0

Felix Moessbauer

unread,
Jul 30, 2026, 7:11:23 AM (6 days ago) Jul 30
to isar-...@googlegroups.com, jan.k...@siemens.com, akarp...@ilbers.de, Felix Moessbauer
Signed-off-by: Felix Moessbauer <felix.mo...@siemens.com>
---
.../recipes-app/test-all-depnative/files/rules | 11 +++++++++++
.../test-all-depnative/test-all-depnative.bb | 13 +++++++++++++
testsuite/citest.py | 13 +++++++++++++
3 files changed, 37 insertions(+)
create mode 100644 meta-test/recipes-app/test-all-depnative/files/rules
create mode 100644 meta-test/recipes-app/test-all-depnative/test-all-depnative.bb

diff --git a/meta-test/recipes-app/test-all-depnative/files/rules b/meta-test/recipes-app/test-all-depnative/files/rules
new file mode 100644
index 00000000..6640cf23
--- /dev/null
+++ b/meta-test/recipes-app/test-all-depnative/files/rules
@@ -0,0 +1,11 @@
+#!/usr/bin/make -f
+%:
+ dh \$@
+
+# Detect cross-compilation and fail if so
+override_dh_auto_configure:
+ @if [ "$(DEB_BUILD_ARCH)" != "$(DEB_HOST_ARCH)" ]; then \
+ echo "Cross-compilation detected! This is an \"all\" package."; \
+ exit 1; \
+ fi
+ dh_auto_configure
diff --git a/meta-test/recipes-app/test-all-depnative/test-all-depnative.bb b/meta-test/recipes-app/test-all-depnative/test-all-depnative.bb
new file mode 100644
index 00000000..328d79f9
--- /dev/null
+++ b/meta-test/recipes-app/test-all-depnative/test-all-depnative.bb
@@ -0,0 +1,13 @@
+# Test all package depending on an arch=all package provided via -archall.
+
+SRC_URI = "file://rules"
+
+inherit dpkg-raw
+
+MAINTAINER = "isar-users <isar-...@googlegroups.com>"
+
+DEPENDS = "test-all-any-doc"
+
+do_install() {
+ bbnote "Test \"all\" package depending on an arch=all (-archall) package."
+}
diff --git a/testsuite/citest.py b/testsuite/citest.py
index a4f15d04..a600ade9 100644
--- a/testsuite/citest.py
+++ b/testsuite/citest.py
@@ -472,6 +472,19 @@ class CrossTest(CIBaseTest):
self.perform_build_test(targets, lines=lines,
image_install=image_install)

+ def test_native_dependencies(self):
+ targets = [
+ 'mc:qemuamd64-trixie:isar-image-ci',
+ ]
+
+ self.init()
+ image_install = 'test-all-depnative'
+ self.perform_build_test(
+ targets,
+ image_install=image_install,
+ bitbake_extra_args=["-c", "rootfs_install"]
+ )
+
def test_cross_riscv64(self):
"""
:avocado: tags=riscv64
--
2.53.0

Felix Moessbauer

unread,
Jul 30, 2026, 7:19:45 AM (6 days ago) Jul 30
to isar-...@googlegroups.com, jan.k...@siemens.com, akarp...@ilbers.de, Felix Moessbauer
The corresponding errors have been spotted on the xenomai-images layer [1].
For details, see the individual commits.

This series has been tested on fast CI.

[1] https://source.denx.de/Xenomai/xenomai-images

Changes since v1:

- add missing signed-off to p2
- no functional changes

Best regards,
Felix Moessbauer
Siemens AG

Felix Moessbauer (3):
fix(rootfs): copy isar-apt packages instead of downloading
fix: redirect archall dependency to native provider on non cross
builds
testsuite: check propagation of archall to deps on native

.../recipes-app/test-all-depnative/files/rules | 11 +++++++++++
.../test-all-depnative/test-all-depnative.bb | 13 +++++++++++++
meta/classes-recipe/multiarch.bbclass | 6 +++++-
meta/classes-recipe/rootfs.bbclass | 16 ++++------------
testsuite/citest.py | 13 +++++++++++++
5 files changed, 46 insertions(+), 13 deletions(-)
create mode 100644 meta-test/recipes-app/test-all-depnative/files/rules
create mode 100644 meta-test/recipes-app/test-all-depnative/test-all-depnative.bb

--
2.53.0

Felix Moessbauer

unread,
Jul 30, 2026, 7:19:46 AM (6 days ago) Jul 30
to isar-...@googlegroups.com, jan.k...@siemens.com, akarp...@ilbers.de, Felix Moessbauer
Previously, the arch part was stripped, hence on multiarch or compat
scenarios the wrong package might have been downloaded. We fix this by
considering the whole filename. For that, we switch to cp, as we
otherwise would have to reconstruct the package name from the filename.
As the whole path is urlencoded, we cannot directly pass the url to cp.
Instead, we reconstruct it based on the base-path (which is taken as-is,
as it does not have any special characters) and the second field emitted
on --print-uris, which provides the decoded filename.

As we now use cp, we also don't need any locking anymore (technically we
did not need it before either, but apt was called in a way that required
it).

Fixes: b90b722f ("rootfs: Deny packages download during install")
Signed-off-by: Felix Moessbauer <felix.mo...@siemens.com>
---

Felix Moessbauer

unread,
Jul 30, 2026, 7:19:46 AM (6 days ago) Jul 30
to isar-...@googlegroups.com, jan.k...@siemens.com, akarp...@ilbers.de, Felix Moessbauer
The extend_provides needs to mirror the -archall pattern from fixup_depends:
when a provide ends in -archall, the arch-independent (native-equivalent)
provider must be exposed under its bare name, not <name>-archall-native.

We change it so that for the native case it strips -archall and emits
the bare name

Fixes: 327fb313 ("sbuild: do not build arch all packages on cross")
Signed-off-by: Felix Moessbauer <felix.mo...@siemens.com>
---

Felix Moessbauer

unread,
Jul 30, 2026, 7:19:48 AM (6 days ago) Jul 30
to isar-...@googlegroups.com, jan.k...@siemens.com, akarp...@ilbers.de, Felix Moessbauer
Signed-off-by: Felix Moessbauer <felix.mo...@siemens.com>
---
.../recipes-app/test-all-depnative/files/rules | 11 +++++++++++
.../test-all-depnative/test-all-depnative.bb | 13 +++++++++++++
testsuite/citest.py | 13 +++++++++++++
3 files changed, 37 insertions(+)
create mode 100644 meta-test/recipes-app/test-all-depnative/files/rules
create mode 100644 meta-test/recipes-app/test-all-depnative/test-all-depnative.bb

Florian Bezdeka

unread,
Jul 30, 2026, 7:31:04 AM (6 days ago) Jul 30
to Felix Moessbauer, isar-...@googlegroups.com, jan.k...@siemens.com, akarp...@ilbers.de
On Thu, 2026-07-30 at 13:19 +0200, 'Felix Moessbauer' via isar-users
wrote:
> The corresponding errors have been spotted on the xenomai-images layer [1].
> For details, see the individual commits.
>
> This series has been tested on fast CI.
>
> [1] https://source.denx.de/Xenomai/xenomai-images

Seems this is working again, but the official URL meanwhile changed to
https://gitlab.com/Xenomai/xenomai-images

>
> Changes since v1:
>
> - add missing signed-off to p2
> - no functional changes
>
> Best regards,
> Felix Moessbauer
> Siemens AG
>
> Felix Moessbauer (3):
> fix(rootfs): copy isar-apt packages instead of downloading
> fix: redirect archall dependency to native provider on non cross
> builds
> testsuite: check propagation of archall to deps on native
>
> .../recipes-app/test-all-depnative/files/rules | 11 +++++++++++
> .../test-all-depnative/test-all-depnative.bb | 13 +++++++++++++
> meta/classes-recipe/multiarch.bbclass | 6 +++++-
> meta/classes-recipe/rootfs.bbclass | 16 ++++------------
> testsuite/citest.py | 13 +++++++++++++
> 5 files changed, 46 insertions(+), 13 deletions(-)
> create mode 100644 meta-test/recipes-app/test-all-depnative/files/rules
> create mode 100644 meta-test/recipes-app/test-all-depnative/test-all-depnative.bb
>
> --
> 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+...@googlegroups.com.
> To view this discussion visit https://groups.google.com/d/msgid/isar-users/20260730111933.1237145-1-felix.moessbauer%40siemens.com.

Zhihang Wei

unread,
4:39 AM (11 hours ago) 4:39 AM
to Felix Moessbauer, isar-...@googlegroups.com, jan.k...@siemens.com, akarp...@ilbers.de
Applied to next, thanks.

Zhihang
Reply all
Reply to author
Forward
0 new messages