Debian Bug report logs - #1021466
pacman: reproducible-builds: build path embedded in /usr/games/pacman

Package: src:pacman; Maintainer for src:pacman is Debian QA Group <packages@qa.debian.org>;

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

Date: Sun, 9 Oct 2022 00:33:01 UTC

Severity: normal

Tags: patch

Reply or subscribe to this bug.

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#1021466; Package src:pacman. (Sun, 09 Oct 2022 00:33:03 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, 09 Oct 2022 00:33:03 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: pacman: reproducible-builds: build path embedded in /usr/games/pacman
Date: Sat, 08 Oct 2022 17:31:13 -0700
[Message part 1 (text/plain, inline)]
Source: pacman
Severity: normal
Tags: patch
User: reproducible-builds@lists.alioth.debian.org
Usertags: buildpath
X-Debbugs-Cc: reproducible-bugs@lists.alioth.debian.org

The build path is embedded in /usr/games/pacman:

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

  /build/1st/pacman-10/pac.cc:85
  vs.
  /build/2/pacman-10/2nd/pac.cc:85

The attached patch fixes this adjusting the generated Makefile from
debian/rules to include -ffile-prefix-map in the CXXFLAGS_DEFINES
variable.

Alternately, it might be worth using "dpkg-buildflags --get CXXFLAGS"
instead of hard-coding -ffile-prefix-map, and will benefit from other
useful flags as well.

According to my local tests, with this patch applied, pacman should build
reproducibly on tests.reproducible-builds.org!

Thanks for maintaining pacman!

live well,
  vagrant
[0001-debian-rules-Add-ffile-prefix-map-to-CXXEXTRA_DEFINE.patch (text/x-diff, inline)]
From c2c6a41d218ae21765360832814e1d61d887f529 Mon Sep 17 00:00:00 2001
From: Vagrant Cascadian <vagrant@reproducible-builds.org>
Date: Sun, 9 Oct 2022 00:20:22 +0000
Subject: [PATCH 1/2] debian/rules: Add -ffile-prefix-map to CXXEXTRA_DEFINES
 in generated Makefile to avoid embedding build paths.

https://reproducible-builds.org/docs/build-path/
---
 debian/rules | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/debian/rules b/debian/rules
index 406e691..5092f98 100755
--- a/debian/rules
+++ b/debian/rules
@@ -10,6 +10,8 @@ build-indep: build-stamp
 build-stamp:
 	dh_testdir
 	xmkmf -a
+	# Avoid embedding build path
+	sed -i -e "s,CXXEXTRA_DEFINES =,CXXEXTRA_DEFINES = -ffile-prefix-map=$(CURDIR)=.,g" Makefile
 	$(MAKE)
 	touch build-stamp
 
-- 
2.37.2

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

Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Wed May 17 12:42:32 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.