[v2] debianize: use debhelper-compat to generate compat file

Message ID 20240201101236.3555681-1-Quirin.Gylstorff@siemens.com
State Accepted, archived
Headers show
Series [v2] debianize: use debhelper-compat to generate compat file | expand

Commit Message

Quirin Gylstorff Feb. 1, 2024, 10:12 a.m. UTC
From: Quirin Gylstorff <quirin.gylstorff@siemens.com>

debhelper supports the versions debhelper-compat (= 9) till
debhelper-compat (= 13).

This patch also adds the variable `DEBIAN_COMPAT` to set the compat
to the desired version.

Signed-off-by: Quirin Gylstorff <quirin.gylstorff@siemens.com>
---
 meta-isar/conf/distro/raspios-bullseye.conf |  2 ++
 meta-isar/conf/distro/ubuntu-focal.conf     |  2 ++
 meta-isar/conf/distro/ubuntu-jammy.conf     |  2 ++
 meta/classes/debianize.bbclass              | 13 ++-----------
 meta/conf/distro/debian-bookworm.conf       |  2 ++
 meta/conf/distro/debian-bullseye.conf       |  2 ++
 meta/conf/distro/debian-buster.conf         |  2 ++
 meta/conf/distro/debian-sid-ports.conf      |  2 ++
 meta/conf/distro/debian-sid.conf            |  2 ++
 9 files changed, 18 insertions(+), 11 deletions(-)

Comments

MOESSBAUER, Felix Feb. 15, 2024, 8:37 a.m. UTC | #1
On Thu, 2024-02-01 at 11:12 +0100, Quirin Gylstorff wrote:
> From: Quirin Gylstorff <quirin.gylstorff@siemens.com>
> 
> debhelper supports the versions debhelper-compat (= 9) till
> debhelper-compat (= 13).
> 
> This patch also adds the variable `DEBIAN_COMPAT` to set the compat
> to the desired version.

This patch would simplify many downstream recipes as we automatically
get the right compat level.

Acked-by: Felix Moessbauer <felix.moessbauer@siemens.com>

Felix

