Source: menu
Severity: normal
Tags: patch
User: reproducible-bui...@lists.alioth.debian.org
Usertags: buildpath
X-Debbugs-Cc: reproducible-b...@lists.alioth.debian.org

The build path is embedded in various binaries:

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

  /usr/bin/install-menu

  /build/1st/menu-2.1.49/install-menu/install-menu.cc:126·(discriminator·1)
  vs.
  /build/2/menu-2.1.49/2nd/install-menu/install-menu.cc:126·(discriminator·1)

The attached patch to debian/rules fixes this by passing 
-ffile-prefix-map via CXXFLAGS and CFLAGS.

An alternate approach might be to use the default flags from
dpkg-buildflags.

According to my local tests, this should fix the build path issue,
although there is an outstanding timestamp issue on
tests.reproducible-builds.org that I am unable to reproduce locally.

Thanks for maintaining menu!

live well,
  vagrant
From ca80c2ba4f98b86241d564808980159e2f464b1a Mon Sep 17 00:00:00 2001
From: Vagrant Cascadian <vagr...@reproducible-builds.org>
Date: Mon, 26 Jun 2023 09:02:01 -0700
Subject: [PATCH] debian/rules: Pass -ffile-prefix-map to CXXFLAGS and CFLAGS.

This avoids embedding the build paths in the binaries.

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

diff --git a/debian/rules b/debian/rules
index 93fd473..c434184 100755
--- a/debian/rules
+++ b/debian/rules
@@ -13,8 +13,8 @@ DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
 DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
 DEB_HOST_MULTIARCH  ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
 
-CXXFLAGS = -g -Wall
-CFLAGS = -g -Wall
+CXXFLAGS = -g -Wall -ffile-prefix-map=$(CURDIR)=.
+CFLAGS = -g -Wall -ffile-prefix-map=$(CURDIR)=.
 LDFLAGS = -Wl,-z,relro
 
 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
-- 
2.39.2

Attachment: signature.asc
Description: PGP signature

Reply via email to