mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-08-25 21:31:47 +02:00
guix: warn SOURCE_DATE_EPOCH set in guix-codesign
Currently there is a warning for this in guix-build, but we also need
one in guix-codesign, otherwise the codesigned hashes are not
reproducible.
Move common functionality into prelude and call the function in both
guix actions.
Github-Pull: #33073
Rebased-From: 1bed0f734b
This commit is contained in:
@@ -73,19 +73,7 @@ mkdir -p "$VERSION_BASE"
|
||||
# SOURCE_DATE_EPOCH should not unintentionally be set
|
||||
################
|
||||
|
||||
if [ -n "$SOURCE_DATE_EPOCH" ] && [ -z "$FORCE_SOURCE_DATE_EPOCH" ]; then
|
||||
cat << EOF
|
||||
ERR: Environment variable SOURCE_DATE_EPOCH is set which may break reproducibility.
|
||||
|
||||
Aborting...
|
||||
|
||||
Hint: You may want to:
|
||||
1. Unset this variable: \`unset SOURCE_DATE_EPOCH\` before rebuilding
|
||||
2. Set the 'FORCE_SOURCE_DATE_EPOCH' environment variable if you insist on
|
||||
using your own epoch
|
||||
EOF
|
||||
exit 1
|
||||
fi
|
||||
check_source_date_epoch
|
||||
|
||||
################
|
||||
# Build directories should not exist
|
||||
|
@@ -67,6 +67,12 @@ EOF
|
||||
exit 1
|
||||
fi
|
||||
|
||||
################
|
||||
# SOURCE_DATE_EPOCH should not unintentionally be set
|
||||
################
|
||||
|
||||
check_source_date_epoch
|
||||
|
||||
################
|
||||
# The codesignature git worktree should not be dirty
|
||||
################
|
||||
|
@@ -21,6 +21,26 @@ check_tools() {
|
||||
done
|
||||
}
|
||||
|
||||
################
|
||||
# SOURCE_DATE_EPOCH should not unintentionally be set
|
||||
################
|
||||
|
||||
check_source_date_epoch() {
|
||||
if [ -n "$SOURCE_DATE_EPOCH" ] && [ -z "$FORCE_SOURCE_DATE_EPOCH" ]; then
|
||||
cat << EOF
|
||||
ERR: Environment variable SOURCE_DATE_EPOCH is set which may break reproducibility.
|
||||
|
||||
Aborting...
|
||||
|
||||
Hint: You may want to:
|
||||
1. Unset this variable: \`unset SOURCE_DATE_EPOCH\` before rebuilding
|
||||
2. Set the 'FORCE_SOURCE_DATE_EPOCH' environment variable if you insist on
|
||||
using your own epoch
|
||||
EOF
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
check_tools cat env readlink dirname basename git
|
||||
|
||||
################
|
||||
|
Reference in New Issue
Block a user