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

75 views
Skip to first unread message

Quirin Gylstorff

unread,
Jan 31, 2024, 11:19:47 AM1/31/24
to isar-...@googlegroups.com
From: Quirin Gylstorff <quirin.g...@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.g...@siemens.com>
---
meta/classes/debianize.bbclass | 13 ++-----------
1 file changed, 2 insertions(+), 11 deletions(-)

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 <unk...@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
--
2.43.0

MOESSBAUER, Felix

unread,
Feb 1, 2024, 2:26:58 AM2/1/24
to quirin.g...@siemens.com, isar-...@googlegroups.com
On Wed, 2024-01-31 at 17:08 +0100, 'Quirin Gylstorff' via isar-users
wrote:
> From: Quirin Gylstorff <quirin.g...@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.

Hi Quirin,

thanks for bringing this up. In more and more layers we see people
removing the compat file and manually patching the control. This makes
it much easier.

>
> Signed-off-by: Quirin Gylstorff <quirin.g...@siemens.com>
> ---
>  meta/classes/debianize.bbclass | 13 ++-----------
>  1 file changed, 2 insertions(+), 11 deletions(-)
>
> 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"

Can we set the default compat version based on the distribution?
E.g. buster: 12, bullseye: 13, bookworm: 13, trixi / sid: 13

Felix
--
Siemens AG, Technology
Linux Expert Center


Gylstorff Quirin

unread,
Feb 1, 2024, 4:53:54 AM2/1/24
to Moessbauer, Felix (T CED OES-DE), isar-...@googlegroups.com
I can do we increase the default to 13 and use 12 for buster or each
supported distro separately.

Quirin

MOESSBAUER, Felix

unread,
Feb 1, 2024, 5:00:34 AM2/1/24
to quirin.g...@siemens.com, isar-...@googlegroups.com
The first option seems to be more future proof. At a second thought, it
might be better to just configure the default in the distro config. By
that, we can easily extend this for other debian based distros like
ubuntu.

Felix

Quirin Gylstorff

unread,
Feb 1, 2024, 5:12:39 AM2/1/24
to isar-...@googlegroups.com, felix.mo...@siemens.com
From: Quirin Gylstorff <quirin.g...@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.g...@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"
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

unread,
Feb 15, 2024, 3:37:51 AM2/15/24
to quirin.g...@siemens.com, isar-...@googlegroups.com
On Thu, 2024-02-01 at 11:12 +0100, Quirin Gylstorff wrote:
> From: Quirin Gylstorff <quirin.g...@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.mo...@siemens.com>

Felix

Uladzimir Bely

unread,
Feb 16, 2024, 1:13:00 AM2/16/24
to Quirin Gylstorff, isar-...@googlegroups.com, felix.mo...@siemens.com
On Thu, 2024-02-01 at 11:12 +0100, 'Quirin Gylstorff' via isar-users
wrote:
> From: Quirin Gylstorff <quirin.g...@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.g...@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

unread,
Feb 20, 2024, 2:07:46 PM2/20/24
to Quirin Gylstorff, isar-...@googlegroups.com, felix.mo...@siemens.com
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

unread,
Apr 17, 2024, 5:00:25 AM4/17/24
to Quirin Gylstorff, felix.mo...@siemens.com, Uladzimir Bely, isar-...@googlegroups.com, Clara Kowalsky
Hi all,

[CC: Clara]

On Thu, 2024-02-01 at 11:12 +0100, 'Quirin Gylstorff' via isar-users
wrote:
> From: Quirin Gylstorff <quirin.g...@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

MOESSBAUER, Felix

unread,
Apr 17, 2024, 5:16:57 PM4/17/24
to Bezdeka, Florian, quirin.g...@siemens.com, ub...@ilbers.de, isar-...@googlegroups.com, Kowalsky, Clara
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.g...@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

Florian Bezdeka

unread,
Apr 18, 2024, 8:15:29 AM4/18/24
to Moessbauer, Felix (T CED OES-DE), Gylstorff, Quirin (T CED OES-DE), ub...@ilbers.de, isar-...@googlegroups.com, Kowalsky, Clara (T CED OES-DE)
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.g...@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

Gylstorff Quirin

unread,
Apr 19, 2024, 5:48:06 AM4/19/24
to Florian Bezdeka, Moessbauer, Felix (T CED OES-DE), ub...@ilbers.de, isar-...@googlegroups.com, Kowalsky, Clara (T CED OES-DE)
Which is required by Debian - we should follow upstream with the policies.

Quirin
Reply all
Reply to author
Forward
0 new messages