Debian Bug report logs - #977793
nis: reproducible builds: variable build path triggers Build ID variations

version graph

Package: src:nis; Maintainer for src:nis is Francesco Paolo Lovergine <frankie@debian.org>;

Reported by: Vagrant Cascadian <vagrant@reproducible-builds.org>

Date: Sun, 20 Dec 2020 23:45:02 UTC

Severity: normal

Tags: patch

Fixed in version nis/3.17.1-8

Done: Vagrant Cascadian <vagrant@reproducible-builds.org>

Bug is archived. No further changes may be made.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, reproducible-bugs@lists.alioth.debian.org, Debian QA Group <packages@qa.debian.org>:
Bug#977793; Package src:nis. (Sun, 20 Dec 2020 23:45: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 QA Group <packages@qa.debian.org>. (Sun, 20 Dec 2020 23:45:04 GMT) (full text, mbox, link).


Message #5 received at submit@bugs.debian.org (full text, mbox, reply):

From: Vagrant Cascadian <vagrant@reproducible-builds.org>
To: submit@bugs.debian.org
Subject: nis: reproducible builds: variable build path triggers Build ID variations
Date: Sun, 20 Dec 2020 15:41:43 -0800
[Message part 1 (text/plain, inline)]
Source: nis
Severity: normal
Tags: patch
User: reproducible-builds@lists.alioth.debian.org
Usertags: buildpath
X-Debbugs-Cc: reproducible-bugs@lists.alioth.debian.org

Various binaries shipped in nis are build differently when the build
path varies:

  https://tests.reproducible-builds.org/debian/rb-pkg/unstable/amd64/diffoscope-results/nis.html

  /usr/bin/ypcat
  GNU··0x00000014»  NT_GNU_BUILD_ID·(unique·build·ID·bitstring)» Build·ID:·dedd8715faeef72ca4c5130f43d08f8df595b39a
  vs. 
  GNU 0x00000014»  NT_GNU_BUILD_ID·(unique·build·ID·bitstring)»  Build·ID:·5dba43813c061ce956ac0741ae4bb981fc1eaa4e

The attached patch fixes this by adding -ffile-prefix-map to CFLAGS.


live well,
  vagrant
[0001-debian-rules-Add-ffile-prefix-map-to-CFLAGS.patch (text/x-diff, inline)]
From a0a9ef87562f56000e30749d535c948b48de4cd9 Mon Sep 17 00:00:00 2001
From: Vagrant Cascadian <vagrant@reproducible-builds.org>
Date: Sun, 20 Dec 2020 23:30:56 +0000
Subject: [PATCH] debian/rules: Add -ffile-prefix-map to CFLAGS.

This is used to strip the build path from the resulting binaries,
fixing variable Build IDs in the binaries.

https://tests.reproducible-builds.org/debian/issues/build_id_differences_only_issue.html
---
 debian/rules | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/debian/rules b/debian/rules
index abc714e..99dfcc1 100755
--- a/debian/rules
+++ b/debian/rules
@@ -17,14 +17,16 @@ include /usr/share/dpkg/architecture.mk
 BUILD_DATE=$(shell dpkg-parsechangelog --show-field Date)
 
 ifeq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
-        CFLAGS = "-O2 -Wall -g"
+        CFLAGS = -O2 -Wall -g
 else
-        CFLAGS = "-O0 -Wall -g"
+        CFLAGS = -O0 -Wall -g
 endif
 #ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
 #        INSTALL_PROGRAM += -s
 #endif
 
+# Avoid embedding build paths in binaries for reproducible builds
+CFLAGS += -ffile-prefix-map=$(CURDIR)=.
 
 define checkdir
 	test -f $(YPBIND)/README
