Bug#856257: tunnelx: please make the build reproducible

Dhole dhole at openmailbox.org
Mon Feb 27 01:49:48 UTC 2017


Source: tunnelx
Version: 20160713-3
Severity: wishlist
Tags: patch
User: reproducible-builds at lists.alioth.debian.org
Usertags: randomness
X-Debbugs-Cc: reproducible-bugs at lists.alioth.debian.org

Hi,

While working on the "reproducible builds" effort [1], we have noticed that
tunnelx could not be built reproducibly.

During the build, two files called 'listdir.txt' containing the list of files in
a directory are created.  These files are created with:
`ls $x | LC_ALL=C sort > $x/listdir.txt`
I believe there is a data race between the creation of the listdir.txt file and
the listing of the directory $x$ by 'ls', causing the listdir.txt entry to
appear sometimes in the file and sometimes not.

The attached patch fixes this by using a temporary hidden '.listdir.txt' file
that is then renamed to 'listdirtxt'. Once applied, tunnelx can be built
reproducibly in our current experimental framework.

 [1]: https://wiki.debian.org/ReproducibleBuilds

Regards,
-- 
Dhole
-------------- next part --------------
diff -Nru tunnelx-20160713/debian/changelog tunnelx-20160713/debian/changelog
--- tunnelx-20160713/debian/changelog	2016-11-13 16:28:13.000000000 +0100
+++ tunnelx-20160713/debian/changelog	2017-02-06 12:07:09.000000000 +0100
@@ -1,3 +1,11 @@
+tunnelx (20160713-3.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix datarace in the generation of listdir.txt files, making the package
+    build reproducible.
+
+ -- Eduard Sanou <dhole at openmailbox.org>  Mon, 06 Feb 2017 12:07:09 +0100
+
 tunnelx (20160713-3) unstable; urgency=medium
 
   * Make rebuild reproducible (Closes: #843698)
diff -Nru tunnelx-20160713/debian/rules tunnelx-20160713/debian/rules
--- tunnelx-20160713/debian/rules	2016-11-13 16:25:41.000000000 +0100
+++ tunnelx-20160713/debian/rules	2017-02-06 12:07:09.000000000 +0100
@@ -25,6 +25,7 @@
 	dh_install
 	set -e; for x in symbols tutorials; do \
 		rm -f $$x/listdir.txt; \
-		ls $$x | LC_ALL=C sort > $$x/listdir.txt; \
+		ls $$x | LC_ALL=C sort > $$x/.listdir.txt; \
+		mv $$x/.listdir.txt $$x/listdir.txt; \
 	done
 	jar uMf debian/tunnelx/usr/share/tunnelx/tunnelx.jar symbols/* tutorials/*
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/reproducible-bugs/attachments/20170226/89885449/attachment.sig>


More information about the Reproducible-bugs mailing list