Source: mcomix Version: 1.2.1mcomix3+git20200122-1 Severity: wishlist Tags: patch User: reproducible-bui...@lists.alioth.debian.org Usertags: filesystem X-Debbugs-Cc: reproducible-b...@lists.alioth.debian.org
Hi, Whilst working on the Reproducible Builds effort [0] I noticed that mcomix could not be built reproducibly. Specifically, variations were observed between the modification times of the /usr/share/mcomix directory between two builds: - 2020-01-22 05:02:54 + 2020-01-17 13:20:55 The first of these is the time taken the latest entry in the Debian changelog via the SOURCE_DATE_EPOCH[1] mechanism and the second is upstream's original timestamp. After some investigation I discovered that this was due to the nondeterministic ordering of files in UNIX filesystems: upstream's installer.py script was attempting to ensure that generated GNU gettext .po files were created in directories that inherited the original timestamps around them. However, if these .po files happened to be processed for install before, for example, the Python scripts, due to the order in which they existed on the filesystem, then it would inherit a different timestamp and result in the variation seen above. This non-intuitive result has — of course — a trivial-looking fix, namely to ensure that upstreams's installer.py script recurses into any subdirectories in a sorted and thus determinstic order: def scandir(root,dest,pool=None): for r,dl,fl in walk(root): + dl.sort() for f in fl: yield r,f,dest,pool [0] https://reproducible-builds.org/ [1] https://reproducible-builds.org/specs/source-date-epoch/ Regards, -- ,''`. : :' : Chris Lamb `. `'` la...@debian.org / chris-lamb.co.uk `-
--- a/debian/patches/reproducible-build.patch 1970-01-01 01:00:00.000000000 +0100 --- b/debian/patches/reproducible-build.patch 2020-01-23 15:49:59.572926655 +0000 @@ -0,0 +1,14 @@ +Description: Make the build reproducible +Author: Chris Lamb <la...@debian.org> +Last-Update: 2020-01-23 + +--- mcomix-1.2.1mcomix3+git20200122.orig/installer.py ++++ mcomix-1.2.1mcomix3+git20200122/installer.py +@@ -61,6 +61,7 @@ def install(srcdir,filename,target,pool) + + def scandir(root,dest,pool=None): + for r,dl,fl in walk(root): ++ dl.sort() + for f in fl: + yield r,f,dest,pool + --- a/debian/patches/series 2020-01-23 15:19:31.120441310 +0000 --- b/debian/patches/series 2020-01-23 15:27:00.106822832 +0000 @@ -0,0 +1 @@ +reproducible-build.patch --- a/installer.py 2020-01-23 15:19:31.120441310 +0000 --- b/installer.py 2020-01-23 15:49:58.524896459 +0000 @@ -61,6 +61,7 @@ def scandir(root,dest,pool=None): for r,dl,fl in walk(root): + dl.sort() for f in fl: yield r,f,dest,pool