[3/3] remove obsolete compat-arch override

Message ID 20230206122050.337270-4-adriaan.schmidt@siemens.com
State Superseded, archived
Headers show
Series multiarch support | expand

Commit Message

Schmidt, Adriaan Feb. 6, 2023, 12:20 p.m. UTC
The compat-arch override is no longer needed, as PACKAGE_ARCH is controlled
by DEPENDing on <package>-compat.

Also change the compat test: adding the compat package now happens via
IMAGE_INSTALL in the config.

Signed-off-by: Adriaan Schmidt <adriaan.schmidt@siemens.com>
---
 meta-isar/recipes-app/hello-isar/hello-isar.bb     |  3 ---
 meta-isar/recipes-app/libhello/libhello.bb         |  3 ---
 meta/conf/bitbake.conf                             |  3 +--
 .../recipes-core/isar-bootstrap/isar-bootstrap.inc |  2 ++
 .../sbuild-chroot/sbuild-chroot.inc                | 14 ++++++++------
 testsuite/cibuilder.py                             |  2 ++
 6 files changed, 13 insertions(+), 14 deletions(-)

Comments

Jan Kiszka Feb. 6, 2023, 1 p.m. UTC | #1
On 06.02.23 13:20, Adriaan Schmidt wrote:
> The compat-arch override is no longer needed, as PACKAGE_ARCH is controlled
> by DEPENDing on <package>-compat.
> 
> Also change the compat test: adding the compat package now happens via
> IMAGE_INSTALL in the config.
> 
> Signed-off-by: Adriaan Schmidt <adriaan.schmidt@siemens.com>
> ---
>  meta-isar/recipes-app/hello-isar/hello-isar.bb     |  3 ---
>  meta-isar/recipes-app/libhello/libhello.bb         |  3 ---
>  meta/conf/bitbake.conf                             |  3 +--
>  .../recipes-core/isar-bootstrap/isar-bootstrap.inc |  2 ++
>  .../sbuild-chroot/sbuild-chroot.inc                | 14 ++++++++------
>  testsuite/cibuilder.py                             |  2 ++
>  6 files changed, 13 insertions(+), 14 deletions(-)
> 
> diff --git a/meta-isar/recipes-app/hello-isar/hello-isar.bb b/meta-isar/recipes-app/hello-isar/hello-isar.bb
> index 39ddecb9..7d9f8322 100644
> --- a/meta-isar/recipes-app/hello-isar/hello-isar.bb
> +++ b/meta-isar/recipes-app/hello-isar/hello-isar.bb
> @@ -20,7 +20,4 @@ SRC_URI = " \
>      file://yet-another-change.txt;apply=yes;striplevel=0"
>  SRCREV = "a18c14cc11ce6b003f3469e89223cffb4016861d"
>  
> -# NOTE: This is just to test 32-bit building on 64-bit archs.
> -PACKAGE_ARCH:compat-arch = "${COMPAT_DISTRO_ARCH}"
> -
>  inherit dpkg
> diff --git a/meta-isar/recipes-app/libhello/libhello.bb b/meta-isar/recipes-app/libhello/libhello.bb
> index 3770fdb4..8b10842f 100644
> --- a/meta-isar/recipes-app/libhello/libhello.bb
> +++ b/meta-isar/recipes-app/libhello/libhello.bb
> @@ -13,7 +13,4 @@ PV = "0.1-98f2e41"
>  SRC_URI = "git://github.com/ilbers/libhello.git;protocol=https;branch=master;destsuffix=${P}"
>  SRCREV = "98f2e41e7d05ab8d19b0c5d160b104b725c8fd93"
>  
> -# NOTE: This is just to test 32-bit building on 64-bit archs.
> -PACKAGE_ARCH:compat-arch = "${COMPAT_DISTRO_ARCH}"
> -
>  inherit dpkg
> diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
> index f38bb447..1f010f4b 100644
> --- a/meta/conf/bitbake.conf
> +++ b/meta/conf/bitbake.conf
> @@ -67,9 +67,8 @@ KERNEL_FILE:mipsel ?= "vmlinux"
>  KERNEL_FILE:riscv64 ?= "vmlinux"
>  KERNEL_FILE:arm64 ?= "vmlinux"
>  
> -OVERRIDES = "${PACKAGE_ARCH}:${COMPAT_OVERRIDE}:${MACHINE}:${DISTRO}:${BASE_DISTRO_CODENAME}:forcevariable"
> +OVERRIDES = "${PACKAGE_ARCH}:${MACHINE}:${DISTRO}:${BASE_DISTRO_CODENAME}:forcevariable"
>  FILESOVERRIDES = "${PACKAGE_ARCH}:${MACHINE}"
> -COMPAT_OVERRIDE = "${@'compat-arch' if d.getVar('ISAR_ENABLE_COMPAT_ARCH') == '1' else ''}"
>  
>  # Setting default QEMU_ARCH variables for different DISTRO_ARCH:
>  QEMU_ARCH:amd64 = "x86_64"
> diff --git a/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc b/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc
> index 99d75e21..21a2d92f 100644
> --- a/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc
> +++ b/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc
> @@ -274,6 +274,8 @@ do_bootstrap[dirs] = "${DEPLOY_DIR_BOOTSTRAP}"
>  do_bootstrap[depends] = "base-apt:do_cache isar-apt:do_cache_config"
>  do_bootstrap[network] = "${TASK_USE_NETWORK_AND_SUDO}"
>  
> +inherit compat
> +
>  do_bootstrap() {
>      if [ "${ISAR_ENABLE_COMPAT_ARCH}" = "1" ]; then
>          if [ -z "${COMPAT_DISTRO_ARCH}" ]; then
> diff --git a/meta/recipes-devtools/sbuild-chroot/sbuild-chroot.inc b/meta/recipes-devtools/sbuild-chroot/sbuild-chroot.inc
> index fb061dac..fd8bb648 100644
> --- a/meta/recipes-devtools/sbuild-chroot/sbuild-chroot.inc
> +++ b/meta/recipes-devtools/sbuild-chroot/sbuild-chroot.inc
> @@ -9,6 +9,7 @@ LIC_FILES_CHKSUM = "file://${LAYERDIR_core}/licenses/COPYING.GPLv2;md5=751419260
>  PV = "1.0"
>  
>  inherit rootfs
> +inherit compat
>  
>  python() {
>      distro_gcc = d.getVar('DISTRO_GCC')
> @@ -20,18 +21,19 @@ python() {
>          d.appendVar('SBUILD_CHROOT_PREINSTALL_COMMON',
>                      ' libstdc++-{}-dev:{}'.format(distro_gcc, distro_arch))
>  
> -        if d.getVar('ISAR_ENABLE_COMPAT_ARCH') == '1':
> -            compat_arch = d.getVar('COMPAT_DISTRO_ARCH')
> +    if d.getVar('ISAR_ENABLE_COMPAT_ARCH') == '1':
> +        compat_arch = d.getVar('COMPAT_DISTRO_ARCH')
> +        d.appendVar('SBUILD_CHROOT_COMPAT_PREINSTALL',
> +                    ' libc6-dev:{}'.format(compat_arch))
> +        d.appendVar('SBUILD_CHROOT_COMPAT_PREINSTALL',
> +                    ' crossbuild-essential-{}'.format(compat_arch))
> +        if d.getVar('DISTRO_GCC'):
>              d.appendVar('SBUILD_CHROOT_COMPAT_PREINSTALL',
>                          ' libgcc-{}-dev:{}'.format(distro_gcc, compat_arch))
>              d.appendVar('SBUILD_CHROOT_COMPAT_PREINSTALL',
>                          ' libstdc++-{}-dev:{}'.format(distro_gcc, compat_arch))
>  }
>  
> -SBUILD_CHROOT_COMPAT_PREINSTALL:compat-arch = " \
> -    libc6-dev:${COMPAT_DISTRO_ARCH} \
> -    crossbuild-essential-${COMPAT_DISTRO_ARCH}"
> -
>  SBUILD_CHROOT_PREINSTALL_COMMON = " \
>      ${SBUILD_CHROOT_COMPAT_PREINSTALL} \
>      libc6-dev:${DISTRO_ARCH} \
> diff --git a/testsuite/cibuilder.py b/testsuite/cibuilder.py
> index 9d1b80f7..0b68e87d 100755
> --- a/testsuite/cibuilder.py
> +++ b/testsuite/cibuilder.py
> @@ -92,7 +92,9 @@ class CIBuilder(Test):
>          with open(self.build_dir + '/conf/ci_build.conf', 'w') as f:
>              if compat_arch:
>                  f.write('ISAR_ENABLE_COMPAT_ARCH:amd64 = "1"\n')
> +                f.write('IMAGE_INSTALL:append:amd64 = " hello-isar-compat"\n')
>                  f.write('ISAR_ENABLE_COMPAT_ARCH:arm64 = "1"\n')
> +                f.write('IMAGE_INSTALL:append:arm64 = " hello-isar-compat"\n')
>                  f.write('IMAGE_INSTALL += "kselftest"\n')
>              if cross:
>                  f.write('ISAR_CROSS_COMPILE = "1"\n')

This does not oull hello-isar-compat when doing a local build. We likely
need something in meta-isar/conf/local.conf.sample now.

Jan
Schmidt, Adriaan Feb. 6, 2023, 1:34 p.m. UTC | #2
Kiszka, Jan (T CED) <jan.kiszka@siemens.com>, 6. Februar 2023 14:01:
> On 06.02.23 13:20, Adriaan Schmidt wrote:
> > The compat-arch override is no longer needed, as PACKAGE_ARCH is controlled
> > by DEPENDing on <package>-compat.
> >
> > Also change the compat test: adding the compat package now happens via
> > IMAGE_INSTALL in the config.
> >
> > Signed-off-by: Adriaan Schmidt <adriaan.schmidt@siemens.com>
> > ---
> >  meta-isar/recipes-app/hello-isar/hello-isar.bb     |  3 ---
> >  meta-isar/recipes-app/libhello/libhello.bb         |  3 ---
> >  meta/conf/bitbake.conf                             |  3 +--
> >  .../recipes-core/isar-bootstrap/isar-bootstrap.inc |  2 ++
> >  .../sbuild-chroot/sbuild-chroot.inc                | 14 ++++++++------
> >  testsuite/cibuilder.py                             |  2 ++
> >  6 files changed, 13 insertions(+), 14 deletions(-)
> >
> > diff --git a/meta-isar/recipes-app/hello-isar/hello-isar.bb b/meta-
> isar/recipes-app/hello-isar/hello-isar.bb
> > index 39ddecb9..7d9f8322 100644
> > --- a/meta-isar/recipes-app/hello-isar/hello-isar.bb
> > +++ b/meta-isar/recipes-app/hello-isar/hello-isar.bb
> > @@ -20,7 +20,4 @@ SRC_URI = " \
> >      file://yet-another-change.txt;apply=yes;striplevel=0"
> >  SRCREV = "a18c14cc11ce6b003f3469e89223cffb4016861d"
> >
> > -# NOTE: This is just to test 32-bit building on 64-bit archs.
> > -PACKAGE_ARCH:compat-arch = "${COMPAT_DISTRO_ARCH}"
> > -
> >  inherit dpkg
> > diff --git a/meta-isar/recipes-app/libhello/libhello.bb b/meta-
> isar/recipes-app/libhello/libhello.bb
> > index 3770fdb4..8b10842f 100644
> > --- a/meta-isar/recipes-app/libhello/libhello.bb
> > +++ b/meta-isar/recipes-app/libhello/libhello.bb
> > @@ -13,7 +13,4 @@ PV = "0.1-98f2e41"
> >  SRC_URI =
> "git://github.com/ilbers/libhello.git;protocol=https;branch=master;destsuffix
> =${P}"
> >  SRCREV = "98f2e41e7d05ab8d19b0c5d160b104b725c8fd93"
> >
> > -# NOTE: This is just to test 32-bit building on 64-bit archs.
> > -PACKAGE_ARCH:compat-arch = "${COMPAT_DISTRO_ARCH}"
> > -
> >  inherit dpkg
> > diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
> > index f38bb447..1f010f4b 100644
> > --- a/meta/conf/bitbake.conf
> > +++ b/meta/conf/bitbake.conf
> > @@ -67,9 +67,8 @@ KERNEL_FILE:mipsel ?= "vmlinux"
> >  KERNEL_FILE:riscv64 ?= "vmlinux"
> >  KERNEL_FILE:arm64 ?= "vmlinux"
> >
> > -OVERRIDES =
> "${PACKAGE_ARCH}:${COMPAT_OVERRIDE}:${MACHINE}:${DISTRO}:${BASE_DISTRO_CODENA
> ME}:forcevariable"
> > +OVERRIDES =
> "${PACKAGE_ARCH}:${MACHINE}:${DISTRO}:${BASE_DISTRO_CODENAME}:forcevariable"
> >  FILESOVERRIDES = "${PACKAGE_ARCH}:${MACHINE}"
> > -COMPAT_OVERRIDE = "${@'compat-arch' if d.getVar('ISAR_ENABLE_COMPAT_ARCH')
> == '1' else ''}"
> >
> >  # Setting default QEMU_ARCH variables for different DISTRO_ARCH:
> >  QEMU_ARCH:amd64 = "x86_64"
> > diff --git a/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc
> b/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc
> > index 99d75e21..21a2d92f 100644
> > --- a/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc
> > +++ b/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc
> > @@ -274,6 +274,8 @@ do_bootstrap[dirs] = "${DEPLOY_DIR_BOOTSTRAP}"
> >  do_bootstrap[depends] = "base-apt:do_cache isar-apt:do_cache_config"
> >  do_bootstrap[network] = "${TASK_USE_NETWORK_AND_SUDO}"
> >
> > +inherit compat
> > +
> >  do_bootstrap() {
> >      if [ "${ISAR_ENABLE_COMPAT_ARCH}" = "1" ]; then
> >          if [ -z "${COMPAT_DISTRO_ARCH}" ]; then
> > diff --git a/meta/recipes-devtools/sbuild-chroot/sbuild-chroot.inc
> b/meta/recipes-devtools/sbuild-chroot/sbuild-chroot.inc
> > index fb061dac..fd8bb648 100644
> > --- a/meta/recipes-devtools/sbuild-chroot/sbuild-chroot.inc
> > +++ b/meta/recipes-devtools/sbuild-chroot/sbuild-chroot.inc
> > @@ -9,6 +9,7 @@ LIC_FILES_CHKSUM =
> "file://${LAYERDIR_core}/licenses/COPYING.GPLv2;md5=751419260
> >  PV = "1.0"
> >
> >  inherit rootfs
> > +inherit compat
> >
> >  python() {
> >      distro_gcc = d.getVar('DISTRO_GCC')
> > @@ -20,18 +21,19 @@ python() {
> >          d.appendVar('SBUILD_CHROOT_PREINSTALL_COMMON',
> >                      ' libstdc++-{}-dev:{}'.format(distro_gcc,
> distro_arch))
> >
> > -        if d.getVar('ISAR_ENABLE_COMPAT_ARCH') == '1':
> > -            compat_arch = d.getVar('COMPAT_DISTRO_ARCH')
> > +    if d.getVar('ISAR_ENABLE_COMPAT_ARCH') == '1':
> > +        compat_arch = d.getVar('COMPAT_DISTRO_ARCH')
> > +        d.appendVar('SBUILD_CHROOT_COMPAT_PREINSTALL',
> > +                    ' libc6-dev:{}'.format(compat_arch))
> > +        d.appendVar('SBUILD_CHROOT_COMPAT_PREINSTALL',
> > +                    ' crossbuild-essential-{}'.format(compat_arch))
> > +        if d.getVar('DISTRO_GCC'):
> >              d.appendVar('SBUILD_CHROOT_COMPAT_PREINSTALL',
> >                          ' libgcc-{}-dev:{}'.format(distro_gcc,
> compat_arch))
> >              d.appendVar('SBUILD_CHROOT_COMPAT_PREINSTALL',
> >                          ' libstdc++-{}-dev:{}'.format(distro_gcc,
> compat_arch))
> >  }
> >
> > -SBUILD_CHROOT_COMPAT_PREINSTALL:compat-arch = " \
> > -    libc6-dev:${COMPAT_DISTRO_ARCH} \
> > -    crossbuild-essential-${COMPAT_DISTRO_ARCH}"
> > -
> >  SBUILD_CHROOT_PREINSTALL_COMMON = " \
> >      ${SBUILD_CHROOT_COMPAT_PREINSTALL} \
> >      libc6-dev:${DISTRO_ARCH} \
> > diff --git a/testsuite/cibuilder.py b/testsuite/cibuilder.py
> > index 9d1b80f7..0b68e87d 100755
> > --- a/testsuite/cibuilder.py
> > +++ b/testsuite/cibuilder.py
> > @@ -92,7 +92,9 @@ class CIBuilder(Test):
> >          with open(self.build_dir + '/conf/ci_build.conf', 'w') as f:
> >              if compat_arch:
> >                  f.write('ISAR_ENABLE_COMPAT_ARCH:amd64 = "1"\n')
> > +                f.write('IMAGE_INSTALL:append:amd64 = " hello-isar-
> compat"\n')
> >                  f.write('ISAR_ENABLE_COMPAT_ARCH:arm64 = "1"\n')
> > +                f.write('IMAGE_INSTALL:append:arm64 = " hello-isar-
> compat"\n')
> >                  f.write('IMAGE_INSTALL += "kselftest"\n')
> >              if cross:
> >                  f.write('ISAR_CROSS_COMPILE = "1"\n')
> 
> This does not oull hello-isar-compat when doing a local build. We likely
> need something in meta-isar/conf/local.conf.sample now.

Ah, it works fine with ISAR_ENABLE_COMPAT_ARCH = "1", but not with
ISAR_ENABLE_COMPAT_ARCH:amd64 = "1". Will have a look.

Currently, that switch is still needed, otherwise the bootstrap
and (s)buildchroot don't get "dpkg --add-architecture <compat-arch>".
I added a check, to report and fail as early as possible if that is missing.

Alternatively we could try to remove ISAR_ENABLE_COMPAT_ARCH completely
and make everything implicit, e.g.:
- have -compat targets depend on a (new) buildchroot-compat
  (or always have compat support in the buildchroot)
- auto-detect (at rootfs creation, when we know which packages we want to
  install) if we need to add the compat arch to the image.
But that would probably mean some bigger changes.

Adriaan

> Jan
> 
> --
> Siemens AG, Technology
> Competence Center Embedded Linux
Schmidt, Adriaan Feb. 6, 2023, 2:22 p.m. UTC | #3
Schmidt, Adriaan, Montag, 6. Februar 2023 14:35:
> Kiszka, Jan (T CED) <jan.kiszka@siemens.com>, 6. Februar 2023 14:01:
> > On 06.02.23 13:20, Adriaan Schmidt wrote:
> > > The compat-arch override is no longer needed, as PACKAGE_ARCH is
> controlled
> > > by DEPENDing on <package>-compat.
> > >
> > > Also change the compat test: adding the compat package now happens via
> > > IMAGE_INSTALL in the config.
> > >
> > > Signed-off-by: Adriaan Schmidt <adriaan.schmidt@siemens.com>
> > > ---
> > >  meta-isar/recipes-app/hello-isar/hello-isar.bb     |  3 ---
> > >  meta-isar/recipes-app/libhello/libhello.bb         |  3 ---
> > >  meta/conf/bitbake.conf                             |  3 +--
> > >  .../recipes-core/isar-bootstrap/isar-bootstrap.inc |  2 ++
> > >  .../sbuild-chroot/sbuild-chroot.inc                | 14 ++++++++------
> > >  testsuite/cibuilder.py                             |  2 ++
> > >  6 files changed, 13 insertions(+), 14 deletions(-)
> > >
> > > diff --git a/meta-isar/recipes-app/hello-isar/hello-isar.bb b/meta-
> > isar/recipes-app/hello-isar/hello-isar.bb
> > > index 39ddecb9..7d9f8322 100644
> > > --- a/meta-isar/recipes-app/hello-isar/hello-isar.bb
> > > +++ b/meta-isar/recipes-app/hello-isar/hello-isar.bb
> > > @@ -20,7 +20,4 @@ SRC_URI = " \
> > >      file://yet-another-change.txt;apply=yes;striplevel=0"
> > >  SRCREV = "a18c14cc11ce6b003f3469e89223cffb4016861d"
> > >
> > > -# NOTE: This is just to test 32-bit building on 64-bit archs.
> > > -PACKAGE_ARCH:compat-arch = "${COMPAT_DISTRO_ARCH}"
> > > -
> > >  inherit dpkg
> > > diff --git a/meta-isar/recipes-app/libhello/libhello.bb b/meta-
> > isar/recipes-app/libhello/libhello.bb
> > > index 3770fdb4..8b10842f 100644
> > > --- a/meta-isar/recipes-app/libhello/libhello.bb
> > > +++ b/meta-isar/recipes-app/libhello/libhello.bb
> > > @@ -13,7 +13,4 @@ PV = "0.1-98f2e41"
> > >  SRC_URI =
> >
> "git://github.com/ilbers/libhello.git;protocol=https;branch=master;destsuffix
> > =${P}"
> > >  SRCREV = "98f2e41e7d05ab8d19b0c5d160b104b725c8fd93"
> > >
> > > -# NOTE: This is just to test 32-bit building on 64-bit archs.
> > > -PACKAGE_ARCH:compat-arch = "${COMPAT_DISTRO_ARCH}"
> > > -
> > >  inherit dpkg
> > > diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
> > > index f38bb447..1f010f4b 100644
> > > --- a/meta/conf/bitbake.conf
> > > +++ b/meta/conf/bitbake.conf
> > > @@ -67,9 +67,8 @@ KERNEL_FILE:mipsel ?= "vmlinux"
> > >  KERNEL_FILE:riscv64 ?= "vmlinux"
> > >  KERNEL_FILE:arm64 ?= "vmlinux"
> > >
> > > -OVERRIDES =
> >
> "${PACKAGE_ARCH}:${COMPAT_OVERRIDE}:${MACHINE}:${DISTRO}:${BASE_DISTRO_CODENA
> > ME}:forcevariable"
> > > +OVERRIDES =
> >
> "${PACKAGE_ARCH}:${MACHINE}:${DISTRO}:${BASE_DISTRO_CODENAME}:forcevariable"
> > >  FILESOVERRIDES = "${PACKAGE_ARCH}:${MACHINE}"
> > > -COMPAT_OVERRIDE = "${@'compat-arch' if
> d.getVar('ISAR_ENABLE_COMPAT_ARCH')
> > == '1' else ''}"
> > >
> > >  # Setting default QEMU_ARCH variables for different DISTRO_ARCH:
> > >  QEMU_ARCH:amd64 = "x86_64"
> > > diff --git a/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc
> > b/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc
> > > index 99d75e21..21a2d92f 100644
> > > --- a/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc
> > > +++ b/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc
> > > @@ -274,6 +274,8 @@ do_bootstrap[dirs] = "${DEPLOY_DIR_BOOTSTRAP}"
> > >  do_bootstrap[depends] = "base-apt:do_cache isar-apt:do_cache_config"
> > >  do_bootstrap[network] = "${TASK_USE_NETWORK_AND_SUDO}"
> > >
> > > +inherit compat
> > > +
> > >  do_bootstrap() {
> > >      if [ "${ISAR_ENABLE_COMPAT_ARCH}" = "1" ]; then
> > >          if [ -z "${COMPAT_DISTRO_ARCH}" ]; then
> > > diff --git a/meta/recipes-devtools/sbuild-chroot/sbuild-chroot.inc
> > b/meta/recipes-devtools/sbuild-chroot/sbuild-chroot.inc
> > > index fb061dac..fd8bb648 100644
> > > --- a/meta/recipes-devtools/sbuild-chroot/sbuild-chroot.inc
> > > +++ b/meta/recipes-devtools/sbuild-chroot/sbuild-chroot.inc
> > > @@ -9,6 +9,7 @@ LIC_FILES_CHKSUM =
> > "file://${LAYERDIR_core}/licenses/COPYING.GPLv2;md5=751419260
> > >  PV = "1.0"
> > >
> > >  inherit rootfs
> > > +inherit compat
> > >
> > >  python() {
> > >      distro_gcc = d.getVar('DISTRO_GCC')
> > > @@ -20,18 +21,19 @@ python() {
> > >          d.appendVar('SBUILD_CHROOT_PREINSTALL_COMMON',
> > >                      ' libstdc++-{}-dev:{}'.format(distro_gcc,
> > distro_arch))
> > >
> > > -        if d.getVar('ISAR_ENABLE_COMPAT_ARCH') == '1':
> > > -            compat_arch = d.getVar('COMPAT_DISTRO_ARCH')
> > > +    if d.getVar('ISAR_ENABLE_COMPAT_ARCH') == '1':
> > > +        compat_arch = d.getVar('COMPAT_DISTRO_ARCH')
> > > +        d.appendVar('SBUILD_CHROOT_COMPAT_PREINSTALL',
> > > +                    ' libc6-dev:{}'.format(compat_arch))
> > > +        d.appendVar('SBUILD_CHROOT_COMPAT_PREINSTALL',
> > > +                    ' crossbuild-essential-{}'.format(compat_arch))
> > > +        if d.getVar('DISTRO_GCC'):
> > >              d.appendVar('SBUILD_CHROOT_COMPAT_PREINSTALL',
> > >                          ' libgcc-{}-dev:{}'.format(distro_gcc,
> > compat_arch))
> > >              d.appendVar('SBUILD_CHROOT_COMPAT_PREINSTALL',
> > >                          ' libstdc++-{}-dev:{}'.format(distro_gcc,
> > compat_arch))
> > >  }
> > >
> > > -SBUILD_CHROOT_COMPAT_PREINSTALL:compat-arch = " \
> > > -    libc6-dev:${COMPAT_DISTRO_ARCH} \
> > > -    crossbuild-essential-${COMPAT_DISTRO_ARCH}"
> > > -
> > >  SBUILD_CHROOT_PREINSTALL_COMMON = " \
> > >      ${SBUILD_CHROOT_COMPAT_PREINSTALL} \
> > >      libc6-dev:${DISTRO_ARCH} \
> > > diff --git a/testsuite/cibuilder.py b/testsuite/cibuilder.py
> > > index 9d1b80f7..0b68e87d 100755
> > > --- a/testsuite/cibuilder.py
> > > +++ b/testsuite/cibuilder.py
> > > @@ -92,7 +92,9 @@ class CIBuilder(Test):
> > >          with open(self.build_dir + '/conf/ci_build.conf', 'w') as f:
> > >              if compat_arch:
> > >                  f.write('ISAR_ENABLE_COMPAT_ARCH:amd64 = "1"\n')
> > > +                f.write('IMAGE_INSTALL:append:amd64 = " hello-isar-
> > compat"\n')
> > >                  f.write('ISAR_ENABLE_COMPAT_ARCH:arm64 = "1"\n')
> > > +                f.write('IMAGE_INSTALL:append:arm64 = " hello-isar-
> > compat"\n')
> > >                  f.write('IMAGE_INSTALL += "kselftest"\n')
> > >              if cross:
> > >                  f.write('ISAR_CROSS_COMPILE = "1"\n')
> >
> > This does not oull hello-isar-compat when doing a local build. We likely
> > need something in meta-isar/conf/local.conf.sample now.
> 
> Ah, it works fine with ISAR_ENABLE_COMPAT_ARCH = "1", but not with
> ISAR_ENABLE_COMPAT_ARCH:amd64 = "1". Will have a look.

Found it! Next iteration will fix this.
Until then, for manual testing, please set ISAR_ENABLE_COMPAT_ARCH without
any overrides.

Adriaan

> Currently, that switch is still needed, otherwise the bootstrap
> and (s)buildchroot don't get "dpkg --add-architecture <compat-arch>".
> I added a check, to report and fail as early as possible if that is missing.
> 
> Alternatively we could try to remove ISAR_ENABLE_COMPAT_ARCH completely
> and make everything implicit, e.g.:
> - have -compat targets depend on a (new) buildchroot-compat
>   (or always have compat support in the buildchroot)
> - auto-detect (at rootfs creation, when we know which packages we want to
>   install) if we need to add the compat arch to the image.
> But that would probably mean some bigger changes.
> 
> Adriaan
> 
> > Jan
> >
> > --
> > Siemens AG, Technology
> > Competence Center Embedded Linux
> 
> --
> 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/AS4PR10MB53186E063C75CC2428C3C1CAEDDA9%40AS4PR10MB5318.EURPRD10.PROD.OU
> TLOOK.COM.

Patch

diff --git a/meta-isar/recipes-app/hello-isar/hello-isar.bb b/meta-isar/recipes-app/hello-isar/hello-isar.bb
index 39ddecb9..7d9f8322 100644
--- a/meta-isar/recipes-app/hello-isar/hello-isar.bb
+++ b/meta-isar/recipes-app/hello-isar/hello-isar.bb
@@ -20,7 +20,4 @@  SRC_URI = " \
     file://yet-another-change.txt;apply=yes;striplevel=0"
 SRCREV = "a18c14cc11ce6b003f3469e89223cffb4016861d"
 
-# NOTE: This is just to test 32-bit building on 64-bit archs.
-PACKAGE_ARCH:compat-arch = "${COMPAT_DISTRO_ARCH}"
-
 inherit dpkg
diff --git a/meta-isar/recipes-app/libhello/libhello.bb b/meta-isar/recipes-app/libhello/libhello.bb
index 3770fdb4..8b10842f 100644
--- a/meta-isar/recipes-app/libhello/libhello.bb
+++ b/meta-isar/recipes-app/libhello/libhello.bb
@@ -13,7 +13,4 @@  PV = "0.1-98f2e41"
 SRC_URI = "git://github.com/ilbers/libhello.git;protocol=https;branch=master;destsuffix=${P}"
 SRCREV = "98f2e41e7d05ab8d19b0c5d160b104b725c8fd93"
 
-# NOTE: This is just to test 32-bit building on 64-bit archs.
-PACKAGE_ARCH:compat-arch = "${COMPAT_DISTRO_ARCH}"
-
 inherit dpkg
diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index f38bb447..1f010f4b 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -67,9 +67,8 @@  KERNEL_FILE:mipsel ?= "vmlinux"
 KERNEL_FILE:riscv64 ?= "vmlinux"
 KERNEL_FILE:arm64 ?= "vmlinux"
 
-OVERRIDES = "${PACKAGE_ARCH}:${COMPAT_OVERRIDE}:${MACHINE}:${DISTRO}:${BASE_DISTRO_CODENAME}:forcevariable"
+OVERRIDES = "${PACKAGE_ARCH}:${MACHINE}:${DISTRO}:${BASE_DISTRO_CODENAME}:forcevariable"
 FILESOVERRIDES = "${PACKAGE_ARCH}:${MACHINE}"
-COMPAT_OVERRIDE = "${@'compat-arch' if d.getVar('ISAR_ENABLE_COMPAT_ARCH') == '1' else ''}"
 
 # Setting default QEMU_ARCH variables for different DISTRO_ARCH:
 QEMU_ARCH:amd64 = "x86_64"
diff --git a/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc b/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc
index 99d75e21..21a2d92f 100644
--- a/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc
+++ b/meta/recipes-core/isar-bootstrap/isar-bootstrap.inc
@@ -274,6 +274,8 @@  do_bootstrap[dirs] = "${DEPLOY_DIR_BOOTSTRAP}"
 do_bootstrap[depends] = "base-apt:do_cache isar-apt:do_cache_config"
 do_bootstrap[network] = "${TASK_USE_NETWORK_AND_SUDO}"
 
+inherit compat
+
 do_bootstrap() {
     if [ "${ISAR_ENABLE_COMPAT_ARCH}" = "1" ]; then
         if [ -z "${COMPAT_DISTRO_ARCH}" ]; then
diff --git a/meta/recipes-devtools/sbuild-chroot/sbuild-chroot.inc b/meta/recipes-devtools/sbuild-chroot/sbuild-chroot.inc
index fb061dac..fd8bb648 100644
--- a/meta/recipes-devtools/sbuild-chroot/sbuild-chroot.inc
+++ b/meta/recipes-devtools/sbuild-chroot/sbuild-chroot.inc
@@ -9,6 +9,7 @@  LIC_FILES_CHKSUM = "file://${LAYERDIR_core}/licenses/COPYING.GPLv2;md5=751419260
 PV = "1.0"
 
 inherit rootfs
+inherit compat
 
 python() {
     distro_gcc = d.getVar('DISTRO_GCC')
@@ -20,18 +21,19 @@  python() {
         d.appendVar('SBUILD_CHROOT_PREINSTALL_COMMON',
                     ' libstdc++-{}-dev:{}'.format(distro_gcc, distro_arch))
 
-        if d.getVar('ISAR_ENABLE_COMPAT_ARCH') == '1':
-            compat_arch = d.getVar('COMPAT_DISTRO_ARCH')
+    if d.getVar('ISAR_ENABLE_COMPAT_ARCH') == '1':
+        compat_arch = d.getVar('COMPAT_DISTRO_ARCH')
+        d.appendVar('SBUILD_CHROOT_COMPAT_PREINSTALL',
+                    ' libc6-dev:{}'.format(compat_arch))
+        d.appendVar('SBUILD_CHROOT_COMPAT_PREINSTALL',
+                    ' crossbuild-essential-{}'.format(compat_arch))
+        if d.getVar('DISTRO_GCC'):
             d.appendVar('SBUILD_CHROOT_COMPAT_PREINSTALL',
                         ' libgcc-{}-dev:{}'.format(distro_gcc, compat_arch))
             d.appendVar('SBUILD_CHROOT_COMPAT_PREINSTALL',
                         ' libstdc++-{}-dev:{}'.format(distro_gcc, compat_arch))
 }
 
-SBUILD_CHROOT_COMPAT_PREINSTALL:compat-arch = " \
-    libc6-dev:${COMPAT_DISTRO_ARCH} \
-    crossbuild-essential-${COMPAT_DISTRO_ARCH}"
-
 SBUILD_CHROOT_PREINSTALL_COMMON = " \
     ${SBUILD_CHROOT_COMPAT_PREINSTALL} \
     libc6-dev:${DISTRO_ARCH} \
diff --git a/testsuite/cibuilder.py b/testsuite/cibuilder.py
index 9d1b80f7..0b68e87d 100755
--- a/testsuite/cibuilder.py
+++ b/testsuite/cibuilder.py
@@ -92,7 +92,9 @@  class CIBuilder(Test):
         with open(self.build_dir + '/conf/ci_build.conf', 'w') as f:
             if compat_arch:
                 f.write('ISAR_ENABLE_COMPAT_ARCH:amd64 = "1"\n')
+                f.write('IMAGE_INSTALL:append:amd64 = " hello-isar-compat"\n')
                 f.write('ISAR_ENABLE_COMPAT_ARCH:arm64 = "1"\n')
+                f.write('IMAGE_INSTALL:append:arm64 = " hello-isar-compat"\n')
                 f.write('IMAGE_INSTALL += "kselftest"\n')
             if cross:
                 f.write('ISAR_CROSS_COMPILE = "1"\n')