Skip to content

Commit fe39050

Browse files
committed
Merge bitcoin/bitcoin#32678: guix: warn and abort when SOURCE_DATE_EPOCH is set
5c4a0f8 guix: warn and abort when SOURCE_DATE_EPOCH is set (will) Pull request description: Fixes: #29935 Current behaviour will by-default use SOURCE_DATE_EPOCH from the environment without warning. This breaks the default reproducibility from a guix build. Warn when and exit when this variable is set, and FORCE_SOURCE_DATE_EPOCH is unset. ACKs for top commit: maflcko: lgtm ACK 5c4a0f8 fanquake: ACK 5c4a0f8 Tree-SHA512: fdd6095a91bd87ffdc22918dc43869edc2380501d1b047e95caadd8a6624928691bfe5b7af9693177cbc28e69366e3397e43a06f2f346cc3a9fe233b7fb9588f
2 parents 692fe28 + 5c4a0f8 commit fe39050

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

contrib/guix/guix-build

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,24 @@ fi
6969

7070
mkdir -p "$VERSION_BASE"
7171

72+
################
73+
# SOURCE_DATE_EPOCH should not unintentionally be set
74+
################
75+
76+
if [ -n "$SOURCE_DATE_EPOCH" ] && [ -z "$FORCE_SOURCE_DATE_EPOCH" ]; then
77+
cat << EOF
78+
ERR: Environment variable SOURCE_DATE_EPOCH is set which may break reproducibility.
79+
80+
Aborting...
81+
82+
Hint: You may want to:
83+
1. Unset this variable: \`unset SOURCE_DATE_EPOCH\` before rebuilding
84+
2. Set the 'FORCE_SOURCE_DATE_EPOCH' environment variable if you insist on
85+
using your own epoch
86+
EOF
87+
exit 1
88+
fi
89+
7290
################
7391
# Build directories should not exist
7492
################

0 commit comments

Comments
 (0)