* [PATCH 1/3] crossvars: provide the base distro of the selected sbuild chroot
2026-10-21 10:25 [PATCH 0/3] Fixes for BASE_DISTRO 'Felix Moessbauer' via isar-users
@ 2026-10-21 10:25 ` 'Felix Moessbauer' via isar-users
2026-10-21 10:25 ` [PATCH 2/3] apt-fetcher: cache sources under the chroot's base distro 'Felix Moessbauer' via isar-users
` (2 subsequent siblings)
3 siblings, 0 replies; 6+ messages in thread
From: 'Felix Moessbauer' via isar-users @ 2026-10-21 10:25 UTC (permalink / raw)
To: isar-users; +Cc: wzh, Felix Moessbauer
Several places need to know which base distro the chroot of a recipe was
bootstrapped from, mostly to name the DEBDIR/DEBSRCDIR sub-directory that
base-apt later imports. They all answer that question differently:
dpkg.bbclass keys off ISAR_CROSS_COMPILE
aptsrc_fetcher.py uses BASE_DISTRO
sbuild-chroot-*.bb set ROOTFS_BASE_DISTRO explicitly
Only the last one is correct in general. BASE_DISTRO is resolved against
OVERRIDES, which start with PACKAGE_ARCH, so it does not describe the
chroot at all: for native recipes PACKAGE_ARCH is HOST_ARCH, which means
"BASE_DISTRO:arm64 = raspios64" is not applied and BASE_DISTRO silently
expands to something else than it does for a target recipe of the same
multiconfig. The ISAR_CROSS_COMPILE heuristic disagrees with the actual
chroot selection whenever DISTRO_ARCH equals HOST_ARCH.
crossvars.bbclass already performs the host/target chroot dispatch, so
let it export the matching base distro as SCHROOT_BASE_DISTRO next to
SCHROOT_DIR and SCHROOT_DEP, and consume it in dpkg.bbclass. This keeps
one single source of truth and mirrors the ROOTFS_BASE_DISTRO naming of
the sbuild-chroot recipes.
Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
---
meta/classes-recipe/crossvars.bbclass | 8 ++++++++
meta/classes-recipe/dpkg.bbclass | 5 +----
2 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/meta/classes-recipe/crossvars.bbclass b/meta/classes-recipe/crossvars.bbclass
index 7cf2d660..fbfcda93 100644
--- a/meta/classes-recipe/crossvars.bbclass
+++ b/meta/classes-recipe/crossvars.bbclass
@@ -30,13 +30,21 @@ python __anonymous() {
schroot_dir = d.getVar('SCHROOT_HOST_DIR', False)
sbuild_dep = "sbuild-chroot-host" + flavor_suffix + ":do_build"
sdk_toolchain = "crossbuild-essential-" + distro_arch
+ schroot_base_distro = d.getVar('HOST_BASE_DISTRO', False)
else:
d.setVar('BUILD_ARCH', distro_arch)
schroot_dir = d.getVar('SCHROOT_TARGET_DIR', False)
sbuild_dep = "sbuild-chroot-target" + flavor_suffix + ":do_build"
sdk_toolchain = "build-essential"
+ schroot_base_distro = d.getVar('BASE_DISTRO', False)
d.setVar('SCHROOT_DIR', schroot_dir + flavor_suffix)
d.setVar('SCHROOT_DEP', sbuild_dep)
+ # BASE_DISTRO is resolved against OVERRIDES, which start with PACKAGE_ARCH,
+ # so it does not describe the chroot a recipe is built in (PACKAGE_ARCH is
+ # HOST_ARCH for native recipes). Mirror ROOTFS_BASE_DISTRO of the
+ # sbuild-chroot recipes to give the DEBDIR/DEBSRCDIR layout a single,
+ # chroot-correct name.
+ d.setVar('SCHROOT_BASE_DISTRO', schroot_base_distro)
if isar_can_build_compat(d):
sdk_toolchain += " crossbuild-essential-" + compat_arch
d.setVar('SDK_TOOLCHAIN', sdk_toolchain)
diff --git a/meta/classes-recipe/dpkg.bbclass b/meta/classes-recipe/dpkg.bbclass
index 35408495..0ae00b75 100644
--- a/meta/classes-recipe/dpkg.bbclass
+++ b/meta/classes-recipe/dpkg.bbclass
@@ -82,10 +82,7 @@ dpkg_runbuild() {
bbwarn "Export of '${line}' detected, please migrate to templates"
done
- distro="${BASE_DISTRO}-${BASE_DISTRO_CODENAME}"
- if [ ${ISAR_CROSS_COMPILE} -eq 1 ]; then
- distro="${HOST_BASE_DISTRO}-${BASE_DISTRO_CODENAME}"
- fi
+ distro="${SCHROOT_BASE_DISTRO}-${BASE_DISTRO_CODENAME}"
deb_dl_dir_import "${WORKDIR}/rootfs" "${distro}"
--
2.55.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/20261021102544.3614772-2-felix.moessbauer%40siemens.com.
^ permalink raw reply [flat|nested] 6+ messages in thread* [PATCH 2/3] apt-fetcher: cache sources under the chroot's base distro
2026-10-21 10:25 [PATCH 0/3] Fixes for BASE_DISTRO 'Felix Moessbauer' via isar-users
2026-10-21 10:25 ` [PATCH 1/3] crossvars: provide the base distro of the selected sbuild chroot 'Felix Moessbauer' via isar-users
@ 2026-10-21 10:25 ` 'Felix Moessbauer' via isar-users
2026-10-21 10:25 ` [PATCH 3/3] bootstrap: point cached deb-src at the bootstrapped " 'Felix Moessbauer' via isar-users
2026-11-06 9:59 ` [PATCH 0/3] Fixes for BASE_DISTRO 'Moessbauer, Felix' via isar-users
3 siblings, 0 replies; 6+ messages in thread
From: 'Felix Moessbauer' via isar-users @ 2026-10-21 10:25 UTC (permalink / raw)
To: isar-users; +Cc: wzh, Felix Moessbauer
The apt source fetcher derives the DEBSRCDIR sub-directory from
BASE_DISTRO, which is resolved against OVERRIDES and therefore describes
the recipe's PACKAGE_ARCH rather than the chroot the sources are fetched
in. On raspios, where BASE_DISTRO:arm64 is "raspios64", a native recipe
in mc:rpi-arm64-v8-bookworm caches its .dsc below raspios-bookworm while
base-apt only imports raspios64-bookworm and debian-bookworm for that
multiconfig. The sources are then missing from the cached base
repository and the offline rebuild of the repro test fails in do_unpack.
Use SCHROOT_BASE_DISTRO, which names the base distro of SBUILD_CHROOT.
For native and cross-built recipes this is HOST_BASE_DISTRO, matching
populate_base_apt() in base-apt.bb and deb_dl_dir_import() in
dpkg.bbclass.
Fixes: 37cb017a ("Convert apt source fetcher into native bitbake ...")
Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
---
meta/lib/aptsrc_fetcher.py | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/meta/lib/aptsrc_fetcher.py b/meta/lib/aptsrc_fetcher.py
index fe8f1cd3..fc3cf363 100644
--- a/meta/lib/aptsrc_fetcher.py
+++ b/meta/lib/aptsrc_fetcher.py
@@ -23,7 +23,9 @@ class AptSrc(FetchMethod):
ud.src_package = ud.url[len('apt://'):]
ud.host = ud.host.replace('=', '_')
- base_distro = d.getVar('BASE_DISTRO')
+ # The sources are fetched from inside SBUILD_CHROOT, so they have to be
+ # cached below the base distro of that chroot, not below BASE_DISTRO.
+ base_distro = d.getVar('SCHROOT_BASE_DISTRO')
codename = d.getVar('BASE_DISTRO_CODENAME')
ud.localfile='deb-src/' + base_distro + '-' + codename + '/' + ud.host
--
2.55.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/20261021102544.3614772-3-felix.moessbauer%40siemens.com.
^ permalink raw reply [flat|nested] 6+ messages in thread* [PATCH 3/3] bootstrap: point cached deb-src at the bootstrapped base distro
2026-10-21 10:25 [PATCH 0/3] Fixes for BASE_DISTRO 'Felix Moessbauer' via isar-users
2026-10-21 10:25 ` [PATCH 1/3] crossvars: provide the base distro of the selected sbuild chroot 'Felix Moessbauer' via isar-users
2026-10-21 10:25 ` [PATCH 2/3] apt-fetcher: cache sources under the chroot's base distro 'Felix Moessbauer' via isar-users
@ 2026-10-21 10:25 ` 'Felix Moessbauer' via isar-users
2026-11-06 9:59 ` [PATCH 0/3] Fixes for BASE_DISTRO 'Moessbauer, Felix' via isar-users
3 siblings, 0 replies; 6+ messages in thread
From: 'Felix Moessbauer' via isar-users @ 2026-10-21 10:25 UTC (permalink / raw)
To: isar-users; +Cc: wzh, Felix Moessbauer
The sources.list we generate for ISAR_USE_CACHED_BASE_REPO builds mixes
two different base distros: the deb entry refers to
BOOTSTRAP_BASE_DISTRO, while the deb-src entry refers to BASE_DISTRO.
For every distro where HOST_BASE_DISTRO equals BASE_DISTRO (debian,
ubuntu) both expand to the same value and the bug is invisible. For
raspios they differ: isar-mmdebstrap-host is bootstrapped from the
'debian' base repository, but its only deb-src entry points at the
'raspios64' one. Native recipes are built in the resulting
sbuild-chroot-host, so their do_unpack runs apt-get source against a
repository that holds neither the host sources nor an index apt can
use, and fails with
E: You must put some 'deb-src' URIs in your sources.list
Use BOOTSTRAP_BASE_DISTRO for both entries, so that a bootstrap always
sees the binary and the source side of the very repository it is
bootstrapped from.
Fixes: b311a67f ("meta: Add mmdebstrap recipe")
Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
(cherry picked from commit 52b478de80058928872630ac61182db02301e042)
---
meta/recipes-core/isar-mmdebstrap/isar-mmdebstrap.inc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/meta/recipes-core/isar-mmdebstrap/isar-mmdebstrap.inc b/meta/recipes-core/isar-mmdebstrap/isar-mmdebstrap.inc
index 6135da4f..ef718a26 100644
--- a/meta/recipes-core/isar-mmdebstrap/isar-mmdebstrap.inc
+++ b/meta/recipes-core/isar-mmdebstrap/isar-mmdebstrap.inc
@@ -165,7 +165,7 @@ do_bootstrap() {
line="[trusted=yes] ${line}"
fi
echo "deb ${line}" > "${WORKDIR}/sources.list.d/base-apt.list"
- line="copy://$base_apt_tmp/${BASE_DISTRO} ${BASE_DISTRO_CODENAME} main"
+ line="copy://$base_apt_tmp/${BOOTSTRAP_BASE_DISTRO} ${BASE_DISTRO_CODENAME} main"
if [ -z "${BASE_REPO_KEY}" ]; then
line="[trusted=yes] ${line}"
fi
--
2.55.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/20261021102544.3614772-4-felix.moessbauer%40siemens.com.
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH 0/3] Fixes for BASE_DISTRO
2026-10-21 10:25 [PATCH 0/3] Fixes for BASE_DISTRO 'Felix Moessbauer' via isar-users
` (2 preceding siblings ...)
2026-10-21 10:25 ` [PATCH 3/3] bootstrap: point cached deb-src at the bootstrapped " 'Felix Moessbauer' via isar-users
@ 2026-11-06 9:59 ` 'Moessbauer, Felix' via isar-users
2026-11-06 16:00 ` Zhihang Wei
3 siblings, 1 reply; 6+ messages in thread
From: 'Moessbauer, Felix' via isar-users @ 2026-11-06 9:59 UTC (permalink / raw)
To: isar-users; +Cc: wzh
On Wed, 2026-10-21 at 12:25 +0200, Felix Moessbauer wrote:
> The raspi builds expose issues related to the handling of the BASE_DISTRO,
> as it is not "debian" but "raspios64". With the upcoming changes
> in "More build time reductions", these bugs are surfaced.
>
> In the CI, the bugs probably have partially been hidden by leftover
> artifacts from previous test cases.
Hi, are there any news on this? Is there anything needed from my side
to get this merged?
Felix
>
> Best regards,
> Felix Moessbauer
>
> Felix Moessbauer (3):
> crossvars: provide the base distro of the selected sbuild chroot
> apt-fetcher: cache sources under the chroot's base distro
> bootstrap: point cached deb-src at the bootstrapped base distro
>
> meta/classes-recipe/crossvars.bbclass | 8 ++++++++
> meta/classes-recipe/dpkg.bbclass | 5 +----
> meta/lib/aptsrc_fetcher.py | 4 +++-
> meta/recipes-core/isar-mmdebstrap/isar-mmdebstrap.inc | 2 +-
> 4 files changed, 13 insertions(+), 6 deletions(-)
>
> --
> 2.55.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/d6536e6827d615a09ec251fcc10c0559772aecd3.camel%40siemens.com.
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH 0/3] Fixes for BASE_DISTRO
2026-11-06 9:59 ` [PATCH 0/3] Fixes for BASE_DISTRO 'Moessbauer, Felix' via isar-users
@ 2026-11-06 16:00 ` Zhihang Wei
0 siblings, 0 replies; 6+ messages in thread
From: Zhihang Wei @ 2026-11-06 16:00 UTC (permalink / raw)
To: Moessbauer, Felix, isar-users
On 11/6/26 10:59, Moessbauer, Felix wrote:
> On Wed, 2026-10-21 at 12:25 +0200, Felix Moessbauer wrote:
>> The raspi builds expose issues related to the handling of the BASE_DISTRO,
>> as it is not "debian" but "raspios64". With the upcoming changes
>> in "More build time reductions", these bugs are surfaced.
>>
>> In the CI, the bugs probably have partially been hidden by leftover
>> artifacts from previous test cases.
> Hi, are there any news on this? Is there anything needed from my side
> to get this merged?
>
> Felix
>
Hi Felix,
This patch set itself is fine. But when testing it with "More build
time reductions", there are some issues.
On fast testsuite, CompatTest.test_compat_recipe fails with:
ERROR: mc:qemuarm64-trixie:libhello-compat-0.3-f4a5669-r0 do_dpkg_build:
ExecutionError('/build/isar_wzh_devel_2b_fast/79/build/tmp/work/debian-trixie-arm64/libhello-compat/0.3-f4a5669-r0/temp/run.dpkg_runbuild.3920233',
1, None, None)
DEBUG: Executing python function sstate_task_prefunc
DEBUG: Python function sstate_task_prefunc finished
DEBUG: Executing python function do_dpkg_build
DEBUG: Executing shell function dpkg_chroot_prepare
Creating
/etc/schroot/chroot.d/isar-jenkins-d397b874-809d-4d27-a3b6-051089ce40ed-3920233
DEBUG: Shell function dpkg_chroot_prepare finished
DEBUG: Executing shell function dpkg_runbuild
dpkg-parsechangelog: error: cannot open file
/build/isar_wzh_devel_2b_fast/79/build/debian/changelog: No such file or
directory
E: Could not parse /build/isar_wzh_devel_2b_fast/79/build/debian/changelog:
WARNING: exit code 1 from a shell command.
DEBUG: Executing shell function dpkg_chroot_finalize
Removing
/etc/schroot/isar-jenkins-d397b874-809d-4d27-a3b6-051089ce40ed-3920233
Removing
/etc/schroot/chroot.d/isar-jenkins-d397b874-809d-4d27-a3b6-051089ce40ed-3920233
DEBUG: Shell function dpkg_chroot_finalize finished
DEBUG: Python function do_dpkg_build finished
It attempted to find the changelog directly under build/debian, it's
definitely not right.
But running CompatTest.test_compat_recipe alone passes. In the fast suite,
DevTest and LocaleTest run before CompatTest, so one of the earlier builds
probably affects it. I’ve been trying to find which target affects it, but
haven’t found it yet.
Zhihang
>> Best regards,
>> Felix Moessbauer
>>
>> Felix Moessbauer (3):
>> crossvars: provide the base distro of the selected sbuild chroot
>> apt-fetcher: cache sources under the chroot's base distro
>> bootstrap: point cached deb-src at the bootstrapped base distro
>>
>> meta/classes-recipe/crossvars.bbclass | 8 ++++++++
>> meta/classes-recipe/dpkg.bbclass | 5 +----
>> meta/lib/aptsrc_fetcher.py | 4 +++-
>> meta/recipes-core/isar-mmdebstrap/isar-mmdebstrap.inc | 2 +-
>> 4 files changed, 13 insertions(+), 6 deletions(-)
>>
>> --
>> 2.55.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/1a416d6c-416b-4d5a-854d-c84c44bfc71f%40ilbers.de.
^ permalink raw reply [flat|nested] 6+ messages in thread