* [PATCH 1/1] sbuild-chroot: fix incompatible dependency optimization
@ 2026-07-24 13:47 'Felix Moessbauer' via isar-users
2026-07-28 15:33 ` Zhihang Wei
0 siblings, 1 reply; 2+ messages in thread
From: 'Felix Moessbauer' via isar-users @ 2026-07-24 13:47 UTC (permalink / raw)
To: isar-users; +Cc: wzh, jan.kiszka, Felix Moessbauer
The dependency tree around build-essential is complex. On
architectures which cannot be cross-compiled incompatible with our
build-time optimization of pre-installing packages usually needed for
building. As the PACKAGE_ARCH = <host> packages are always compiled in
the sbuild-chroot-host, this chroot needs to be installable.
For archs that cannot be cross-compiled due to internal dependency
issues (like mipsel), we must not install any cross tooling into the
host chroot (as this cannot be installed). To not specialize for
specific architectures, we optimize this by only installing the cross
tooling into the sbuild-chroot-host if ISAR_CROSS_COMPILE is enabled.
By that, the install time of the chroot is also reduced, as less
not-needed dependencies are installed.
This fixes the following error:
The following packages have unmet dependencies:
libc6-dev : Depends: linux-libc-dev but it is not installable
E: Unable to correct problems, you have held broken packages.
Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
---
.../sbuild-chroot/sbuild-chroot-host.bb | 2 +-
.../sbuild-chroot/sbuild-chroot-target.bb | 1 +
.../sbuild-chroot/sbuild-chroot.inc | 18 +++++++++++-------
3 files changed, 13 insertions(+), 8 deletions(-)
diff --git a/meta/recipes-devtools/sbuild-chroot/sbuild-chroot-host.bb b/meta/recipes-devtools/sbuild-chroot/sbuild-chroot-host.bb
index 3e66a7f4..52a461fe 100644
--- a/meta/recipes-devtools/sbuild-chroot/sbuild-chroot-host.bb
+++ b/meta/recipes-devtools/sbuild-chroot/sbuild-chroot-host.bb
@@ -15,6 +15,6 @@ ROOTFS_BASE_DISTRO = "${HOST_BASE_DISTRO}"
SBUILD_CHROOT_PREINSTALL ?= " \
${SBUILD_CHROOT_PREINSTALL_COMMON} \
- crossbuild-essential-${DISTRO_ARCH} \
+ ${@ 'libc6-dev:${DISTRO_ARCH} crossbuild-essential-${DISTRO_ARCH}' if bb.utils.to_boolean(d.getVar('ISAR_CROSS_COMPILE')) else ''} \
apt-utils \
"
diff --git a/meta/recipes-devtools/sbuild-chroot/sbuild-chroot-target.bb b/meta/recipes-devtools/sbuild-chroot/sbuild-chroot-target.bb
index 763453e6..05d24b97 100644
--- a/meta/recipes-devtools/sbuild-chroot/sbuild-chroot-target.bb
+++ b/meta/recipes-devtools/sbuild-chroot/sbuild-chroot-target.bb
@@ -11,5 +11,6 @@ require sbuild-chroot.inc
SBUILD_CHROOT_PREINSTALL ?= " \
${SBUILD_CHROOT_PREINSTALL_COMMON} \
+ libc6-dev:${DISTRO_ARCH} \
${@' apt-utils' if bb.utils.to_boolean(d.getVar('ISAR_ENABLE_COMPAT_ARCH')) else ''} \
"
diff --git a/meta/recipes-devtools/sbuild-chroot/sbuild-chroot.inc b/meta/recipes-devtools/sbuild-chroot/sbuild-chroot.inc
index 054d7fc2..80c43d20 100644
--- a/meta/recipes-devtools/sbuild-chroot/sbuild-chroot.inc
+++ b/meta/recipes-devtools/sbuild-chroot/sbuild-chroot.inc
@@ -20,8 +20,11 @@ SBUILD_CHROOT_PREINSTALL_EXTRA ??= ""
python() {
distro_gcc = d.getVar('DISTRO_GCC')
distro_arch = d.getVar('DISTRO_ARCH')
+ rootfs_arch = d.getVar('ROOTFS_ARCH')
+ cross = bb.utils.to_boolean(d.getVar('ISAR_CROSS_COMPILE'))
+ install_distro_arch_tooling = cross or rootfs_arch == distro_arch
- if d.getVar('DISTRO_GCC'):
+ if distro_gcc and install_distro_arch_tooling:
d.appendVar('SBUILD_CHROOT_PREINSTALL_COMMON',
f" libgcc-{distro_gcc}-dev:{distro_arch}")
d.appendVar('SBUILD_CHROOT_PREINSTALL_COMMON',
@@ -29,11 +32,13 @@ python() {
if bb.utils.to_boolean(d.getVar('ISAR_ENABLE_COMPAT_ARCH')):
compat_arch = d.getVar('COMPAT_DISTRO_ARCH')
- d.appendVar('SBUILD_CHROOT_COMPAT_PREINSTALL',
- f" libc6-dev:{compat_arch}")
- d.appendVar('SBUILD_CHROOT_COMPAT_PREINSTALL',
- f" crossbuild-essential-{compat_arch}")
- if d.getVar('DISTRO_GCC'):
+ if install_distro_arch_tooling:
+ d.appendVar('SBUILD_CHROOT_COMPAT_PREINSTALL',
+ f" libc6-dev:{compat_arch}")
+ d.appendVar('SBUILD_CHROOT_COMPAT_PREINSTALL',
+ f" crossbuild-essential-{compat_arch}")
+
+ if distro_gcc and install_distro_arch_tooling:
d.appendVar('SBUILD_CHROOT_COMPAT_PREINSTALL',
f" libgcc-{distro_gcc}-dev:{compat_arch}")
d.appendVar('SBUILD_CHROOT_COMPAT_PREINSTALL',
@@ -43,7 +48,6 @@ python() {
SBUILD_CHROOT_PREINSTALL_COMMON = " \
${SBUILD_CHROOT_COMPAT_PREINSTALL} \
${SBUILD_CHROOT_PREINSTALL_EXTRA} \
- libc6-dev:${DISTRO_ARCH} \
fakeroot \
build-essential \
debhelper \
--
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/20260724134749.1150268-1-felix.moessbauer%40siemens.com.
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH 1/1] sbuild-chroot: fix incompatible dependency optimization
2026-07-24 13:47 [PATCH 1/1] sbuild-chroot: fix incompatible dependency optimization 'Felix Moessbauer' via isar-users
@ 2026-07-28 15:33 ` Zhihang Wei
0 siblings, 0 replies; 2+ messages in thread
From: Zhihang Wei @ 2026-07-28 15:33 UTC (permalink / raw)
To: Felix Moessbauer, isar-users; +Cc: jan.kiszka
Applied to next, thanks.
Zhihang
On 7/24/26 15:47, Felix Moessbauer wrote:
> The dependency tree around build-essential is complex. On
> architectures which cannot be cross-compiled incompatible with our
> build-time optimization of pre-installing packages usually needed for
> building. As the PACKAGE_ARCH = <host> packages are always compiled in
> the sbuild-chroot-host, this chroot needs to be installable.
>
> For archs that cannot be cross-compiled due to internal dependency
> issues (like mipsel), we must not install any cross tooling into the
> host chroot (as this cannot be installed). To not specialize for
> specific architectures, we optimize this by only installing the cross
> tooling into the sbuild-chroot-host if ISAR_CROSS_COMPILE is enabled.
> By that, the install time of the chroot is also reduced, as less
> not-needed dependencies are installed.
>
> This fixes the following error:
> The following packages have unmet dependencies:
> libc6-dev : Depends: linux-libc-dev but it is not installable
> E: Unable to correct problems, you have held broken packages.
>
> Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
> ---
> .../sbuild-chroot/sbuild-chroot-host.bb | 2 +-
> .../sbuild-chroot/sbuild-chroot-target.bb | 1 +
> .../sbuild-chroot/sbuild-chroot.inc | 18 +++++++++++-------
> 3 files changed, 13 insertions(+), 8 deletions(-)
>
> diff --git a/meta/recipes-devtools/sbuild-chroot/sbuild-chroot-host.bb b/meta/recipes-devtools/sbuild-chroot/sbuild-chroot-host.bb
> index 3e66a7f4..52a461fe 100644
> --- a/meta/recipes-devtools/sbuild-chroot/sbuild-chroot-host.bb
> +++ b/meta/recipes-devtools/sbuild-chroot/sbuild-chroot-host.bb
> @@ -15,6 +15,6 @@ ROOTFS_BASE_DISTRO = "${HOST_BASE_DISTRO}"
>
> SBUILD_CHROOT_PREINSTALL ?= " \
> ${SBUILD_CHROOT_PREINSTALL_COMMON} \
> - crossbuild-essential-${DISTRO_ARCH} \
> + ${@ 'libc6-dev:${DISTRO_ARCH} crossbuild-essential-${DISTRO_ARCH}' if bb.utils.to_boolean(d.getVar('ISAR_CROSS_COMPILE')) else ''} \
> apt-utils \
> "
> diff --git a/meta/recipes-devtools/sbuild-chroot/sbuild-chroot-target.bb b/meta/recipes-devtools/sbuild-chroot/sbuild-chroot-target.bb
> index 763453e6..05d24b97 100644
> --- a/meta/recipes-devtools/sbuild-chroot/sbuild-chroot-target.bb
> +++ b/meta/recipes-devtools/sbuild-chroot/sbuild-chroot-target.bb
> @@ -11,5 +11,6 @@ require sbuild-chroot.inc
>
> SBUILD_CHROOT_PREINSTALL ?= " \
> ${SBUILD_CHROOT_PREINSTALL_COMMON} \
> + libc6-dev:${DISTRO_ARCH} \
> ${@' apt-utils' if bb.utils.to_boolean(d.getVar('ISAR_ENABLE_COMPAT_ARCH')) else ''} \
> "
> diff --git a/meta/recipes-devtools/sbuild-chroot/sbuild-chroot.inc b/meta/recipes-devtools/sbuild-chroot/sbuild-chroot.inc
> index 054d7fc2..80c43d20 100644
> --- a/meta/recipes-devtools/sbuild-chroot/sbuild-chroot.inc
> +++ b/meta/recipes-devtools/sbuild-chroot/sbuild-chroot.inc
> @@ -20,8 +20,11 @@ SBUILD_CHROOT_PREINSTALL_EXTRA ??= ""
> python() {
> distro_gcc = d.getVar('DISTRO_GCC')
> distro_arch = d.getVar('DISTRO_ARCH')
> + rootfs_arch = d.getVar('ROOTFS_ARCH')
> + cross = bb.utils.to_boolean(d.getVar('ISAR_CROSS_COMPILE'))
> + install_distro_arch_tooling = cross or rootfs_arch == distro_arch
>
> - if d.getVar('DISTRO_GCC'):
> + if distro_gcc and install_distro_arch_tooling:
> d.appendVar('SBUILD_CHROOT_PREINSTALL_COMMON',
> f" libgcc-{distro_gcc}-dev:{distro_arch}")
> d.appendVar('SBUILD_CHROOT_PREINSTALL_COMMON',
> @@ -29,11 +32,13 @@ python() {
>
> if bb.utils.to_boolean(d.getVar('ISAR_ENABLE_COMPAT_ARCH')):
> compat_arch = d.getVar('COMPAT_DISTRO_ARCH')
> - d.appendVar('SBUILD_CHROOT_COMPAT_PREINSTALL',
> - f" libc6-dev:{compat_arch}")
> - d.appendVar('SBUILD_CHROOT_COMPAT_PREINSTALL',
> - f" crossbuild-essential-{compat_arch}")
> - if d.getVar('DISTRO_GCC'):
> + if install_distro_arch_tooling:
> + d.appendVar('SBUILD_CHROOT_COMPAT_PREINSTALL',
> + f" libc6-dev:{compat_arch}")
> + d.appendVar('SBUILD_CHROOT_COMPAT_PREINSTALL',
> + f" crossbuild-essential-{compat_arch}")
> +
> + if distro_gcc and install_distro_arch_tooling:
> d.appendVar('SBUILD_CHROOT_COMPAT_PREINSTALL',
> f" libgcc-{distro_gcc}-dev:{compat_arch}")
> d.appendVar('SBUILD_CHROOT_COMPAT_PREINSTALL',
> @@ -43,7 +48,6 @@ python() {
> SBUILD_CHROOT_PREINSTALL_COMMON = " \
> ${SBUILD_CHROOT_COMPAT_PREINSTALL} \
> ${SBUILD_CHROOT_PREINSTALL_EXTRA} \
> - libc6-dev:${DISTRO_ARCH} \
> fakeroot \
> build-essential \
> debhelper \
--
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/6ef4133a-9562-4609-8d09-00a0ae4835bd%40ilbers.de.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-07-28 15:33 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-07-24 13:47 [PATCH 1/1] sbuild-chroot: fix incompatible dependency optimization 'Felix Moessbauer' via isar-users
2026-07-28 15:33 ` Zhihang Wei
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox