Skip to content

Commit 3774281

Browse files
committed
Merge #17933: guix: Pin Guix using guix time-machine
88c8363 guix: Update documentation for time-machine (Carl Dong) e605088 guix: Pin Guix using `guix time-machine` (Carl Dong) Pull request description: An alternative to #16519, pinning our version of Guix and eliminating a `guix pull` and changing the default Guix profile of builders. I think this method might be superior, as it: - Eliminates the possibility of future changes to the `guix environment` command line interface breaking our builds - Eliminates the need to set up a separate channel repo It is a more general pinning solution than #16519. ----- The reason why I didn't originally propose this is because `guix time-machine` is a recent addition to Guix, only available since `f675f8dec73d02e319e607559ed2316c299ae8c7` ACKs for top commit: fanquake: ACK 88c8363 Tree-SHA512: 85e03b0987ffa86da73e02801e1cd8b7622698d70c4ba4e60561611be1e9717d661c2811a59b3e137b1b8eef2d0ba37c313867d035ebc89c3bd06a23a078064a
2 parents b89f2d0 + 88c8363 commit 3774281

File tree

2 files changed

+27
-22
lines changed

2 files changed

+27
-22
lines changed

contrib/guix/README.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -62,15 +62,16 @@ Likewise, to perform a bootstrapped build (takes even longer):
6262
export ADDITIONAL_GUIX_ENVIRONMENT_FLAGS='--bootstrap --no-substitutes'
6363
```
6464

65-
### Using the right Guix
65+
### Using a version of Guix with `guix time-machine` capabilities
6666

67-
Once Guix is installed, deploy our patched version into your current Guix
68-
profile. The changes there are slowly being upstreamed.
67+
> Note: This entire section can be skipped if you are already using a version of
68+
> Guix that has [the `guix time-machine` command][guix/time-machine].
69+
70+
Once Guix is installed, if it doesn't have the `guix time-machine` command, pull
71+
the latest `guix`.
6972

7073
```sh
71-
guix pull --url=https://github.com/dongcarl/guix.git \
72-
--commit=82c77e52b8b46e0a3aad2cb12307c2e30547deec \
73-
--max-jobs=4 # change accordingly
74+
guix pull --max-jobs=4 # change number of jobs accordingly
7475
```
7576

7677
Make sure that you are using your current profile. (You are prompted to do this
@@ -80,9 +81,6 @@ at the end of the `guix pull`)
8081
export PATH="${HOME}/.config/guix/current/bin${PATH:+:}$PATH"
8182
```
8283

83-
> Note: There is ongoing work to eliminate this entire section using Guix
84-
> [inferiors][guix/inferiors] and [channels][guix/channels].
85-
8684
## Usage
8785

8886
### As a Development Environment
@@ -224,6 +222,7 @@ repository and will likely put one up soon.
224222
[guix/substitute-server-auth]: https://www.gnu.org/software/guix/manual/en/html_node/Substitute-Server-Authorization.html
225223
[guix/inferiors]: https://www.gnu.org/software/guix/manual/en/html_node/Inferiors.html
226224
[guix/channels]: https://www.gnu.org/software/guix/manual/en/html_node/Channels.html
225+
[guix/time-machine]: https://guix.gnu.org/manual/en/html_node/Invoking-guix-time_002dmachine.html
227226

228227
[debian/guix-package]: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=850644
229228
[fanquake/guix-docker]: https://github.com/fanquake/core-review/tree/master/guix

contrib/guix/guix-build.sh

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ make -C "${PWD}/depends" -j"$MAX_JOBS" download ${V:+V=1} ${SOURCES_PATH:+SOURCE
1313
# Determine the reference time used for determinism (overridable by environment)
1414
SOURCE_DATE_EPOCH="${SOURCE_DATE_EPOCH:-$(git log --format=%at -1)}"
1515

16+
time-machine() {
17+
guix time-machine --url=https://github.com/dongcarl/guix.git \
18+
--commit=b3a7c72c8b2425f8ddb0fc6e3b1caeed40f86dee \
19+
-- "$@"
20+
}
21+
1622
# Deterministically build Bitcoin Core for HOSTs (overriable by environment)
1723
for host in ${HOSTS=i686-linux-gnu x86_64-linux-gnu arm-linux-gnueabihf aarch64-linux-gnu riscv64-linux-gnu}; do
1824

@@ -22,18 +28,18 @@ for host in ${HOSTS=i686-linux-gnu x86_64-linux-gnu arm-linux-gnueabihf aarch64-
2228
# Run the build script 'contrib/guix/libexec/build.sh' in the build
2329
# container specified by 'contrib/guix/manifest.scm'
2430
# shellcheck disable=SC2086
25-
guix environment --manifest="${PWD}/contrib/guix/manifest.scm" \
26-
--container \
27-
--pure \
28-
--no-cwd \
29-
--share="$PWD"=/bitcoin \
30-
${SOURCES_PATH:+--share="$SOURCES_PATH"} \
31-
${ADDITIONAL_GUIX_ENVIRONMENT_FLAGS} \
32-
-- env HOST="$host" \
33-
MAX_JOBS="$MAX_JOBS" \
34-
SOURCE_DATE_EPOCH="${SOURCE_DATE_EPOCH:?unable to determine value}" \
35-
${V:+V=1} \
36-
${SOURCES_PATH:+SOURCES_PATH="$SOURCES_PATH"} \
37-
bash -c "cd /bitcoin && bash contrib/guix/libexec/build.sh"
31+
time-machine environment --manifest="${PWD}/contrib/guix/manifest.scm" \
32+
--container \
33+
--pure \
34+
--no-cwd \
35+
--share="$PWD"=/bitcoin \
36+
${SOURCES_PATH:+--share="$SOURCES_PATH"} \
37+
${ADDITIONAL_GUIX_ENVIRONMENT_FLAGS} \
38+
-- env HOST="$host" \
39+
MAX_JOBS="$MAX_JOBS" \
40+
SOURCE_DATE_EPOCH="${SOURCE_DATE_EPOCH:?unable to determine value}" \
41+
${V:+V=1} \
42+
${SOURCES_PATH:+SOURCES_PATH="$SOURCES_PATH"} \
43+
bash -c "cd /bitcoin && bash contrib/guix/libexec/build.sh"
3844

3945
done

0 commit comments

Comments
 (0)