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

Bug#1024125: ucspi-proxy: reproducible-builds: build path, timestamps and umask issues



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

The buildids of various binaries differred when built in different build
paths, timestamps were embedded in manpages, and the mode of several
directories was dependent on the umask of the build environment:

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

  /usr/share/man/man1/ucspi-proxy-http-xlate.1.gz

  gzip·compressed·data,·was·"ucspi-proxy-http-xlate.1",·last·modified:·Sun·Nov·13·05:42:22·2022,·max·compression,·from·Unix
  vs.
  gzip·compressed·data,·was·"ucspi-proxy-http-xlate.1",·last·modified:·Sat·Dec·16·12:06:16·2023,·max·compression,·from·Unix

  drwxr-xr-x···0·root·········(0)·root·········(0)········0·2022-11-12·10:57:15.000000·./usr/bin/
  vs.
  drwxrwxr-x···0·root·········(0)·root·········(0)········0·2022-11-12·10:57:15.000000·./usr/bin/

The attached patches to debian/rules fix this by adding the
-ffile-prefix-map argument to CFLAGS which avoids embedding build paths,
passing -n to gzip to avoid embedding timestamps in the gzip headers of
created manpages, and setting a consistent mode on several directories
created by "make install".

Preferably, many of these issues would likely be fixed by converting to
dh and a recent debhelper-compat version...

According to my local tests, with these patches applied ucspi-proxy
should build reproducibly on tests.reproducible-builds.org!


Thanks for maintaining ucspi-proxy!


live well,
  vagrant
From ecb57971f4d5fc958cc8afa31db8932fb2fac62e Mon Sep 17 00:00:00 2001
From: Vagrant Cascadian <vagrant@reproducible-builds.org>
Date: Tue, 15 Nov 2022 02:08:38 +0000
Subject: [PATCH 1/3] debian/rules: Add -ffile-prefix-map to CFLAGS to avoid
 embedding build path.

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

diff --git a/debian/rules b/debian/rules
index a6a8a21..747c054 100755
--- a/debian/rules
+++ b/debian/rules
@@ -1,7 +1,7 @@
 #!/usr/bin/make -f
 
 CC =gcc
-CFLAGS =-W -Wall -Wshadow -O2 -g
+CFLAGS =-W -Wall -Wshadow -O2 -g -ffile-prefix-map=$(CURDIR)=.
 STRIP =strip
 BGINCS =/usr/include/bglibs
 
-- 
2.38.1

From 13c5e3b2c89431f80934d3ce4a35d2b18432bb8b Mon Sep 17 00:00:00 2001
From: Vagrant Cascadian <vagrant@reproducible-builds.org>
Date: Tue, 15 Nov 2022 02:09:51 +0000
Subject: [PATCH 2/3] debian/rules: Pass "-n" argument to gzip to avoid
 embedding timestamp in manpages.

https://tests.reproducible-builds.org/debian/issues/timestamps_in_gzip_headers_issue.html
---
 debian/rules | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/debian/rules b/debian/rules
index 747c054..f57275f 100755
--- a/debian/rules
+++ b/debian/rules
@@ -48,7 +48,7 @@ install: deb-checkdir deb-checkuid build-stamp
 	rm -rf '$(DIR)'
 	$(MAKE) install install_prefix='$(DIR)'
 	$(STRIP) -R .comment -R .note '$(DIR)'/usr/bin/ucspi-proxy*
-	gzip -9 '$(DIR)'/usr/share/man/man1/*.1
+	gzip -9n '$(DIR)'/usr/share/man/man1/*.1
 	test -r changelog || ln -s ChangeLog changelog
 
 binary-indep:
-- 
2.38.1

From 1f3f8a61324623784e9ada73786b14872c770510 Mon Sep 17 00:00:00 2001
From: Vagrant Cascadian <vagrant@reproducible-builds.org>
Date: Tue, 15 Nov 2022 02:12:55 +0000
Subject: [PATCH 3/3] debian/rules: Set permissions on several directories
 before building package, to avoid differences due to build environment umask.

https://tests.reproducible-builds.org/debian/issues/different_due_to_umask_issue.html
---
 debian/rules | 1 +
 1 file changed, 1 insertion(+)

diff --git a/debian/rules b/debian/rules
index f57275f..e4dd446 100755
--- a/debian/rules
+++ b/debian/rules
@@ -49,6 +49,7 @@ install: deb-checkdir deb-checkuid build-stamp
 	$(MAKE) install install_prefix='$(DIR)'
 	$(STRIP) -R .comment -R .note '$(DIR)'/usr/bin/ucspi-proxy*
 	gzip -9n '$(DIR)'/usr/share/man/man1/*.1
+	chmod u=rwx,og=rx '$(DIR)' '$(DIR)/usr' '$(DIR)/usr/bin' '$(DIR)/usr/share' '$(DIR)/usr/share/man'
 	test -r changelog || ln -s ChangeLog changelog
 
 binary-indep:
-- 
2.38.1

Attachment: signature.asc
Description: PGP signature


Reply to: