sbuild-chroot/sbuild-chroot-host: enable apt-utils only for bookworm

Message ID 20230722023029.1710181-1-srinuvasan_a@mentor.com
State Rejected, archived
Headers show
Series sbuild-chroot/sbuild-chroot-host: enable apt-utils only for bookworm | expand

Commit Message

Srinuvasan Arjunan July 22, 2023, 2:30 a.m. UTC
From: Srinuvasan A <srinuvasan.a@siemens.com>

In downstream layer we try to cross-building packages for bullseye,
but it throws the below error:

| Reading package lists...
| Building dependency tree...
| Package apt-utils is not available, but is referred to by another package.
| This may mean that the package is missing, has been obsoleted, or
| is only available from another source
| However the following packages replace it:
|   apt:armhf apt
|
| E: Package 'apt-utils' has no installation candidate
| WARNING: exit code 100 from a shell command.

I hope the APT resolver (/usr/lib/apt/solvers/apt) only demands for
bookworm, hence it's enabled based on BASE_DISTRO_CODENAME.

Signed-off-by: Srinuvasan A <srinuvasan.a@siemens.com>
---
 meta/recipes-devtools/sbuild-chroot/sbuild-chroot-host.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Henning Schild July 22, 2023, 8:30 a.m. UTC | #1
Am Sat, 22 Jul 2023 08:00:29 +0530
schrieb Srinuvasan Arjunan <srinuvasan_a@mentor.com>:

> From: Srinuvasan A <srinuvasan.a@siemens.com>
> 
> In downstream layer we try to cross-building packages for bullseye,
> but it throws the below error:
> 
> | Reading package lists...
> | Building dependency tree...
> | Package apt-utils is not available, but is referred to by another
> package. | This may mean that the package is missing, has been
> obsoleted, or | is only available from another source
> | However the following packages replace it:
> |   apt:armhf apt
> |
> | E: Package 'apt-utils' has no installation candidate
> | WARNING: exit code 100 from a shell command.
> 
> I hope the APT resolver (/usr/lib/apt/solvers/apt) only demands for
> bookworm, hence it's enabled based on BASE_DISTRO_CODENAME.
> 
> Signed-off-by: Srinuvasan A <srinuvasan.a@siemens.com>
> ---
>  meta/recipes-devtools/sbuild-chroot/sbuild-chroot-host.bb | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git
> a/meta/recipes-devtools/sbuild-chroot/sbuild-chroot-host.bb
> b/meta/recipes-devtools/sbuild-chroot/sbuild-chroot-host.bb index
> 255d693..9738a1c 100644 ---
> a/meta/recipes-devtools/sbuild-chroot/sbuild-chroot-host.bb +++
> b/meta/recipes-devtools/sbuild-chroot/sbuild-chroot-host.bb @@ -16,7
> +16,7 @@ ROOTFS_BASE_DISTRO = "${HOST_BASE_DISTRO}"
> SBUILD_CHROOT_PREINSTALL ?= " \ ${SBUILD_CHROOT_PREINSTALL_COMMON} \
> crossbuild-essential-${DISTRO_ARCH} \
> -    apt-utils \
> +    ${@ 'apt-utils' if d.getVar('BASE_DISTRO_CODENAME') ==
> 'bookworm' else ''} \ "

This is wrong because you want to say >= bookworm and all affected
ubuntus and raspbians. If distro names need to be listed rather list
the old ones currently supported in isar. But a list is just hard to
maintain, even if it has to shrink over time instead of grow.

Henning

>  
>  SBUILD_CHROOT_PREINSTALL:riscv64 ?= " \
Henning Schild July 22, 2023, 10:22 a.m. UTC | #2
Am Sat, 22 Jul 2023 08:00:29 +0530
schrieb Srinuvasan Arjunan <srinuvasan_a@mentor.com>:

> From: Srinuvasan A <srinuvasan.a@siemens.com>
> 
> In downstream layer we try to cross-building packages for bullseye,
> but it throws the below error:
> 
> | Reading package lists...
> | Building dependency tree...
> | Package apt-utils is not available, but is referred to by another
> package. | This may mean that the package is missing, has been
> obsoleted, or | is only available from another source
> | However the following packages replace it:
> |   apt:armhf apt
> |
> | E: Package 'apt-utils' has no installation candidate
> | WARNING: exit code 100 from a shell command.

Are you maybe not running against a real/full debian mirror?

apt-utils is available for bullseye
https://packages.debian.org/bullseye/apt-utils
and for buster if you want
https://packages.debian.org/buster/apt-utils

both including armhf

What you describe here would have been found by CI.

I suggest you rebuild your partial mirror and include that package, or
carry that patch in your layer.

Henning

