Bug#933834: haskell-devscripts: please make the build reproducible
Chris Lamb
lamby at debian.org
Sun Aug 4 09:39:01 BST 2019
Source: haskell-devscripts
Version: 0.15.0
Severity: wishlist
Tags: patch
User: reproducible-builds at lists.alioth.debian.org
Usertags: timestamps toolchain
X-Debbugs-Cc: reproducible-bugs at lists.alioth.debian.org
Hi,
Whilst working on the Reproducible Builds effort [0] we noticed
that haskell-devscripts is now generating unreproducible packages.
This is due to:
commit 359f53d3a559944b372e1648d9a84757f6aafc24
Author: Clint Adams <clint at debian.org>
Date: Sat Jul 27 11:55:45 2019 -0400
work around old timestamps
diff --git a/Dh_Haskell.sh b/Dh_Haskell.sh
index 46d4e3e..378ab5c 100644
--- a/Dh_Haskell.sh
+++ b/Dh_Haskell.sh
@@ -443,6 +443,16 @@ make_setup_recipe(){
configure_recipe(){
# local PS5=$PS4; PS4=" + configure_recipe> "; set -x
+
+ # dak gets all neurotic about file timestamps older than 1975
+ # new tarballs from Hackage have files with mtimes at the
+ # beginning of the epoch, so work around this pair of silliness
+ # by setting old mtimes to 1998
+ reftime=$(mktemp)
+ touch -d 1975-01-01 "${reftime}"
+ find . \! -newer "${reftime}" -exec touch -d 1998-01-01 {} \;
+ rm "${reftime}"
+
hc=`packages_hc`
However, this breaks reproducible build as it does not specify a
timezone in the second call to touch. You can see this behaviour by
doing something like:
$ for X in Etc/GMT-12 Etc/GMT+12; do
TZ=${X} touch -d 1998-01-01 testcase
stat -c %Y testcase
done
883569600
883656000
^^^^
I suggest that we *also* fix the timezone when setting up the reftime,
otherwise we will inevitably — one day — hit a file in that magic
range in/around the 1997/1998 crossover that will not trigger the
test.
Patch attached that does both.
[0] https://reproducible-builds.org/
Regards,
--
,''`.
: :' : Chris Lamb
`. `'` lamby at debian.org / chris-lamb.co.uk
`-
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: haskell-devscripts.diff.txt
URL: <http://alioth-lists.debian.net/pipermail/pkg-haskell-maintainers/attachments/20190804/70c1a868/attachment-0001.txt>
More information about the Pkg-haskell-maintainers
mailing list