Debian Bug report logs - #1021498
tcm: reproducible-builds: build path embedded in /usr/bin/tcm

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

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

Date: Sun, 9 Oct 2022 16:51: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#1021498; Package src:tcm. (Sun, 09 Oct 2022 16:51: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 16:51: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: tcm: reproducible-builds: build path embedded in /usr/bin/tcm
Date: Sun, 09 Oct 2022 09:48:27 -0700
[Message part 1 (text/plain, inline)]
Source: tcm
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/tcm:

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

  /build/1st/tcm-2.20+TSQD/src/ed/helper.c:31·(discriminator·2)
  vs.
  /build/2/tcm-2.20+TSQD/2nd/src/ed/helper.c:31·(discriminator·2)

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

Alternately, using the default CFLAGS from dpkg-buildflags or switching
to "dh" and a recent debhelper compat level might resolve this issue.

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

Thanks for maintaining tcm!

live well,
  vagrant
[0001-debian-rules-Add-ffile-prefix-map-to-CFLAGS-to-avoid.patch (text/x-diff, inline)]
From 8b76667fe07f16eaf520949a19b9e2a96dcb61e9 Mon Sep 17 00:00:00 2001
From: Vagrant Cascadian <vagrant@reproducible-builds.org>
Date: Sun, 9 Oct 2022 16:42:54 +0000
Subject: [PATCH] debian/rules: Add -ffile-prefix-map to CFLAGS 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 7d92a0c..85e1a8a 100755
--- a/debian/rules
+++ b/debian/rules
@@ -7,6 +7,8 @@ include /usr/share/dpkg/buildtools.mk
 
 CFLAGS = -Wall -g
 CFLAGS	+= -fcommon
+# Avoid embedding build paths
+CFLAGS += -ffile-prefix-map=$(CURDIR)=.
 
 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
         CFLAGS += -O0
-- 
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:43:00 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.