> 
> Signed-off-by: Quirin Gylstorff <quirin.gylstorff@siemens.com>
> ---
>  meta-isar/conf/distro/raspios-bullseye.conf |  2 ++
>  meta-isar/conf/distro/ubuntu-focal.conf     |  2 ++
>  meta-isar/conf/distro/ubuntu-jammy.conf     |  2 ++
>  meta/classes/debianize.bbclass              | 13 ++-----------
>  meta/conf/distro/debian-bookworm.conf       |  2 ++
>  meta/conf/distro/debian-bullseye.conf       |  2 ++
>  meta/conf/distro/debian-buster.conf         |  2 ++
>  meta/conf/distro/debian-sid-ports.conf      |  2 ++
>  meta/conf/distro/debian-sid.conf            |  2 ++
>  9 files changed, 18 insertions(+), 11 deletions(-)
> 
> diff --git a/meta-isar/conf/distro/raspios-bullseye.conf b/meta-
> isar/conf/distro/raspios-bullseye.conf
> index cc64a015..2515f0fd 100644
> --- a/meta-isar/conf/distro/raspios-bullseye.conf
> +++ b/meta-isar/conf/distro/raspios-bullseye.conf
> @@ -25,3 +25,5 @@ THIRD_PARTY_APT_KEYS +=
> "http://archive.raspberrypi.org/debian/raspberrypi.gpg.k
>  COMPAT_DISTRO_ARCH:arm64 = "armhf"
>  
>  DISTRO_GCC = "10"
> +
> +DEBIAN_COMPAT = "13"
> diff --git a/meta-isar/conf/distro/ubuntu-focal.conf b/meta-
> isar/conf/distro/ubuntu-focal.conf
> index 7b400bc7..81728dec 100644
> --- a/meta-isar/conf/distro/ubuntu-focal.conf
> +++ b/meta-isar/conf/distro/ubuntu-focal.conf
> @@ -8,3 +8,5 @@ require conf/distro/ubuntu-common.inc
>  BASE_DISTRO_CODENAME = "focal"
>  
>  DISTRO_GCC = "9"
> +
> +DEBIAN_COMPAT = "12"
> diff --git a/meta-isar/conf/distro/ubuntu-jammy.conf b/meta-
> isar/conf/distro/ubuntu-jammy.conf
> index ce6ae511..afc4a731 100644
> --- a/meta-isar/conf/distro/ubuntu-jammy.conf
> +++ b/meta-isar/conf/distro/ubuntu-jammy.conf
> @@ -8,3 +8,5 @@ require conf/distro/ubuntu-common.inc
>  BASE_DISTRO_CODENAME = "jammy"
>  
>  DISTRO_GCC = "11"
> +
> +DEBIAN_COMPAT = "13"
> diff --git a/meta/classes/debianize.bbclass
> b/meta/classes/debianize.bbclass
> index 16f3638d..7de98673 100644
> --- a/meta/classes/debianize.bbclass
> +++ b/meta/classes/debianize.bbclass
> @@ -10,6 +10,7 @@ DEBIAN_BUILD_DEPENDS ??= ""
>  DEBIAN_DEPENDS ??= ""
>  DEBIAN_CONFLICTS ??= ""
>  DEBIAN_MULTI_ARCH ??= "no"
> +DEBIAN_COMPAT ??= "10"
>  DESCRIPTION ??= "must not be empty"
>  MAINTAINER ??= "Unknown maintainer <unknown@example.com>"
>  
> @@ -60,19 +61,15 @@ EOF
>         fi
>  }
>  
> -deb_create_compat() {
> -       echo 10 > ${S}/debian/compat
> -}
>  
>  deb_create_control() {
> -       compat=$( cat ${S}/debian/compat )
>         cat << EOF > ${S}/debian/control
>  Source: ${BPN}
>  Section: misc
>  Priority: optional
>  Standards-Version: 3.9.6
>  Maintainer: ${MAINTAINER}
> -Build-Depends: debhelper (>= ${compat}), ${DEBIAN_BUILD_DEPENDS}
> +Build-Depends: debhelper-compat (= ${DEBIAN_COMPAT}),
> ${DEBIAN_BUILD_DEPENDS}
>  
>  Package: ${BPN}
>  Architecture: ${DPKG_ARCH}
> @@ -103,12 +100,6 @@ EOF
>  deb_debianize() {
>         install -m 755 -d ${S}/debian
>  
> -       # create the compat-file if there is no file with that name
> in WORKDIR
> -       if [ -f ${WORKDIR}/compat ]; then
> -               install -v -m 644 ${WORKDIR}/compat
> ${S}/debian/compat
> -       else
> -               deb_create_compat
> -       fi
>         # create the control-file if there is no control-file in
> WORKDIR
>         if [ -f ${WORKDIR}/control ]; then
>                 install -v -m 644 ${WORKDIR}/control
> ${S}/debian/control
> diff --git a/meta/conf/distro/debian-bookworm.conf
> b/meta/conf/distro/debian-bookworm.conf
> index d0599dc6..ce7279e3 100644
> --- a/meta/conf/distro/debian-bookworm.conf
> +++ b/meta/conf/distro/debian-bookworm.conf
> @@ -15,3 +15,5 @@ DISTRO_KERNELS ?= "4kc-malta 5kc-malta 686-pae 686
> alpha-generic alpha-smp \
>         s390x sh7751r sh7785lcr sparc64-smp sparc64"
>  
>  DISTRO_GCC = "12"
> +
> +DEBIAN_COMPAT = "13"
> diff --git a/meta/conf/distro/debian-bullseye.conf
> b/meta/conf/distro/debian-bullseye.conf
> index 9b76e68a..2cb9d20e 100644
> --- a/meta/conf/distro/debian-bullseye.conf
> +++ b/meta/conf/distro/debian-bullseye.conf
> @@ -12,3 +12,5 @@ DISTRO_KERNELS ?= "4kc-malta 5kc-malta 686 686-pae
> amd64 arm64 armmp \
>      rt-686-pae rt-amd64 rt-arm64 rt-armmp"
>  
>  DISTRO_GCC = "10"
> +
> +DEBIAN_COMPAT = "13"
> diff --git a/meta/conf/distro/debian-buster.conf
> b/meta/conf/distro/debian-buster.conf
> index 025fc936..57cfac33 100644
> --- a/meta/conf/distro/debian-buster.conf
> +++ b/meta/conf/distro/debian-buster.conf
> @@ -12,3 +12,5 @@ DISTRO_KERNELS ?= "4kc-malta 5kc-malta 686 686-pae
> amd64 arm64 armmp \
>      rt-686-pae rt-amd64 rt-arm64 rt-armmp"
>  
>  DISTRO_GCC = "8"
> +
> +DEBIAN_COMPAT = "12"
> diff --git a/meta/conf/distro/debian-sid-ports.conf
> b/meta/conf/distro/debian-sid-ports.conf
> index f045a3f2..64f3717e 100644
> --- a/meta/conf/distro/debian-sid-ports.conf
> +++ b/meta/conf/distro/debian-sid-ports.conf
> @@ -25,3 +25,5 @@ THIRD_PARTY_APT_KEYS += "${DEBIAN_PORTS_KEYS}"
>  IMAGE_PREINSTALL += "init"
>  
>  IMAGER_INSTALL:wic += "python3-distutils"
> +
> +DEBIAN_COMPAT = "13"
> diff --git a/meta/conf/distro/debian-sid.conf
> b/meta/conf/distro/debian-sid.conf
> index 631f9b5a..fdf9775c 100644
> --- a/meta/conf/distro/debian-sid.conf
> +++ b/meta/conf/distro/debian-sid.conf
> @@ -19,3 +19,5 @@ DISTRO_KERNELS ?= "4kc-malta 5kc-malta 686-pae 686
> alpha-generic alpha-smp \
>         s390x sh7751r sh7785lcr sparc64-smp sparc64"
>  
>  DISTRO_GCC = "13"
> +
> +DEBIAN_COMPAT = "13"
Uladzimir Bely Feb. 16, 2024, 6:12 a.m. UTC | #2
On Thu, 2024-02-01 at 11:12 +0100, 'Quirin Gylstorff' via isar-users
wrote:
> From: Quirin Gylstorff <quirin.gylstorff@siemens.com>
> 
> debhelper supports the versions debhelper-compat (= 9) till
> debhelper-compat (= 13).
> 
> This patch also adds the variable `DEBIAN_COMPAT` to set the compat
> to the desired version.
> 
> Signed-off-by: Quirin Gylstorff <quirin.gylstorff@siemens.com>
> ---
>  meta-isar/conf/distro/raspios-bullseye.conf |  2 ++
>  meta-isar/conf/distro/ubuntu-focal.conf     |  2 ++
>  meta-isar/conf/distro/ubuntu-jammy.conf     |  2 ++
>  meta/classes/debianize.bbclass              | 13 ++-----------
>  meta/conf/distro/debian-bookworm.conf       |  2 ++
>  meta/conf/distro/debian-bullseye.conf       |  2 ++
>  meta/conf/distro/debian-buster.conf         |  2 ++
>  meta/conf/distro/debian-sid-ports.conf      |  2 ++
>  meta/conf/distro/debian-sid.conf            |  2 ++
>  9 files changed, 18 insertions(+), 11 deletions(-)

Applied to next, thanks.
Jan Kiszka Feb. 20, 2024, 7:07 p.m. UTC | #3
On 01.02.24 11:12, 'Quirin Gylstorff' via isar-users wrote:
> From: Quirin Gylstorff <quirin.gylstorff@siemens.com>
> 
> debhelper supports the versions debhelper-compat (= 9) till
> debhelper-compat (= 13).
> 
> This patch also adds the variable `DEBIAN_COMPAT` to set the compat
> to the desired version.
> 
> Signed-off-by: Quirin Gylstorff <quirin.gylstorff@siemens.com>
> ---
>  meta-isar/conf/distro/raspios-bullseye.conf |  2 ++
>  meta-isar/conf/distro/ubuntu-focal.conf     |  2 ++
>  meta-isar/conf/distro/ubuntu-jammy.conf     |  2 ++
>  meta/classes/debianize.bbclass              | 13 ++-----------
>  meta/conf/distro/debian-bookworm.conf       |  2 ++
>  meta/conf/distro/debian-bullseye.conf       |  2 ++
>  meta/conf/distro/debian-buster.conf         |  2 ++
>  meta/conf/distro/debian-sid-ports.conf      |  2 ++
>  meta/conf/distro/debian-sid.conf            |  2 ++
>  9 files changed, 18 insertions(+), 11 deletions(-)
> 
> diff --git a/meta-isar/conf/distro/raspios-bullseye.conf b/meta-isar/conf/distro/raspios-bullseye.conf
> index cc64a015..2515f0fd 100644
> --- a/meta-isar/conf/distro/raspios-bullseye.conf
> +++ b/meta-isar/conf/distro/raspios-bullseye.conf
> @@ -25,3 +25,5 @@ THIRD_PARTY_APT_KEYS += "http://archive.raspberrypi.org/debian/raspberrypi.gpg.k
>  COMPAT_DISTRO_ARCH:arm64 = "armhf"
>  
>  DISTRO_GCC = "10"
> +
> +DEBIAN_COMPAT = "13"
> diff --git a/meta-isar/conf/distro/ubuntu-focal.conf b/meta-isar/conf/distro/ubuntu-focal.conf
> index 7b400bc7..81728dec 100644
> --- a/meta-isar/conf/distro/ubuntu-focal.conf
> +++ b/meta-isar/conf/distro/ubuntu-focal.conf
> @@ -8,3 +8,5 @@ require conf/distro/ubuntu-common.inc
>  BASE_DISTRO_CODENAME = "focal"
>  
>  DISTRO_GCC = "9"
> +
> +DEBIAN_COMPAT = "12"
> diff --git a/meta-isar/conf/distro/ubuntu-jammy.conf b/meta-isar/conf/distro/ubuntu-jammy.conf
> index ce6ae511..afc4a731 100644
> --- a/meta-isar/conf/distro/ubuntu-jammy.conf
> +++ b/meta-isar/conf/distro/ubuntu-jammy.conf
> @@ -8,3 +8,5 @@ require conf/distro/ubuntu-common.inc
>  BASE_DISTRO_CODENAME = "jammy"
>  
>  DISTRO_GCC = "11"
> +
> +DEBIAN_COMPAT = "13"
> diff --git a/meta/classes/debianize.bbclass b/meta/classes/debianize.bbclass
> index 16f3638d..7de98673 100644
> --- a/meta/classes/debianize.bbclass
> +++ b/meta/classes/debianize.bbclass
> @@ -10,6 +10,7 @@ DEBIAN_BUILD_DEPENDS ??= ""
>  DEBIAN_DEPENDS ??= ""
>  DEBIAN_CONFLICTS ??= ""
>  DEBIAN_MULTI_ARCH ??= "no"
> +DEBIAN_COMPAT ??= "10"
>  DESCRIPTION ??= "must not be empty"
>  MAINTAINER ??= "Unknown maintainer <unknown@example.com>"
>  
> @@ -60,19 +61,15 @@ EOF
>  	fi
>  }
>  
> -deb_create_compat() {
> -	echo 10 > ${S}/debian/compat
> -}

Surprise, surprise: This is a recipe API change that can break users 
[1]! Please document.

Jan

[1] https://gitlab.com/cip-project/cip-core/isar-cip-core/-/blob/1f1af2a6a6db78c2b3363b90a920526129269d19/recipes-core/ltp/ltp.inc#L23
Florian Bezdeka April 17, 2024, 9 a.m. UTC | #4
Hi all,

[CC: Clara]

On Thu, 2024-02-01 at 11:12 +0100, 'Quirin Gylstorff' via isar-users
wrote:
> From: Quirin Gylstorff <quirin.gylstorff@siemens.com>
> 
> debhelper supports the versions debhelper-compat (= 9) till
> debhelper-compat (= 13).
> 
> This patch also adds the variable `DEBIAN_COMPAT` to set the compat
> to the desired version.

This introduces a regression. We are no longer able to build the rpi-
firmware with that patch applied.

Seems there are more side effects switching from debhelper to
debhelper-compat.

In our case something with the dh_dwz step goes wrong. TheELF file
generated during build is no longer "recognized", or as a file with
wrong input format. Clara can provide more information / logs if
necessary.

I have no solution/fix right now. As this is clearly a regression we
should consider reverting.

Best regards,
Florian

> 
> Signed-off-by: Quirin Gylstorff <quirin.gylstorff@siemens.com>
> ---
>  meta-isar/conf/distro/raspios-bullseye.conf |  2 ++
>  meta-isar/conf/distro/ubuntu-focal.conf     |  2 ++
>  meta-isar/conf/distro/ubuntu-jammy.conf     |  2 ++
>  meta/classes/debianize.bbclass              | 13 ++-----------
>  meta/conf/distro/debian-bookworm.conf       |  2 ++
>  meta/conf/distro/debian-bullseye.conf       |  2 ++
>  meta/conf/distro/debian-buster.conf         |  2 ++
>  meta/conf/distro/debian-sid-ports.conf      |  2 ++
>  meta/conf/distro/debian-sid.conf            |  2 ++
>  9 files changed, 18 insertions(+), 11 deletions(-)
> 
> diff --git a/meta-isar/conf/distro/raspios-bullseye.conf b/meta-isar/conf/distro/raspios-bullseye.conf
> index cc64a015..2515f0fd 100644
> --- a/meta-isar/conf/distro/raspios-bullseye.conf
> +++ b/meta-isar/conf/distro/raspios-bullseye.conf
> @@ -25,3 +25,5 @@ THIRD_PARTY_APT_KEYS += "http://archive.raspberrypi.org/debian/raspberrypi.gpg.k
>  COMPAT_DISTRO_ARCH:arm64 = "armhf"
>  
>  DISTRO_GCC = "10"
> +
> +DEBIAN_COMPAT = "13"
> diff --git a/meta-isar/conf/distro/ubuntu-focal.conf b/meta-isar/conf/distro/ubuntu-focal.conf
> index 7b400bc7..81728dec 100644
> --- a/meta-isar/conf/distro/ubuntu-focal.conf
> +++ b/meta-isar/conf/distro/ubuntu-focal.conf
> @@ -8,3 +8,5 @@ require conf/distro/ubuntu-common.inc
>  BASE_DISTRO_CODENAME = "focal"
>  
>  DISTRO_GCC = "9"
> +
> +DEBIAN_COMPAT = "12"
> diff --git a/meta-isar/conf/distro/ubuntu-jammy.conf b/meta-isar/conf/distro/ubuntu-jammy.conf
> index ce6ae511..afc4a731 100644
> --- a/meta-isar/conf/distro/ubuntu-jammy.conf
> +++ b/meta-isar/conf/distro/ubuntu-jammy.conf
> @@ -8,3 +8,5 @@ require conf/distro/ubuntu-common.inc
>  BASE_DISTRO_CODENAME = "jammy"
>  
>  DISTRO_GCC = "11"
> +
> +DEBIAN_COMPAT = "13"
> diff --git a/meta/classes/debianize.bbclass b/meta/classes/debianize.bbclass
> index 16f3638d..7de98673 100644
> --- a/meta/classes/debianize.bbclass
> +++ b/meta/classes/debianize.bbclass
> @@ -10,6 +10,7 @@ DEBIAN_BUILD_DEPENDS ??= ""
>  DEBIAN_DEPENDS ??= ""
>  DEBIAN_CONFLICTS ??= ""
>  DEBIAN_MULTI_ARCH ??= "no"
> +DEBIAN_COMPAT ??= "10"
>  DESCRIPTION ??= "must not be empty"
>  MAINTAINER ??= "Unknown maintainer <unknown@example.com>"
>  
> @@ -60,19 +61,15 @@ EOF
>  	fi
>  }
>  
> -deb_create_compat() {
> -	echo 10 > ${S}/debian/compat
> -}
>  
>  deb_create_control() {
> -	compat=$( cat ${S}/debian/compat )
>  	cat << EOF > ${S}/debian/control
>  Source: ${BPN}
>  Section: misc
>  Priority: optional
>  Standards-Version: 3.9.6
>  Maintainer: ${MAINTAINER}
> -Build-Depends: debhelper (>= ${compat}), ${DEBIAN_BUILD_DEPENDS}
> +Build-Depends: debhelper-compat (= ${DEBIAN_COMPAT}), ${DEBIAN_BUILD_DEPENDS}
>  
>  Package: ${BPN}
>  Architecture: ${DPKG_ARCH}
> @@ -103,12 +100,6 @@ EOF
>  deb_debianize() {
>  	install -m 755 -d ${S}/debian
>  
> -	# create the compat-file if there is no file with that name in WORKDIR
> -	if [ -f ${WORKDIR}/compat ]; then
> -		install -v -m 644 ${WORKDIR}/compat ${S}/debian/compat
> -	else
> -		deb_create_compat
> -	fi
>  	# create the control-file if there is no control-file in WORKDIR
>  	if [ -f ${WORKDIR}/control ]; then
>  		install -v -m 644 ${WORKDIR}/control ${S}/debian/control
> diff --git a/meta/conf/distro/debian-bookworm.conf b/meta/conf/distro/debian-bookworm.conf
> index d0599dc6..ce7279e3 100644
> --- a/meta/conf/distro/debian-bookworm.conf
> +++ b/meta/conf/distro/debian-bookworm.conf
> @@ -15,3 +15,5 @@ DISTRO_KERNELS ?= "4kc-malta 5kc-malta 686-pae 686 alpha-generic alpha-smp \
>  	s390x sh7751r sh7785lcr sparc64-smp sparc64"
>  
>  DISTRO_GCC = "12"
> +
> +DEBIAN_COMPAT = "13"
> diff --git a/meta/conf/distro/debian-bullseye.conf b/meta/conf/distro/debian-bullseye.conf
> index 9b76e68a..2cb9d20e 100644
> --- a/meta/conf/distro/debian-bullseye.conf
> +++ b/meta/conf/distro/debian-bullseye.conf
> @@ -12,3 +12,5 @@ DISTRO_KERNELS ?= "4kc-malta 5kc-malta 686 686-pae amd64 arm64 armmp \
>      rt-686-pae rt-amd64 rt-arm64 rt-armmp"
>  
>  DISTRO_GCC = "10"
> +
> +DEBIAN_COMPAT = "13"
> diff --git a/meta/conf/distro/debian-buster.conf b/meta/conf/distro/debian-buster.conf
> index 025fc936..57cfac33 100644
> --- a/meta/conf/distro/debian-buster.conf
> +++ b/meta/conf/distro/debian-buster.conf
> @@ -12,3 +12,5 @@ DISTRO_KERNELS ?= "4kc-malta 5kc-malta 686 686-pae amd64 arm64 armmp \
>      rt-686-pae rt-amd64 rt-arm64 rt-armmp"
>  
>  DISTRO_GCC = "8"
> +
> +DEBIAN_COMPAT = "12"
> diff --git a/meta/conf/distro/debian-sid-ports.conf b/meta/conf/distro/debian-sid-ports.conf
> index f045a3f2..64f3717e 100644
> --- a/meta/conf/distro/debian-sid-ports.conf
> +++ b/meta/conf/distro/debian-sid-ports.conf
> @@ -25,3 +25,5 @@ THIRD_PARTY_APT_KEYS += "${DEBIAN_PORTS_KEYS}"
>  IMAGE_PREINSTALL += "init"
>  
>  IMAGER_INSTALL:wic += "python3-distutils"
> +
> +DEBIAN_COMPAT = "13"
> diff --git a/meta/conf/distro/debian-sid.conf b/meta/conf/distro/debian-sid.conf
> index 631f9b5a..fdf9775c 100644
> --- a/meta/conf/distro/debian-sid.conf
> +++ b/meta/conf/distro/debian-sid.conf
> @@ -19,3 +19,5 @@ DISTRO_KERNELS ?= "4kc-malta 5kc-malta 686-pae 686 alpha-generic alpha-smp \
>  	s390x sh7751r sh7785lcr sparc64-smp sparc64"
>  
>  DISTRO_GCC = "13"
> +
> +DEBIAN_COMPAT = "13"
> -- 
> 2.43.0
MOESSBAUER, Felix April 17, 2024, 9:16 p.m. UTC | #5
On Wed, 2024-04-17 at 11:00 +0200, Florian Bezdeka wrote:
> Hi all,
> 
> [CC: Clara]
> 
> On Thu, 2024-02-01 at 11:12 +0100, 'Quirin Gylstorff' via isar-users
> wrote:
> > From: Quirin Gylstorff <quirin.gylstorff@siemens.com>
> > 
> > debhelper supports the versions debhelper-compat (= 9) till
> > debhelper-compat (= 13).
> > 
> > This patch also adds the variable `DEBIAN_COMPAT` to set the compat
> > to the desired version.
> 
> This introduces a regression. We are no longer able to build the rpi-
> firmware with that patch applied.
> 
> Seems there are more side effects switching from debhelper to
> debhelper-compat.

Hi Florian,

these side-effects are expected and also required for many users. All
packages build for post buster should use debhelper-compat 13 as stated
in the policies. Not being compatible is considered a bug.

> 
> In our case something with the dh_dwz step goes wrong. TheELF file
> generated during build is no longer "recognized", or as a file with
> wrong input format. Clara can provide more information / logs if
> necessary.

If dh_dwz is the issue, just overwrite that in the rules file.

> 
> I have no solution/fix right now. As this is clearly a regression we
> should consider reverting.

Please do not revert, but fix the package. Many users already rely on
the debhelper-compat 13 features (like tmpfiles.d support).

Felix

> 
> Best regards,
> Florian
> 
> > 
> > Signed-off-by: Quirin Gylstorff <quirin.gylstorff@siemens.com>
> > ---
> >  meta-isar/conf/distro/raspios-bullseye.conf |  2 ++
> >  meta-isar/conf/distro/ubuntu-focal.conf     |  2 ++
> >  meta-isar/conf/distro/ubuntu-jammy.conf     |  2 ++
> >  meta/classes/debianize.bbclass              | 13 ++-----------
> >  meta/conf/distro/debian-bookworm.conf       |  2 ++
> >  meta/conf/distro/debian-bullseye.conf       |  2 ++
> >  meta/conf/distro/debian-buster.conf         |  2 ++
> >  meta/conf/distro/debian-sid-ports.conf      |  2 ++
> >  meta/conf/distro/debian-sid.conf            |  2 ++
> >  9 files changed, 18 insertions(+), 11 deletions(-)
> > 
> > diff --git a/meta-isar/conf/distro/raspios-bullseye.conf b/meta-
> > isar/conf/distro/raspios-bullseye.conf
> > index cc64a015..2515f0fd 100644
> > --- a/meta-isar/conf/distro/raspios-bullseye.conf
> > +++ b/meta-isar/conf/distro/raspios-bullseye.conf
> > @@ -25,3 +25,5 @@ THIRD_PARTY_APT_KEYS +=
> > "http://archive.raspberrypi.org/debian/raspberrypi.gpg.k
> >  COMPAT_DISTRO_ARCH:arm64 = "armhf"
> >  
> >  DISTRO_GCC = "10"
> > +
> > +DEBIAN_COMPAT = "13"
> > diff --git a/meta-isar/conf/distro/ubuntu-focal.conf b/meta-
> > isar/conf/distro/ubuntu-focal.conf
> > index 7b400bc7..81728dec 100644
> > --- a/meta-isar/conf/distro/ubuntu-focal.conf
> > +++ b/meta-isar/conf/distro/ubuntu-focal.conf
> > @@ -8,3 +8,5 @@ require conf/distro/ubuntu-common.inc
> >  BASE_DISTRO_CODENAME = "focal"
> >  
> >  DISTRO_GCC = "9"
> > +
> > +DEBIAN_COMPAT = "12"
> > diff --git a/meta-isar/conf/distro/ubuntu-jammy.conf b/meta-
> > isar/conf/distro/ubuntu-jammy.conf
> > index ce6ae511..afc4a731 100644
> > --- a/meta-isar/conf/distro/ubuntu-jammy.conf
> > +++ b/meta-isar/conf/distro/ubuntu-jammy.conf
> > @@ -8,3 +8,5 @@ require conf/distro/ubuntu-common.inc
> >  BASE_DISTRO_CODENAME = "jammy"
> >  
> >  DISTRO_GCC = "11"
> > +
> > +DEBIAN_COMPAT = "13"
> > diff --git a/meta/classes/debianize.bbclass
> > b/meta/classes/debianize.bbclass
> > index 16f3638d..7de98673 100644
> > --- a/meta/classes/debianize.bbclass
> > +++ b/meta/classes/debianize.bbclass
> > @@ -10,6 +10,7 @@ DEBIAN_BUILD_DEPENDS ??= ""
> >  DEBIAN_DEPENDS ??= ""
> >  DEBIAN_CONFLICTS ??= ""
> >  DEBIAN_MULTI_ARCH ??= "no"
> > +DEBIAN_COMPAT ??= "10"
> >  DESCRIPTION ??= "must not be empty"
> >  MAINTAINER ??= "Unknown maintainer <unknown@example.com>"
> >  
> > @@ -60,19 +61,15 @@ EOF
> >         fi
> >  }
> >  
> > -deb_create_compat() {
> > -       echo 10 > ${S}/debian/compat
> > -}
> >  
> >  deb_create_control() {
> > -       compat=$( cat ${S}/debian/compat )
> >         cat << EOF > ${S}/debian/control
> >  Source: ${BPN}
> >  Section: misc
> >  Priority: optional
> >  Standards-Version: 3.9.6
> >  Maintainer: ${MAINTAINER}
> > -Build-Depends: debhelper (>= ${compat}), ${DEBIAN_BUILD_DEPENDS}
> > +Build-Depends: debhelper-compat (= ${DEBIAN_COMPAT}),
> > ${DEBIAN_BUILD_DEPENDS}
> >  
> >  Package: ${BPN}
> >  Architecture: ${DPKG_ARCH}
> > @@ -103,12 +100,6 @@ EOF
> >  deb_debianize() {
> >         install -m 755 -d ${S}/debian
> >  
> > -       # create the compat-file if there is no file with that name
> > in WORKDIR
> > -       if [ -f ${WORKDIR}/compat ]; then
> > -               install -v -m 644 ${WORKDIR}/compat
> > ${S}/debian/compat
> > -       else
> > -               deb_create_compat
> > -       fi
> >         # create the control-file if there is no control-file in
> > WORKDIR
> >         if [ -f ${WORKDIR}/control ]; then
> >                 install -v -m 644 ${WORKDIR}/control
> > ${S}/debian/control
> > diff --git a/meta/conf/distro/debian-bookworm.conf
> > b/meta/conf/distro/debian-bookworm.conf
> > index d0599dc6..ce7279e3 100644
> > --- a/meta/conf/distro/debian-bookworm.conf
> > +++ b/meta/conf/distro/debian-bookworm.conf
> > @@ -15,3 +15,5 @@ DISTRO_KERNELS ?= "4kc-malta 5kc-malta 686-pae
> > 686 alpha-generic alpha-smp \
> >         s390x sh7751r sh7785lcr sparc64-smp sparc64"
> >  
> >  DISTRO_GCC = "12"
> > +
> > +DEBIAN_COMPAT = "13"
> > diff --git a/meta/conf/distro/debian-bullseye.conf
> > b/meta/conf/distro/debian-bullseye.conf
> > index 9b76e68a..2cb9d20e 100644
> > --- a/meta/conf/distro/debian-bullseye.conf
> > +++ b/meta/conf/distro/debian-bullseye.conf
> > @@ -12,3 +12,5 @@ DISTRO_KERNELS ?= "4kc-malta 5kc-malta 686 686-
> > pae amd64 arm64 armmp \
> >      rt-686-pae rt-amd64 rt-arm64 rt-armmp"
> >  
> >  DISTRO_GCC = "10"
> > +
> > +DEBIAN_COMPAT = "13"
> > diff --git a/meta/conf/distro/debian-buster.conf
> > b/meta/conf/distro/debian-buster.conf
> > index 025fc936..57cfac33 100644
> > --- a/meta/conf/distro/debian-buster.conf
> > +++ b/meta/conf/distro/debian-buster.conf
> > @@ -12,3 +12,5 @@ DISTRO_KERNELS ?= "4kc-malta 5kc-malta 686 686-
> > pae amd64 arm64 armmp \
> >      rt-686-pae rt-amd64 rt-arm64 rt-armmp"
> >  
> >  DISTRO_GCC = "8"
> > +
> > +DEBIAN_COMPAT = "12"
> > diff --git a/meta/conf/distro/debian-sid-ports.conf
> > b/meta/conf/distro/debian-sid-ports.conf
> > index f045a3f2..64f3717e 100644
> > --- a/meta/conf/distro/debian-sid-ports.conf
> > +++ b/meta/conf/distro/debian-sid-ports.conf
> > @@ -25,3 +25,5 @@ THIRD_PARTY_APT_KEYS += "${DEBIAN_PORTS_KEYS}"
> >  IMAGE_PREINSTALL += "init"
> >  
> >  IMAGER_INSTALL:wic += "python3-distutils"
> > +
> > +DEBIAN_COMPAT = "13"
> > diff --git a/meta/conf/distro/debian-sid.conf
> > b/meta/conf/distro/debian-sid.conf
> > index 631f9b5a..fdf9775c 100644
> > --- a/meta/conf/distro/debian-sid.conf
> > +++ b/meta/conf/distro/debian-sid.conf
> > @@ -19,3 +19,5 @@ DISTRO_KERNELS ?= "4kc-malta 5kc-malta 686-pae
> > 686 alpha-generic alpha-smp \
> >         s390x sh7751r sh7785lcr sparc64-smp sparc64"
> >  
> >  DISTRO_GCC = "13"
> > +
> > +DEBIAN_COMPAT = "13"
> > -- 
> > 2.43.0
>
Florian Bezdeka April 18, 2024, 12:15 p.m. UTC | #6
On Wed, 2024-04-17 at 21:16 +0000, Moessbauer, Felix (T CED OES-DE)
wrote:
> On Wed, 2024-04-17 at 11:00 +0200, Florian Bezdeka wrote:
> > Hi all,
> > 
> > [CC: Clara]
> > 
> > On Thu, 2024-02-01 at 11:12 +0100, 'Quirin Gylstorff' via isar-users
> > wrote:
> > > From: Quirin Gylstorff <quirin.gylstorff@siemens.com>
> > > 
> > > debhelper supports the versions debhelper-compat (= 9) till
> > > debhelper-compat (= 13).
> > > 
> > > This patch also adds the variable `DEBIAN_COMPAT` to set the compat
> > > to the desired version.
> > 
> > This introduces a regression. We are no longer able to build the rpi-
> > firmware with that patch applied.
> > 
> > Seems there are more side effects switching from debhelper to
> > debhelper-compat.
> 
> Hi Florian,
> 
> these side-effects are expected and also required for many users. All
> packages build for post buster should use debhelper-compat 13 as stated
> in the policies. Not being compatible is considered a bug.
> 
> > 
> > In our case something with the dh_dwz step goes wrong. TheELF file
> > generated during build is no longer "recognized", or as a file with
> > wrong input format. Clara can provide more information / logs if
> > necessary.
> 
> If dh_dwz is the issue, just overwrite that in the rules file.

The patch does two things at once:

- Switch from debhelper to debhelper-compat
- Lifting the compatibility level from 10 to 13 (for bookworm)

The later is causing trouble here. It seems to enable dh_dwz which
turns out to be broken for arm64. Some Debian bugs indicate it's
unfixable for bookworm...

For now no further action required. We can handle it here.

Just another "updating ISAR broke my layers" cycle. We're used to that
(sadly).

Florian

> 
> > 
> > I have no solution/fix right now. As this is clearly a regression we
> > should consider reverting.
> 
> Please do not revert, but fix the package. Many users already rely on
> the debhelper-compat 13 features (like tmpfiles.d support).
> 
> Felix
> 
> > 
> > Best regards,
> > Florian
> >
Quirin Gylstorff April 19, 2024, 9:48 a.m. UTC | #7
On 4/18/24 2:15 PM, Florian Bezdeka wrote:
> On Wed, 2024-04-17 at 21:16 +0000, Moessbauer, Felix (T CED OES-DE)
> wrote:
>> On Wed, 2024-04-17 at 11:00 +0200, Florian Bezdeka wrote:
>>> Hi all,
>>>
>>> [CC: Clara]
>>>
>>> On Thu, 2024-02-01 at 11:12 +0100, 'Quirin Gylstorff' via isar-users
>>> wrote:
>>>> From: Quirin Gylstorff <quirin.gylstorff@siemens.com>
>>>>
>>>> debhelper supports the versions debhelper-compat (= 9) till
>>>> debhelper-compat (= 13).
>>>>
>>>> This patch also adds the variable `DEBIAN_COMPAT` to set the compat
>>>> to the desired version.
>>>
>>> This introduces a regression. We are no longer able to build the rpi-
>>> firmware with that patch applied.
>>>
>>> Seems there are more side effects switching from debhelper to
>>> debhelper-compat.
>>
>> Hi Florian,
>>
>> these side-effects are expected and also required for many users. All
>> packages build for post buster should use debhelper-compat 13 as stated
>> in the policies. Not being compatible is considered a bug.
>>
>>>
>>> In our case something with the dh_dwz step goes wrong. TheELF file
>>> generated during build is no longer "recognized", or as a file with
>>> wrong input format. Clara can provide more information / logs if
>>> necessary.
>>
>> If dh_dwz is the issue, just overwrite that in the rules file.
> 
> The patch does two things at once:
> 
> - Switch from debhelper to debhelper-compat
> - Lifting the compatibility level from 10 to 13 (for bookworm)
Which is required by Debian - we should follow upstream with the policies.

Quirin
> 
> The later is causing trouble here. It seems to enable dh_dwz which
> turns out to be broken for arm64. Some Debian bugs indicate it's
> unfixable for bookworm...
> 
> For now no further action required. We can handle it here.
> 
> Just another "updating ISAR broke my layers" cycle. We're used to that
> (sadly).
> 
> Florian
> 
>>
>>>
>>> I have no solution/fix right now. As this is clearly a regression we
>>> should consider reverting.
>>
>> Please do not revert, but fix the package. Many users already rely on
>> the debhelper-compat 13 features (like tmpfiles.d support).
>>
>> Felix
>>
>>>
>>> Best regards,
>>> Florian
>>>
>

Patch

diff --git a/meta-isar/conf/distro/raspios-bullseye.conf b/meta-isar/conf/distro/raspios-bullseye.conf
index cc64a015..2515f0fd 100644
--- a/meta-isar/conf/distro/raspios-bullseye.conf
+++ b/meta-isar/conf/distro/raspios-bullseye.conf
@@ -25,3 +25,5 @@  THIRD_PARTY_APT_KEYS += "http://archive.raspberrypi.org/debian/raspberrypi.gpg.k
 COMPAT_DISTRO_ARCH:arm64 = "armhf"
 
 DISTRO_GCC = "10"
+
+DEBIAN_COMPAT = "13"
diff --git a/meta-isar/conf/distro/ubuntu-focal.conf b/meta-isar/conf/distro/ubuntu-focal.conf
index 7b400bc7..81728dec 100644
--- a/meta-isar/conf/distro/ubuntu-focal.conf
+++ b/meta-isar/conf/distro/ubuntu-focal.conf
@@ -8,3 +8,5 @@  require conf/distro/ubuntu-common.inc
 BASE_DISTRO_CODENAME = "focal"
 
 DISTRO_GCC = "9"
+
+DEBIAN_COMPAT = "12"
diff --git a/meta-isar/conf/distro/ubuntu-jammy.conf b/meta-isar/conf/distro/ubuntu-jammy.conf
index ce6ae511..afc4a731 100644
--- a/meta-isar/conf/distro/ubuntu-jammy.conf
+++ b/meta-isar/conf/distro/ubuntu-jammy.conf
@@ -8,3 +8,5 @@  require conf/distro/ubuntu-common.inc
 BASE_DISTRO_CODENAME = "jammy"
 
 DISTRO_GCC = "11"
+
+DEBIAN_COMPAT = "13"
diff --git a/meta/classes/debianize.bbclass b/meta/classes/debianize.bbclass
index 16f3638d..7de98673 100644
--- a/meta/classes/debianize.bbclass
+++ b/meta/classes/debianize.bbclass
@@ -10,6 +10,7 @@  DEBIAN_BUILD_DEPENDS ??= ""
 DEBIAN_DEPENDS ??= ""
 DEBIAN_CONFLICTS ??= ""
 DEBIAN_MULTI_ARCH ??= "no"
+DEBIAN_COMPAT ??= "10"
 DESCRIPTION ??= "must not be empty"
 MAINTAINER ??= "Unknown maintainer <unknown@example.com>"
 
@@ -60,19 +61,15 @@  EOF
 	fi
 }
 
-deb_create_compat() {
-	echo 10 > ${S}/debian/compat
-}
 
 deb_create_control() {
-	compat=$( cat ${S}/debian/compat )
 	cat << EOF > ${S}/debian/control
 Source: ${BPN}
 Section: misc
 Priority: optional
 Standards-Version: 3.9.6
 Maintainer: ${MAINTAINER}
-Build-Depends: debhelper (>= ${compat}), ${DEBIAN_BUILD_DEPENDS}
+Build-Depends: debhelper-compat (= ${DEBIAN_COMPAT}), ${DEBIAN_BUILD_DEPENDS}
 
 Package: ${BPN}
 Architecture: ${DPKG_ARCH}
@@ -103,12 +100,6 @@  EOF
 deb_debianize() {
 	install -m 755 -d ${S}/debian
 
-	# create the compat-file if there is no file with that name in WORKDIR
-	if [ -f ${WORKDIR}/compat ]; then
-		install -v -m 644 ${WORKDIR}/compat ${S}/debian/compat
-	else
-		deb_create_compat
-	fi
 	# create the control-file if there is no control-file in WORKDIR
 	if [ -f ${WORKDIR}/control ]; then
 		install -v -m 644 ${WORKDIR}/control ${S}/debian/control
diff --git a/meta/conf/distro/debian-bookworm.conf b/meta/conf/distro/debian-bookworm.conf
index d0599dc6..ce7279e3 100644
--- a/meta/conf/distro/debian-bookworm.conf
+++ b/meta/conf/distro/debian-bookworm.conf
@@ -15,3 +15,5 @@  DISTRO_KERNELS ?= "4kc-malta 5kc-malta 686-pae 686 alpha-generic alpha-smp \
 	s390x sh7751r sh7785lcr sparc64-smp sparc64"
 
 DISTRO_GCC = "12"
+
+DEBIAN_COMPAT = "13"
diff --git a/meta/conf/distro/debian-bullseye.conf b/meta/conf/distro/debian-bullseye.conf
index 9b76e68a..2cb9d20e 100644
--- a/meta/conf/distro/debian-bullseye.conf
+++ b/meta/conf/distro/debian-bullseye.conf
@@ -12,3 +12,5 @@  DISTRO_KERNELS ?= "4kc-malta 5kc-malta 686 686-pae amd64 arm64 armmp \
     rt-686-pae rt-amd64 rt-arm64 rt-armmp"
 
 DISTRO_GCC = "10"
+
+DEBIAN_COMPAT = "13"
diff --git a/meta/conf/distro/debian-buster.conf b/meta/conf/distro/debian-buster.conf
index 025fc936..57cfac33 100644
--- a/meta/conf/distro/debian-buster.conf
+++ b/meta/conf/distro/debian-buster.conf
@@ -12,3 +12,5 @@  DISTRO_KERNELS ?= "4kc-malta 5kc-malta 686 686-pae amd64 arm64 armmp \
     rt-686-pae rt-amd64 rt-arm64 rt-armmp"
 
 DISTRO_GCC = "8"
+
+DEBIAN_COMPAT = "12"
diff --git a/meta/conf/distro/debian-sid-ports.conf b/meta/conf/distro/debian-sid-ports.conf
index f045a3f2..64f3717e 100644
--- a/meta/conf/distro/debian-sid-ports.conf
+++ b/meta/conf/distro/debian-sid-ports.conf
@@ -25,3 +25,5 @@  THIRD_PARTY_APT_KEYS += "${DEBIAN_PORTS_KEYS}"
 IMAGE_PREINSTALL += "init"
 
 IMAGER_INSTALL:wic += "python3-distutils"
+
+DEBIAN_COMPAT = "13"
diff --git a/meta/conf/distro/debian-sid.conf b/meta/conf/distro/debian-sid.conf
index 631f9b5a..fdf9775c 100644
--- a/meta/conf/distro/debian-sid.conf
+++ b/meta/conf/distro/debian-sid.conf
@@ -19,3 +19,5 @@  DISTRO_KERNELS ?= "4kc-malta 5kc-malta 686-pae 686 alpha-generic alpha-smp \
 	s390x sh7751r sh7785lcr sparc64-smp sparc64"
 
 DISTRO_GCC = "13"
+
+DEBIAN_COMPAT = "13"