> I hope the APT resolver (/usr/lib/apt/solvers/apt) only demands for
> bookworm, hence it's enabled based on BASE_DISTRO_CODENAME.
> 
> Signed-off-by: Srinuvasan A <srinuvasan.a@siemens.com>
> ---
>  meta/recipes-devtools/sbuild-chroot/sbuild-chroot-host.bb | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git
> a/meta/recipes-devtools/sbuild-chroot/sbuild-chroot-host.bb
> b/meta/recipes-devtools/sbuild-chroot/sbuild-chroot-host.bb index
> 255d693..9738a1c 100644 ---
> a/meta/recipes-devtools/sbuild-chroot/sbuild-chroot-host.bb +++
> b/meta/recipes-devtools/sbuild-chroot/sbuild-chroot-host.bb @@ -16,7
> +16,7 @@ ROOTFS_BASE_DISTRO = "${HOST_BASE_DISTRO}"
> SBUILD_CHROOT_PREINSTALL ?= " \ ${SBUILD_CHROOT_PREINSTALL_COMMON} \
> crossbuild-essential-${DISTRO_ARCH} \
> -    apt-utils \
> +    ${@ 'apt-utils' if d.getVar('BASE_DISTRO_CODENAME') ==
> 'bookworm' else ''} \ "
>  
>  SBUILD_CHROOT_PREINSTALL:riscv64 ?= " \
Srinuvasan Arjunan July 22, 2023, 11:23 a.m. UTC | #3
On Sat, Jul 22, 2023 at 3:52 PM 'Henning Schild' via isar-users <
isar-users@googlegroups.com> wrote:

> Am Sat, 22 Jul 2023 08:00:29 +0530
> schrieb Srinuvasan Arjunan <srinuvasan_a@mentor.com>:
>
> > From: Srinuvasan A <srinuvasan.a@siemens.com>
> >
> > In downstream layer we try to cross-building packages for bullseye,
> > but it throws the below error:
> >
> > | Reading package lists...
> > | Building dependency tree...
> > | Package apt-utils is not available, but is referred to by another
> > package. | This may mean that the package is missing, has been
> > obsoleted, or | is only available from another source
> > | However the following packages replace it:
> > |   apt:armhf apt
> > |
> > | E: Package 'apt-utils' has no installation candidate
> > | WARNING: exit code 100 from a shell command.
>
> Are you maybe not running against a real/full debian mirror?
>
> apt-utils is available for bullseye
> https://packages.debian.org/bullseye/apt-utils
> and for buster if you want
> https://packages.debian.org/buster/apt-utils
>
> both including armhf
>
> What you describe here would have been found by CI.
>
> I suggest you rebuild your partial mirror and include that package, or
> carry that patch in your layer.
>

   Yes i  am not using a real/full debian mirror, i found that my mirror
doesn't have that package, let's try to include that one.
   Thanks,
    Srinu

>
> Henning
>
> > I hope the APT resolver (/usr/lib/apt/solvers/apt) only demands for
> > bookworm, hence it's enabled based on BASE_DISTRO_CODENAME.
> >
> > Signed-off-by: Srinuvasan A <srinuvasan.a@siemens.com>
> > ---
> >  meta/recipes-devtools/sbuild-chroot/sbuild-chroot-host.bb | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git
> > a/meta/recipes-devtools/sbuild-chroot/sbuild-chroot-host.bb
> > b/meta/recipes-devtools/sbuild-chroot/sbuild-chroot-host.bb index
> > 255d693..9738a1c 100644 ---
> > a/meta/recipes-devtools/sbuild-chroot/sbuild-chroot-host.bb +++
> > b/meta/recipes-devtools/sbuild-chroot/sbuild-chroot-host.bb @@ -16,7
> > +16,7 @@ ROOTFS_BASE_DISTRO = "${HOST_BASE_DISTRO}"
> > SBUILD_CHROOT_PREINSTALL ?= " \ ${SBUILD_CHROOT_PREINSTALL_COMMON} \
> > crossbuild-essential-${DISTRO_ARCH} \
> > -    apt-utils \
> > +    ${@ 'apt-utils' if d.getVar('BASE_DISTRO_CODENAME') ==
> > 'bookworm' else ''} \ "
> >
> >  SBUILD_CHROOT_PREINSTALL:riscv64 ?= " \
>
> --
> 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 on the web visit
> https://groups.google.com/d/msgid/isar-users/20230722122211.34dbcd13%40md1za8fc.ad001.siemens.net
> .
>

Patch

diff --git a/meta/recipes-devtools/sbuild-chroot/sbuild-chroot-host.bb b/meta/recipes-devtools/sbuild-chroot/sbuild-chroot-host.bb
index 255d693..9738a1c 100644
--- a/meta/recipes-devtools/sbuild-chroot/sbuild-chroot-host.bb
+++ b/meta/recipes-devtools/sbuild-chroot/sbuild-chroot-host.bb
@@ -16,7 +16,7 @@  ROOTFS_BASE_DISTRO = "${HOST_BASE_DISTRO}"
 SBUILD_CHROOT_PREINSTALL ?= " \
     ${SBUILD_CHROOT_PREINSTALL_COMMON} \
     crossbuild-essential-${DISTRO_ARCH} \
-    apt-utils \
+    ${@ 'apt-utils' if d.getVar('BASE_DISTRO_CODENAME') == 'bookworm' else ''} \
     "
 
 SBUILD_CHROOT_PREINSTALL:riscv64 ?= " \