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

Bug#1021461: icon: reproducible-builds: buildid differences in /usr/bin/icon*



Source: icon
Severity: normal
Tags: patch
User: reproducible-builds@lists.alioth.debian.org
Usertags: buildpath
X-Debbugs-Cc: reproducible-bugs@lists.alioth.debian.org

The buildid varies when built from a different path for /usr/bin/icont
and /usr/bin/iconx:

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

The attached patch to debian/rules fixes this by adding
-ffile-prefix-map to CFLAGS, and adjusting a call to sed to handle "/"
in the expression.

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

Thanks for maintaining icon!

live well,
  vagrant
From 0235dc52092db96208f3e0c051a10b0dbccf127d Mon Sep 17 00:00:00 2001
From: Vagrant Cascadian <vagrant@reproducible-builds.org>
Date: Sat, 8 Oct 2022 23:12:15 +0000
Subject: [PATCH] debian/rules: Add -ffile-prefix-map to CFLAGS to avoid
 embedded build paths. Adjust call to sed to handle "/" in the expression.

While the build path doesn't directly show up in the binaries, the
buildid may differs dependent on the build path.
---
 debian/rules | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/debian/rules b/debian/rules
index 006ceb1..e5377bd 100755
--- a/debian/rules
+++ b/debian/rules
@@ -30,9 +30,12 @@ endif
 
 CFLAGS = -Wall -g $(CFLAGS_OPT)
 
+# Avoid embedding build paths for reproducible builds
+CFLAGS += -ffile-prefix-map=$(CURDIR)=.
+
 configure:
 	$(MAKE) X-Configure name=$(system)
-	sed "s/CFLAGS = .*/CFLAGS = $(CFLAGS)/" Makedefs > Makedefs.tmp
+	sed "s%CFLAGS = .*%CFLAGS = $(CFLAGS)%" Makedefs > Makedefs.tmp
 	echo "ASFLAGS = -Wa,--noexecstack" >> Makedefs.tmp
 	mv Makedefs.tmp Makedefs
 	touch $@
-- 
2.37.2

Attachment: signature.asc
Description: PGP signature


Reply to: