public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Zhihang Wei <wzh@ilbers.de>
To: Felix Moessbauer <felix.moessbauer@siemens.com>,
	isar-users@googlegroups.com
Cc: jan.kiszka@siemens.com
Subject: Re: [PATCH 1/1] sbuild-chroot: fix incompatible dependency optimization
Date: Tue, 28 Jul 2026 17:33:04 +0200	[thread overview]
Message-ID: <6ef4133a-9562-4609-8d09-00a0ae4835bd@ilbers.de> (raw)
In-Reply-To: <20260724134749.1150268-1-felix.moessbauer@siemens.com>

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.

      reply	other threads:[~2026-07-28 15:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-24 13:47 'Felix Moessbauer' via isar-users
2026-07-28 15:33 ` Zhihang Wei [this message]

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=6ef4133a-9562-4609-8d09-00a0ae4835bd@ilbers.de \
    --to=wzh@ilbers.de \
    --cc=felix.moessbauer@siemens.com \
    --cc=isar-users@googlegroups.com \
    --cc=jan.kiszka@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