Bug#989583: liblip: Fails to build reproducibly: multiple problems

Nilesh Patra nilesh at debian.org
Tue Jun 8 00:21:08 BST 2021


Source: liblip
Version: 2.0.0-1.2
Severity: normal
Tags: patch
User: reproducible-builds at lists.alioth.debian.org
Usertags: timestamps, buildpath
X-Debbugs-Cc: nilesh at debian.org, nilesh at debian.org, reproducible-bugs at lists.alioth.debian.org

Dear Maintainer,

The following problems cause problems in liblip being reproducible:

a) It embeds timestamps into gzip headers, simply passing -n with gzip
  fixes it
b) md5sum that it injects to DEBIAN/md5sums are random in order, simply
  sorting them does the trick
c) It embeds buildpath in resulting .deb because -ffile-prefix-map isn't
  injected by default since this does not seem to use debhelper, and uses a hand-coded d/rules w/o dh
  customizations and compat level. Manually adding the -ffile-prefix-map
  with relevant options seems to do the trick.

Please consider applying the attached patch.

Thanks!
Nilesh


-- System Information:
Debian Release: bullseye/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 5.7.0-2-amd64 (SMP w/8 CPU threads)
Kernel taint flags: TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
-------------- next part --------------
--- a/debian/rules
+++ b/debian/rules
@@ -4,16 +4,19 @@
 
 STRIP      = strip --strip-unneeded --remove-section=.comment --remove-section=.note
 
+CXXFLAGS:=$(shell dpkg-buildflags --get CXXFLAGS)
+CXXFLAGS += -ffile-prefix-map=$(CURDIR)=.
+
 build:
 	$(checkdir)
 	cp -f /usr/share/misc/config.sub .
 	cp -f /usr/share/misc/config.guess .
 	./configure --prefix=/usr --enable-shared
-	$(MAKE) install prefix=$(CURDIR)/shared
+	$(MAKE) install prefix=$(CURDIR)/shared CXXFLAGS="$(CXXFLAGS)"
 	[ ! -f Makefile ] || $(MAKE) distclean
 	-rm -f config.log config.cache
 	./configure --prefix=/usr --enable-static
-	$(MAKE) install prefix=$(CURDIR)/static
+	$(MAKE) install prefix=$(CURDIR)/static CXXFLAGS="$(CXXFLAGS)"
 	touch build
 
 clean:
@@ -59,20 +62,22 @@ binary-arch: checkroot build
 	cp -p docs/* debian/liblip2/usr/share/doc/liblip2/
 	cp -p examples/example* debian/liblip2/usr/share/doc/liblip2/examples
 	cp -p examples/makefile debian/liblip2/usr/share/doc/liblip2/examples
-	cd debian/liblip2/usr/share/doc/liblip2 && gzip -9 changelog.Debian examples/*
+	cd debian/liblip2/usr/share/doc/liblip2 && gzip -9n changelog.Debian examples/*
 
 	ln -s liblip2 debian/liblip-dev/usr/share/doc/liblip-dev
 
 	dpkg-shlibdeps debian/liblip2/usr/lib/lip/*
 	dpkg-gencontrol -isp -pliblip2 -Pdebian/liblip2
-	cd debian/liblip2 && md5sum `find * -type f ! -regex "DEBIAN/.*"` > DEBIAN/md5sums
+	cd debian/liblip2 && find * -type f ! -regex "DEBIAN/.*" -print0 |\
+	LC_ALL=C sort -z | xargs -0r md5sum > DEBIAN/md5sums
 	chown -R root.root debian/liblip2
 	chmod -x debian/liblip2/usr/lib/lip/*
 	chmod -R go=rX debian/liblip2
 	dpkg --build debian/liblip2 ..
 
 	dpkg-gencontrol -isp -pliblip-dev -Pdebian/liblip-dev
-	cd debian/liblip-dev && md5sum `find * -type f ! -regex "DEBIAN/.*"` > DEBIAN/md5sums
+	cd debian/liblip-dev && find * -type f ! -regex "DEBIAN/.*" -print0 |\
+	LC_ALL=C sort -z | xargs -0r md5sum > DEBIAN/md5sums
 	chown -R root.root debian/liblip-dev
 	chmod -x debian/liblip-dev/usr/lib/lip/liblip.a
 	chmod -x debian/liblip-dev/usr/lib/lip/liblip.la


More information about the Reproducible-bugs mailing list