Debian Bug report logs -
#1003488
last-align: reproducible-builds: ignored CFLAGS/CXXFLAGS break optimization and embed buildpaths
Reported by: Vagrant Cascadian <vagrant@reproducible-builds.org>
Date: Tue, 11 Jan 2022 00:39:02 UTC
Severity: important
Tags: patch
Fixed in version last-align/1257-2
Done: Nilesh Patra <nilesh@debian.org>
Bug is archived. No further changes may be made.
Toggle useless messages
Report forwarded
to debian-bugs-dist@lists.debian.org, reproducible-bugs@lists.alioth.debian.org, Debian Med Packaging Team <debian-med-packaging@lists.alioth.debian.org>:
Bug#1003488; Package src:last-align.
(Tue, 11 Jan 2022 00:39:04 GMT) (full text, mbox, link).
Acknowledgement sent
to Vagrant Cascadian <vagrant@reproducible-builds.org>:
New Bug report received and forwarded. Copy sent to reproducible-bugs@lists.alioth.debian.org, Debian Med Packaging Team <debian-med-packaging@lists.alioth.debian.org>.
(Tue, 11 Jan 2022 00:39:04 GMT) (full text, mbox, link).
Message #5 received at submit@bugs.debian.org (full text, mbox, reply):
[Message part 1 (text/plain, inline)]
Source: last-align
Severity: important
Tags: patch
User: reproducible-builds@lists.alioth.debian.org
Usertags: buildpath
X-Debbugs-Cc: reproducible-bugs@lists.alioth.debian.org
Both CFLAGS and CXXFLAGS were not actually getting passed to the builds
in all cases, resulting in two issues, the "optimized variants" of
various commands were actually identical:
$ sha256sum lastdb5-*
a902143d8f91b11bc2bd1d45ed2798b62d3e9c6763785464ada2f2df99410723 lastdb5-avx
a902143d8f91b11bc2bd1d45ed2798b62d3e9c6763785464ada2f2df99410723 lastdb5-avx2
a902143d8f91b11bc2bd1d45ed2798b62d3e9c6763785464ada2f2df99410723 lastdb5-plain
a902143d8f91b11bc2bd1d45ed2798b62d3e9c6763785464ada2f2df99410723 lastdb5-sse2
a902143d8f91b11bc2bd1d45ed2798b62d3e9c6763785464ada2f2df99410723 lastdb5-sse3
a902143d8f91b11bc2bd1d45ed2798b62d3e9c6763785464ada2f2df99410723 lastdb5-sse4.1
a902143d8f91b11bc2bd1d45ed2798b62d3e9c6763785464ada2f2df99410723 lastdb5-ssse3
Generally, I love it when binaries come out bit-for-bit identical, but
in this case, it actually is a bug!
The only command that built differently were the last-merge-batches-*
variants. I'm not sure why, possibly something in the ordering of which
packages get built somehow resulting in the *FLAGS being applied only
once?
The other issue is that the buildpath is embedded in the binaries and
debugging symbols, as -ffile-prefix-map=BUILDPATH=. was not passed via
CFLAGS/CXXFLAGS.
The attached patch to debian/rules fixes this by passing CFLAGS and
CXXFLAGS via dh_auto_build, rather than relying on the exported
variables.
With this patch applied, last-align should build reproducibly on
tests.reproducible-builds.org (and probably salsa-ci too!), not to
mention that the optimized binaries will actually be optimized!
Thanks for maintaining last-align!
live well,
vagrant
[0001-debian-rules-Pass-CFLAGS-and-CXXFLAGS-directly-to-dh.patch (text/x-diff, inline)]
From 743aed1d0f6d033fe221ac2d7332a58c4665489d Mon Sep 17 00:00:00 2001
From: Vagrant Cascadian <vagrant@reproducible-builds.org>
Date: Tue, 11 Jan 2022 00:15:48 +0000
Subject: [PATCH 1/2] debian/rules: Pass CFLAGS and CXXFLAGS directly to
dh_auto_build rather than exporting.
The makefiles were not inheriting the exported *FLAGS variables,
resulting in the optimized variants lacking the optimizations, as well
as missing the default flags set via dpkg-buildflags.
---
debian/rules | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/debian/rules b/debian/rules
index 73bfc74..f89ac6e 100755
--- a/debian/rules
+++ b/debian/rules
@@ -36,22 +36,20 @@ ifeq (amd64,$(DEB_HOST_ARCH))
mkdir -p $(prefix)
mkdir -p $(libexecdir)
for SIMD in avx2 avx sse4.1 ssse3 sse3 sse2 ; do \
- export CXXFLAGS="$(CXXFLAGS) -m$${SIMD}" && export CFLAGS="$(CFLAGS) -m$${SIMD}" && \
- dh_auto_build -- all SFX=-$${SIMD} ; \
+ dh_auto_build -- all SFX=-$${SIMD} CFLAGS="$(CFLAGS) -m$${SIMD}" CXXFLAGS="$(CXXFLAGS) -m$${SIMD}" ; \
find . -name '*.o' -delete ; \
find . -name '*.o5' -delete ; \
done
- export CXXFLAGS="$(CXXFLAGS)" && export CFLAGS="$(CFLAGS)" && dh_auto_build -- all SFX=-plain
+ dh_auto_build -- all SFX=-plain CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)"
else ifeq (i386,$(DEB_HOST_ARCH))
mkdir -p $(prefix)
mkdir -p $(libexecdir)
for SIMD in avx2 avx sse4.1 ssse3 sse3 sse2 sse; do \
- export CXXFLAGS="$(CXXFLAGS) -m$${SIMD}" && export CFLAGS="$(CFLAGS) -m$${SIMD}" && \
- dh_auto_build -- all SFX=-$${SIMD} ; \
+ dh_auto_build -- all SFX=-$${SIMD} CFLAGS="$(CFLAGS) -m$${SIMD}" CXXFLAGS="$(CXXFLAGS) -m$${SIMD}" ; \
find . -name '*.o' -delete ; \
find . -name '*.o5' -delete ; \
done
- export CXXFLAGS="$(CXXFLAGS)" && export CFLAGS="$(CFLAGS)" && dh_auto_build -- all SFX=-plain
+ dh_auto_build -- all SFX=-plain CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)"
else
dh_auto_build
endif
--
2.34.1
[signature.asc (application/pgp-signature, inline)]
Reply sent
to Nilesh Patra <nilesh@debian.org>:
You have taken responsibility.
(Tue, 11 Jan 2022 08:51:10 GMT) (full text, mbox, link).
Notification sent
to Vagrant Cascadian <vagrant@reproducible-builds.org>:
Bug acknowledged by developer.
(Tue, 11 Jan 2022 08:51:10 GMT) (full text, mbox, link).
Message #10 received at 1003488-close@bugs.debian.org (full text, mbox, reply):
Source: last-align
Source-Version: 1257-2
Done: Nilesh Patra <nilesh@debian.org>
We believe that the bug you reported is fixed in the latest version of
last-align, which is due to be installed in the Debian FTP archive.
A summary of the changes between this version and the previous one is
attached.
Thank you for reporting the bug, which will now be closed. If you
have further comments please address them to 1003488@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.
Debian distribution maintenance software
pp.
Nilesh Patra <nilesh@debian.org> (supplier of updated last-align package)
(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
Format: 1.8
Date: Tue, 11 Jan 2022 13:54:19 +0530
Source: last-align
Architecture: source
Version: 1257-2
Distribution: unstable
Urgency: medium
Maintainer: Debian Med Packaging Team <debian-med-packaging@lists.alioth.debian.org>
Changed-By: Nilesh Patra <nilesh@debian.org>
Closes: 1003488 1003489
Changes:
last-align (1257-2) unstable; urgency=medium
.
* d/rules:
+ Pass CFLAGS and CXXFLAGS directly to dh_auto_build rather
than exporting (Closes: #1003488)
+ export LC_ALL and LANG to use C.UTF-8 (Closes: #1003489)
(Thanks to Vagrant Cascadian for the patches)
Checksums-Sha1:
9791db80a0660d14a03b94bb2d77fd0aa0751d86 2139 last-align_1257-2.dsc
7270b33b70a9f83b6fe10461028ab0075a026014 16816 last-align_1257-2.debian.tar.xz
5abc976fa48fd85156be7edb76daa3e9ef949a3f 7170 last-align_1257-2_amd64.buildinfo
Checksums-Sha256:
60b5170489d3467f9049e5ff13cc511cbf477980f99add95e636bb9db7156346 2139 last-align_1257-2.dsc
0297f099055039e267e6c8c6cba5ce2b4581afa8ddeb8ae679879a1b59f56e6b 16816 last-align_1257-2.debian.tar.xz
c5b6aaf8a5de884208a06120a8463d4493d5467a6771fdc7b6229cc00316ad01 7170 last-align_1257-2_amd64.buildinfo
Files:
cf3648ee359363d2802bcedf40cd7b2e 2139 science optional last-align_1257-2.dsc
ee03e27f560b34815815c3b696a033dc 16816 science optional last-align_1257-2.debian.tar.xz
8233ce63ed3af6fc3e1bb50918e99956 7170 science optional last-align_1257-2_amd64.buildinfo
-----BEGIN PGP SIGNATURE-----
iQJGBAEBCgAwFiEEPpmlJvXcwMu/HO6mALrnSzQzafEFAmHdQh8SHG5pbGVzaEBk
ZWJpYW4ub3JnAAoJEAC650s0M2nxDdEQAJ/sxBO3CmjHhAUVg+NPQmLfExp8qpoO
M05BvG39nQIhUUvaacfbrIEd0II9QP6E4DiCYhTsX4NcZWrh90cxXKQdaNGlm9x0
z1OEzNLJdA4eFyOxUUEmBZ3079ub0AXWgznMCGEUmHIRPwdFMHl1EkNRoqFqiu14
UrQaoCVjXRgylspR9NaEkXGOk49YE1GSO+dvWUCgIwLe2Jt4BY5kKxvwwpJmVHjx
BzQf+D9wofm9EatFdS6nSLM0YbZk1+4Y4I3Ph466CuiY9c7McSdM0TcUxuFXVtxJ
Dv2yW+gr1Wb04XOONTTA9muRreaaXhGIKzNLjULub+tdmFiqjXkk4q7R+6XLr7/T
3dZkcSgwEZKRjmm9rkrV8yhGgSvdD6x0Fqji6nIe3u2Lb4Rg9tHRSC/FwEe3c9AH
tzckw2Mdh+p27XO907AD1FsdUDa4/8IMVO0L8ENlqpgR29gnGop5qPoMzeJq8x9x
n2npVJ/Hmz1e1njVJH+RaFLuYychpRHUrWlvwCoQU3lnVpU8WTW/Acy6XZq5yxFJ
h5yfwe1lnG4L2G+J1lE/cMlbeeOW5TNi1x/PH/sqql1sWnlrlLROpPnoZSALfLxt
7wBG1ntxwV1myo+dDA/ymDN5G3yTlbD3d2xnde8MzMOdCvRC9RbtnnA5/QkX4vxg
fRXmliczWDHm
=Tnnp
-----END PGP SIGNATURE-----
Bug archived.
Request was from Debbugs Internal Request <owner@bugs.debian.org>
to internal_control@bugs.debian.org.
(Wed, 09 Feb 2022 07:29:47 GMT) (full text, mbox, link).
Send a report that this bug log contains spam.
Debian bug tracking system administrator <owner@bugs.debian.org>.
Last modified:
Wed May 17 11:03:45 2023;
Machine Name:
buxtehude
Debian Bug tracking system
Debbugs is free software and licensed under the terms of the GNU
Public License version 2. The current version can be obtained
from https://bugs.debian.org/debbugs-source/.
Copyright © 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson,
2005-2017 Don Armstrong, and many other contributors.