aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Dong <[email protected]>2020-02-13 15:52:44 -0500
committerCarl Dong <[email protected]>2020-04-02 17:19:57 -0400
commitacf4b3b3b5accf60a19441a0298ef27001b78e72 (patch)
treed97778609e21b8a8d2bafa9397a742a21490d1aa
parentguix: Remove dead links from README. (diff)
downloaddiscoin-acf4b3b3b5accf60a19441a0298ef27001b78e72.tar.xz
discoin-acf4b3b3b5accf60a19441a0298ef27001b78e72.zip
guix: Make x86_64-w64-mingw32 builds reproducible
- Add "--no-insert-timestamp" LDFLAG for x86_64-w64-mingw32 builds "The option --no-insert-timestamp can be used to insert a zero value for the timestamp, this ensuring that binaries produced from identical sources will compare identically." - ld(1) - Set "SetDateSave off" in NSIS script From https://nsis.sourceforge.io/Docs/Chapter4.html#flags "This command sets the file date/time saving flag which is used by the File command to determine whether or not to save the last write date and time of the file, so that it can be restored on installation. Valid flags are 'on' and 'off'. 'on' is the default." - Add commented out NSIS options for reproducibility debugging in NSIS script - Make ZIPs deterministic by reseting file modification times to SOURCE_DATE_EPOCH using touch(1) (Reference: https://reproducible-builds.org/docs/archives/)
-rw-r--r--contrib/guix/libexec/build.sh5
-rw-r--r--share/setup.nsi.in5
2 files changed, 10 insertions, 0 deletions
diff --git a/contrib/guix/libexec/build.sh b/contrib/guix/libexec/build.sh
index bb3917b86..a970eaa62 100644
--- a/contrib/guix/libexec/build.sh
+++ b/contrib/guix/libexec/build.sh
@@ -178,6 +178,7 @@ HOST_CXXFLAGS="$HOST_CFLAGS"
# LDFLAGS
case "$HOST" in
*linux*) HOST_LDFLAGS="-Wl,--as-needed -Wl,--dynamic-linker=$glibc_dynamic_linker -static-libstdc++" ;;
+ *mingw*) HOST_LDFLAGS="-Wl,--no-insert-timestamp" ;;
esac
# Make $HOST-specific native binaries from depends available in $PATH
@@ -271,10 +272,14 @@ export PATH="${BASEPREFIX}/${HOST}/native/bin:${PATH}"
# for release
case "$HOST" in
*mingw*)
+ find "${DISTNAME}" -not -name "*.dbg" -print0 \
+ | xargs -0r touch --no-dereference --date="@${SOURCE_DATE_EPOCH}"
find "${DISTNAME}" -not -name "*.dbg" \
| sort \
| zip -X@ "${OUTDIR}/${DISTNAME}-${HOST//x86_64-w64-mingw32/win64}.zip" \
|| ( rm -f "${OUTDIR}/${DISTNAME}-${HOST//x86_64-w64-mingw32/win64}.zip" && exit 1 )
+ find "${DISTNAME}" -name "*.dbg" -print0 \
+ | xargs -0r touch --no-dereference --date="@${SOURCE_DATE_EPOCH}"
find "${DISTNAME}" -name "*.dbg" \
| sort \
| zip -X@ "${OUTDIR}/${DISTNAME}-${HOST//x86_64-w64-mingw32/win64}-debug.zip" \
diff --git a/share/setup.nsi.in b/share/setup.nsi.in
index dd9ee54d6..4b2903a7c 100644
--- a/share/setup.nsi.in
+++ b/share/setup.nsi.in
@@ -2,6 +2,11 @@ Name "@PACKAGE_NAME@ (64-bit)"
RequestExecutionLevel highest
SetCompressor /SOLID lzma
+SetDateSave off
+
+# Uncomment these lines when investigating reproducibility errors
+#SetCompress off
+#SetDatablockOptimize off
# General Symbol Definitions
!define REGKEY "SOFTWARE\$(^Name)"