@@ -36,13 +38,13 @@ build:
 # Builds the binary package.
 	dh_autoreconf
 	-(cd $(YPTOOLS) && [ ! -f config.status ] && \
-		CFLAGS=$(CFLAGS) ./configure \
+		CFLAGS="$(CFLAGS)" ./configure \
 		--prefix=/usr --mandir=/usr/share/man \
 		--build=$(DEB_BUILD_GNU_TYPE) \
 		--host=$(DEB_HOST_GNU_TYPE) )
 	(cd $(YPTOOLS) && make)
 	-(cd $(YPBIND) && [ ! -f config.status ] && \
-		CFLAGS=$(CFLAGS) ./configure \
+		CFLAGS="$(CFLAGS)" ./configure \
 		--prefix=/usr --mandir=/usr/share/man \
 		--sysconfdir=/etc --libexecdir=/usr/lib/yp \
 		--disable-dbus-nm \
@@ -51,7 +53,7 @@ build:
 	(cd $(YPBIND) && make )
 	rm -f $(YPSERV)/sedscript
 	-(cd $(YPSERV) && [ ! -f config.status ] && \
-		AWK=/usr/bin/awk CFLAGS=$(CFLAGS) ./configure \
+		AWK=/usr/bin/awk CFLAGS="$(CFLAGS)" ./configure \
 		BASH=/bin/bash \
 		--prefix=/usr --mandir=/usr/share/man \
 		--sysconfdir=/etc \
-- 
2.29.2

[signature.asc (application/pgp-signature, inline)]

Reply sent to Vagrant Cascadian <vagrant@reproducible-builds.org>:
You have taken responsibility. (Mon, 21 Dec 2020 00:21:03 GMT) (full text, mbox, link).


Notification sent to Vagrant Cascadian <vagrant@reproducible-builds.org>:
Bug acknowledged by developer. (Mon, 21 Dec 2020 00:21:03 GMT) (full text, mbox, link).


Message #10 received at 977793-close@bugs.debian.org (full text, mbox, reply):

From: Debian FTP Masters <ftpmaster@ftp-master.debian.org>
To: 977793-close@bugs.debian.org
Subject: Bug#977793: fixed in nis 3.17.1-8
Date: Mon, 21 Dec 2020 00:18:24 +0000
Source: nis
Source-Version: 3.17.1-8
Done: Vagrant Cascadian <vagrant@reproducible-builds.org>

We believe that the bug you reported is fixed in the latest version of
nis, 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 977793@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Vagrant Cascadian <vagrant@reproducible-builds.org> (supplier of updated nis 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: Sun, 20 Dec 2020 15:59:07 -0800
Source: nis
Architecture: source
Version: 3.17.1-8
Distribution: unstable
Urgency: medium
Maintainer: Debian QA Group <packages@qa.debian.org>
Changed-By: Vagrant Cascadian <vagrant@reproducible-builds.org>
Closes: 977793
Changes:
 nis (3.17.1-8) unstable; urgency=medium
 .
   * QA upload.
   * debian/rules: Add -ffile-prefix-map to CFLAGS. (Closes: #977793)
Checksums-Sha1:
 be9f1eca5cb7be677929eb78eee7920f75c5333e 1287 nis_3.17.1-8.dsc
 258c4566ccf203e51223b12e682683928f943ba6 40164 nis_3.17.1-8.debian.tar.xz
Checksums-Sha256:
 54d17c4329573af5d28f1cc72d648c8b9f31637addd78bc05ef00783214e474f 1287 nis_3.17.1-8.dsc
 062b62cc67645b5402c5e40ffb8e1d7e1724af4b35f400dbc766934fdc9c6cde 40164 nis_3.17.1-8.debian.tar.xz
Files:
 9999f0570627a07e9fba37a153849dbb 1287 net optional nis_3.17.1-8.dsc
 6a0251dfedb1c90507bfe9460b1823c8 40164 net optional nis_3.17.1-8.debian.tar.xz

-----BEGIN PGP SIGNATURE-----

iJYEARYKAD4WIQRlgHNhO/zFx+LkXUXcUY/If5cWqgUCX9/l+SAcdmFncmFudEBy
ZXByb2R1Y2libGUtYnVpbGRzLm9yZwAKCRDcUY/If5cWqrovAQClqyMzig3KgwJJ
YY2ny2CT2yTnPKPmeofdCS2klewg+wD/RQ7iEQ6ckMqq7SNjV0shI5yOpF4U2a8e
XPbdLOIGBgc=
=Yn4L
-----END PGP SIGNATURE-----




Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Fri, 29 Jan 2021 07:31:21 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 12:50:47 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.