[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#1023960: libcgicc: reproducible-builds: build path embedded in /usr/bin/cgicc-config



Source: libcgicc
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/bin/cgicc-config:

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

  cxxflags="-Wall·-W·-pedantic·-g·-O2·-ffile-prefix-map=/build/1st/libcgicc-3.2.19=. ...
  vs.
  cxxflags="-Wall·-W·-pedantic·-g·-O2·-ffile-prefix-map=/build/2/libcgicc-3.2.19/2nd=. ...

The attached patch to debian/rules fixes this by updating the
dh_auto_install override to strip the recorded -ffile-prefix-map
compiler flag from "cgicc-config", as this embeds the build path (it
previously already also stripped the related -fdebug-prefix-map
argument).

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

Thanks for maintaining libcgicc!

live well,
  vagrant
From 1b023b3643959f914dd0d307dfb1c0a374fdb9fe Mon Sep 17 00:00:00 2001
From: Vagrant Cascadian <vagrant@reproducible-builds.org>
Date: Sun, 13 Nov 2022 08:01:54 +0000
Subject: [PATCH] debian/rules: Strip -ffile-prefix-map from cgicc-config too.

There was already support stripping -fdebug-prefix-map, extend to also
support -ffile-prefix-map.
---
 debian/rules | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/debian/rules b/debian/rules
index 43f37e7..d176345 100755
--- a/debian/rules
+++ b/debian/rules
@@ -25,8 +25,10 @@ override_dh_auto_install:
 	dh_auto_install
 	# work around doxygen bug - embeds copy of jquery unnecessarily
 	rm -f $(CURDIR)/debian/tmp/usr/share/doc/libcgicc-doc/html/jquery.js
-	# Remove the debug-prefix-map compiler option, as it conflicts with mutli-arch
-	sed -i -e 's/ *-fdebug-prefix-map=[^ "]*//' $(CURDIR)/debian/tmp/usr/bin/cgicc-config
+	# Remove the debug-prefix-map and file-prefix-map compiler
+	# options, as they conflict with mutli-arch and breaks
+	# reproducible builds
+	sed -i -e 's/ *-fdebug-prefix-map=[^ "]*//' -e 's/ *-ffile-prefix-map=[^ "]*//' $(CURDIR)/debian/tmp/usr/bin/cgicc-config
 
 override_dh_installexamples:
 	dh_installexamples -XMakefile
-- 
2.38.1

Attachment: signature.asc
Description: PGP signature


Reply to: