Skip to content

Commit acf4b3b

Browse files
committed
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/)
1 parent c4cce00 commit acf4b3b

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

contrib/guix/libexec/build.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ HOST_CXXFLAGS="$HOST_CFLAGS"
178178
# LDFLAGS
179179
case "$HOST" in
180180
*linux*) HOST_LDFLAGS="-Wl,--as-needed -Wl,--dynamic-linker=$glibc_dynamic_linker -static-libstdc++" ;;
181+
*mingw*) HOST_LDFLAGS="-Wl,--no-insert-timestamp" ;;
181182
esac
182183

183184
# Make $HOST-specific native binaries from depends available in $PATH
@@ -271,10 +272,14 @@ export PATH="${BASEPREFIX}/${HOST}/native/bin:${PATH}"
271272
# for release
272273
case "$HOST" in
273274
*mingw*)
275+
find "${DISTNAME}" -not -name "*.dbg" -print0 \
276+
| xargs -0r touch --no-dereference --date="@${SOURCE_DATE_EPOCH}"
274277
find "${DISTNAME}" -not -name "*.dbg" \
275278
| sort \
276279
| zip -X@ "${OUTDIR}/${DISTNAME}-${HOST//x86_64-w64-mingw32/win64}.zip" \
277280
|| ( rm -f "${OUTDIR}/${DISTNAME}-${HOST//x86_64-w64-mingw32/win64}.zip" && exit 1 )
281+
find "${DISTNAME}" -name "*.dbg" -print0 \
282+
| xargs -0r touch --no-dereference --date="@${SOURCE_DATE_EPOCH}"
278283
find "${DISTNAME}" -name "*.dbg" \
279284
| sort \
280285
| zip -X@ "${OUTDIR}/${DISTNAME}-${HOST//x86_64-w64-mingw32/win64}-debug.zip" \

share/setup.nsi.in

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@ Name "@PACKAGE_NAME@ (64-bit)"
22

33
RequestExecutionLevel highest
44
SetCompressor /SOLID lzma
5+
SetDateSave off
6+
7+
# Uncomment these lines when investigating reproducibility errors
8+
#SetCompress off
9+
#SetDatablockOptimize off
510

611
# General Symbol Definitions
712
!define REGKEY "SOFTWARE\$(^Name)"

0 commit comments

Comments
 (0)