Skip to content

Commit 6833ace

Browse files
committed
build: Move guix time machine to prelude
This deduplicates some code, and enforces consistency of the time machine configuration between scripts.
1 parent 3b08427 commit 6833ace

File tree

3 files changed

+16
-29
lines changed

3 files changed

+16
-29
lines changed

contrib/guix/guix-build

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -234,21 +234,6 @@ host_to_commonname() {
234234
# Determine the reference time used for determinism (overridable by environment)
235235
SOURCE_DATE_EPOCH="${SOURCE_DATE_EPOCH:-$(git -c log.showSignature=false log --format=%at -1)}"
236236

237-
# Execute "$@" in a pinned, possibly older version of Guix, for reproducibility
238-
# across time.
239-
time-machine() {
240-
# shellcheck disable=SC2086
241-
guix time-machine --url=https://git.savannah.gnu.org/git/guix.git \
242-
--commit=ae03f401381e956c4c41b4cf495cbde964fa43d0 \
243-
--cores="$JOBS" \
244-
--keep-failed \
245-
--fallback \
246-
${SUBSTITUTE_URLS:+--substitute-urls="$SUBSTITUTE_URLS"} \
247-
${ADDITIONAL_GUIX_COMMON_FLAGS} ${ADDITIONAL_GUIX_TIMEMACHINE_FLAGS} \
248-
-- "$@"
249-
}
250-
251-
252237
# Precious directories are those which should not be cleaned between successive
253238
# guix builds
254239
depends_precious_dir_names='SOURCES_PATH BASE_CACHE SDK_PATH'

contrib/guix/guix-codesign

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -222,20 +222,6 @@ JOBS="${JOBS:-$(nproc)}"
222222
# Determine the reference time used for determinism (overridable by environment)
223223
SOURCE_DATE_EPOCH="${SOURCE_DATE_EPOCH:-$(git -c log.showSignature=false log --format=%at -1)}"
224224

225-
# Execute "$@" in a pinned, possibly older version of Guix, for reproducibility
226-
# across time.
227-
time-machine() {
228-
# shellcheck disable=SC2086
229-
guix time-machine --url=https://git.savannah.gnu.org/git/guix.git \
230-
--commit=ae03f401381e956c4c41b4cf495cbde964fa43d0 \
231-
--cores="$JOBS" \
232-
--keep-failed \
233-
--fallback \
234-
${SUBSTITUTE_URLS:+--substitute-urls="$SUBSTITUTE_URLS"} \
235-
${ADDITIONAL_GUIX_COMMON_FLAGS} ${ADDITIONAL_GUIX_TIMEMACHINE_FLAGS} \
236-
-- "$@"
237-
}
238-
239225
# Make sure an output directory exists for our builds
240226
OUTDIR_BASE="${OUTDIR_BASE:-${VERSION_BASE}/output}"
241227
mkdir -p "$OUTDIR_BASE"

contrib/guix/libexec/prelude.bash

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,22 @@ EOF
4545
exit 1
4646
fi
4747

48+
################
49+
# Execute "$@" in a pinned, possibly older version of Guix, for reproducibility
50+
# across time.
51+
time-machine() {
52+
# shellcheck disable=SC2086
53+
guix time-machine --url=https://git.savannah.gnu.org/git/guix.git \
54+
--commit=ae03f401381e956c4c41b4cf495cbde964fa43d0 \
55+
--cores="$JOBS" \
56+
--keep-failed \
57+
--fallback \
58+
${SUBSTITUTE_URLS:+--substitute-urls="$SUBSTITUTE_URLS"} \
59+
${ADDITIONAL_GUIX_COMMON_FLAGS} ${ADDITIONAL_GUIX_TIMEMACHINE_FLAGS} \
60+
-- "$@"
61+
}
62+
63+
4864
################
4965
# Set common variables
5066
################

0 commit comments

Comments
 (0)