Package: dpkg-dev
Version: 1.23.7
Severity: wishlist
Tags: patch
Dear Maintainer,
If the build environments have different DPKG_DEB_COMPRESSOR_{TYPE,LEVEL}
environment variables, debrebuild fails with a checksum mismatch.
debrebuild sets the environment variables from the buildinfo file
Environment block and since these variables affect reproducibility of
the package, it would make sense to include them.
I've attached a patch that adds these variables to the allow list and
makes debrebuild 'just work' in this case.
It shouldn't affect the official buildinfo files or the resulting builds.
If this approach is not suitable for any reason, let me know and I'm happy
to rework it.
Many thanks,
Serge
-- System Information:
Debian Release: forky/sid
APT prefers unstable
APT policy: (500, 'unstable'), (500, 'testing')
Architecture: amd64 (x86_64)
Kernel: Linux 6.12.90+deb13.1-amd64 (SMP w/4 CPU threads; PREEMPT)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8),
LANGUAGE=en_GB:en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
Versions of packages dpkg-dev depends on:
ii binutils 2.46.50.20260617-1
ii bzip2 1.0.8-6+b2
ii libdpkg-perl 1.23.7
ii make 4.4.1-3
ii patch 2.8-2
ii perl 5.40.1-8
ii tar 1.35+dfsg-4
ii xz-utils 5.8.3-1
Versions of packages dpkg-dev recommends:
ii build-essential 12.12
ii fakeroot 1.38.1-1
ii gcc [c-compiler] 4:15.2.0-5+b1
ii gcc-14 [c-compiler] 14.3.0-16
ii gcc-15 [c-compiler] 15.3.0-1
ii gnupg 2.4.9-4
ii gpgv 2.4.9-4
ii libalgorithm-merge-perl 0.08-5
ii sq 1.3.1-10
ii sqv 1.3.0-5+b2
Versions of packages dpkg-dev suggests:
ii debian-keyring 2026.05.24
ii debian-tag2upload-keyring 1.2
-- no debconf information
From 613ac14720c5ecf69d102511a4ad9faf2dc8c843 Mon Sep 17 00:00:00 2001
From: Serge Schneider <[email protected]>
Date: Tue, 23 Jun 2026 14:00:41 +0100
Subject: [PATCH] Dpkg::BuildInfo: Add dpkg-deb compressor variables to the env
allowlist
Record DPKG_DEB_COMPRESSOR_TYPE and DPKG_DEB_COMPRESSOR_LEVEL in the
.buildinfo Environment field, so a rebuild reproduces the binary package
compression. debrebuild already re-exports the Environment field.
---
scripts/Dpkg/BuildInfo.pm | 7 +++++++
scripts/t/Dpkg_BuildInfo.t | 2 +-
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/scripts/Dpkg/BuildInfo.pm b/scripts/Dpkg/BuildInfo.pm
index 5ac89835e..7f3022f18 100644
--- a/scripts/Dpkg/BuildInfo.pm
+++ b/scripts/Dpkg/BuildInfo.pm
@@ -167,6 +167,13 @@ my @env_allowed = (
DPKG_ROOT
DPKG_ADMINDIR
),
+ # See dpkg-deb(1). These affect the compression of the produced binary
+ # packages, and thus the resulting bytes, so they are needed to reproduce
+ # byte-identical .deb files.
+ qw(
+ DPKG_DEB_COMPRESSOR_TYPE
+ DPKG_DEB_COMPRESSOR_LEVEL
+ ),
# See dpkg-architecture(1).
qw(
DPKG_DATADIR
diff --git a/scripts/t/Dpkg_BuildInfo.t b/scripts/t/Dpkg_BuildInfo.t
index 0bdab6003..409335129 100644
--- a/scripts/t/Dpkg_BuildInfo.t
+++ b/scripts/t/Dpkg_BuildInfo.t
@@ -19,5 +19,5 @@ use Test::More tests => 2;
use ok 'Dpkg::BuildInfo';
-is(scalar Dpkg::BuildInfo::get_build_env_allowed(), 85,
+is(scalar Dpkg::BuildInfo::get_build_env_allowed(), 87,
'allowed environment variables array');
--
2.43.0