aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfanquake <fanquake@gmail.com>2022-03-07 14:49:51 +0000
committerfanquake <fanquake@gmail.com>2022-03-07 14:50:36 +0000
commitbda692d246d7a352d4761f850ddbf85d7d95d298 (patch)
tree228ec61c38ee5e0059d165ebec2820f68abfaf86
parent5e49b2a2529adc737175ebdcbf312635c52b05f6 (diff)
parent6833aceac97dd170970338f0bde5029f7d7aaa03 (diff)
Merge bitcoin/bitcoin#24489: build: Move guix time machine to prelude
6833aceac97dd170970338f0bde5029f7d7aaa03 build: Move guix time machine to prelude (laanwj) Pull request description: This deduplicates some code, and enforces consistency of the time machine configuration between scripts. ACKs for top commit: achow101: ACK 6833aceac97dd170970338f0bde5029f7d7aaa03 dongcarl: ACK 6833aceac97dd170970338f0bde5029f7d7aaa03 Tree-SHA512: c02ded154cdb982293101986ef863d46554fc428eb5617bee0288dbef0543f994de5044123ac9958e455d0d24276a1c4512149a10dd1efaca8677c8f6b74b0a9
-rwxr-xr-xcontrib/guix/guix-build15
-rwxr-xr-xcontrib/guix/guix-codesign14
-rw-r--r--contrib/guix/libexec/prelude.bash16
3 files changed, 16 insertions, 29 deletions
diff --git a/contrib/guix/guix-build b/contrib/guix/guix-build
index b38f91f3c7..3f14be7fdd 100755
--- a/contrib/guix/guix-build
+++ b/contrib/guix/guix-build
@@ -234,21 +234,6 @@ host_to_commonname() {
# Determine the reference time used for determinism (overridable by environment)
SOURCE_DATE_EPOCH="${SOURCE_DATE_EPOCH:-$(git -c log.showSignature=false log --format=%at -1)}"
-# Execute "$@" in a pinned, possibly older version of Guix, for reproducibility
-# across time.
-time-machine() {
- # shellcheck disable=SC2086
- guix time-machine --url=https://git.savannah.gnu.org/git/guix.git \
- --commit=ae03f401381e956c4c41b4cf495cbde964fa43d0 \
- --cores="$JOBS" \
- --keep-failed \
- --fallback \
- ${SUBSTITUTE_URLS:+--substitute-urls="$SUBSTITUTE_URLS"} \
- ${ADDITIONAL_GUIX_COMMON_FLAGS} ${ADDITIONAL_GUIX_TIMEMACHINE_FLAGS} \
- -- "$@"
-}
-
-
# Precious directories are those which should not be cleaned between successive
# guix builds
depends_precious_dir_names='SOURCES_PATH BASE_CACHE SDK_PATH'
diff --git a/contrib/guix/guix-codesign b/contrib/guix/guix-codesign
index 8be927bd06..94895d3fee 100755
--- a/contrib/guix/guix-codesign
+++ b/contrib/guix/guix-codesign
@@ -222,20 +222,6 @@ JOBS="${JOBS:-$(nproc)}"
# Determine the reference time used for determinism (overridable by environment)
SOURCE_DATE_EPOCH="${SOURCE_DATE_EPOCH:-$(git -c log.showSignature=false log --format=%at -1)}"
-# Execute "$@" in a pinned, possibly older version of Guix, for reproducibility
-# across time.
-time-machine() {
- # shellcheck disable=SC2086
- guix time-machine --url=https://git.savannah.gnu.org/git/guix.git \
- --commit=ae03f401381e956c4c41b4cf495cbde964fa43d0 \
- --cores="$JOBS" \
- --keep-failed \
- --fallback \
- ${SUBSTITUTE_URLS:+--substitute-urls="$SUBSTITUTE_URLS"} \
- ${ADDITIONAL_GUIX_COMMON_FLAGS} ${ADDITIONAL_GUIX_TIMEMACHINE_FLAGS} \
- -- "$@"
-}
-
# Make sure an output directory exists for our builds
OUTDIR_BASE="${OUTDIR_BASE:-${VERSION_BASE}/output}"
mkdir -p "$OUTDIR_BASE"
diff --git a/contrib/guix/libexec/prelude.bash b/contrib/guix/libexec/prelude.bash
index 1f287e9bbb..086df48fbe 100644
--- a/contrib/guix/libexec/prelude.bash
+++ b/contrib/guix/libexec/prelude.bash
@@ -46,6 +46,22 @@ exit 1
fi
################
+# Execute "$@" in a pinned, possibly older version of Guix, for reproducibility
+# across time.
+time-machine() {
+ # shellcheck disable=SC2086
+ guix time-machine --url=https://git.savannah.gnu.org/git/guix.git \
+ --commit=ae03f401381e956c4c41b4cf495cbde964fa43d0 \
+ --cores="$JOBS" \
+ --keep-failed \
+ --fallback \
+ ${SUBSTITUTE_URLS:+--substitute-urls="$SUBSTITUTE_URLS"} \
+ ${ADDITIONAL_GUIX_COMMON_FLAGS} ${ADDITIONAL_GUIX_TIMEMACHINE_FLAGS} \
+ -- "$@"
+}
+
+
+################
# Set common variables
################