Skip to content

Commit cd3e947

Browse files
committed
contrib: guix: Various improvements.
- Clearer and more accurate prose - Pin `guix pull' to commit rather than branch - Just use `use-module' instead of `define-module' - Use `bash-minimal' instead of `bash' - Remove unneeded `tcsh' from manifest - Explicitly use `python-3.7' - Add comments about how {native,cross}-toolchains are produced and why
1 parent 8dff3e4 commit cd3e947

File tree

3 files changed

+39
-35
lines changed

3 files changed

+39
-35
lines changed

contrib/guix/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ Conservatively, a x86_64 machine with:
1515

1616
- 2 or more logical cores
1717
- 4GB of free disk space on the partition that /gnu/store will reside in
18-
- 24GB of free disk space on the partition that the bitcoin repository resides in
18+
- 24GB of free disk space on the partition that the Bitcoin Core git repository
19+
resides in
1920

2021
> Note: these requirements are slightly less onerous than those of Gitian builds
2122
@@ -43,7 +44,7 @@ profile. The changes there are slowly being upstreamed.
4344

4445
```sh
4546
guix pull --url=https://github.com/dongcarl/guix.git \
46-
--branch=2019-05-bitcoin-staging \
47+
--commit=82c77e52b8b46e0a3aad2cb12307c2e30547deec \
4748
--max-jobs=4 # change accordingly
4849
```
4950

contrib/guix/guix-build.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ for host in ${HOSTS=i686-linux-gnu x86_64-linux-gnu arm-linux-gnueabihf aarch64-
1919
# Display proper warning when the user interrupts the build
2020
trap 'echo "** INT received while building ${host}, you may want to clean up the relevant output and distsrc-* directories before rebuilding"' INT
2121

22-
# Run the build script 'contrib/guix/build.sh' in the build container
23-
# specified by 'contrib/guix/manifest.scm'
22+
# Run the build script 'contrib/guix/libexec/build.sh' in the build
23+
# container specified by 'contrib/guix/manifest.scm'
2424
# shellcheck disable=SC2086
2525
guix environment --manifest="${PWD}/contrib/guix/manifest.scm" \
2626
--container \

contrib/guix/manifest.scm

Lines changed: 34 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,25 @@
1-
(define-module (bitcoin)
2-
#:use-module (gnu)
3-
#:use-module (gnu packages)
4-
#:use-module (gnu packages autotools)
5-
#:use-module (gnu packages base)
6-
#:use-module (gnu packages bash)
7-
#:use-module (gnu packages check)
8-
#:use-module (gnu packages commencement)
9-
#:use-module (gnu packages compression)
10-
#:use-module (gnu packages cross-base)
11-
#:use-module (gnu packages file)
12-
#:use-module (gnu packages gawk)
13-
#:use-module (gnu packages gcc)
14-
#:use-module (gnu packages linux)
15-
#:use-module (gnu packages perl)
16-
#:use-module (gnu packages pkg-config)
17-
#:use-module (gnu packages python)
18-
#:use-module (gnu packages shells)
19-
#:use-module (guix build-system trivial)
20-
#:use-module (guix gexp)
21-
#:use-module (guix packages)
22-
#:use-module (guix profiles)
23-
#:use-module (guix utils))
1+
(use-modules (gnu)
2+
(gnu packages)
3+
(gnu packages autotools)
4+
(gnu packages base)
5+
(gnu packages bash)
6+
(gnu packages check)
7+
(gnu packages commencement)
8+
(gnu packages compression)
9+
(gnu packages cross-base)
10+
(gnu packages file)
11+
(gnu packages gawk)
12+
(gnu packages gcc)
13+
(gnu packages linux)
14+
(gnu packages perl)
15+
(gnu packages pkg-config)
16+
(gnu packages python)
17+
(gnu packages shells)
18+
(guix build-system trivial)
19+
(guix gexp)
20+
(guix packages)
21+
(guix profiles)
22+
(guix utils))
2423

2524
(define (make-ssp-fixed-gcc xgcc)
2625
"Given a XGCC package, return a modified package that uses the SSP function
@@ -101,7 +100,7 @@ chain for " target " development."))
101100
(license (package-license xgcc)))))
102101

103102
(define* (make-bitcoin-cross-toolchain target
104-
#:optional
103+
#:key
105104
(base-gcc-for-libc gcc-5)
106105
(base-kernel-headers linux-libre-headers-4.19)
107106
(base-libc glibc-2.27)
@@ -117,8 +116,7 @@ desirable for building Bitcoin Core release binaries."
117116

118117
(packages->manifest
119118
(list ;; The Basics
120-
bash
121-
tcsh
119+
bash-minimal
122120
which
123121
coreutils
124122
util-linux
@@ -145,11 +143,16 @@ desirable for building Bitcoin Core release binaries."
145143
pkg-config
146144
;; Scripting
147145
perl
148-
python
149-
;; Toolchains
146+
python-3.7
147+
;; Native gcc 9 toolchain targeting glibc 2.27
150148
(make-gcc-toolchain gcc-9 glibc-2.27)
151-
(make-bitcoin-cross-toolchain "riscv64-linux-gnu" gcc-8)
152-
(make-bitcoin-cross-toolchain "x86_64-linux-gnu")
149+
;; Cross gcc 9 toolchains targeting glibc 2.27
153150
(make-bitcoin-cross-toolchain "i686-linux-gnu")
151+
(make-bitcoin-cross-toolchain "x86_64-linux-gnu")
154152
(make-bitcoin-cross-toolchain "aarch64-linux-gnu")
155-
(make-bitcoin-cross-toolchain "arm-linux-gnueabihf" gcc-6)))
153+
(make-bitcoin-cross-toolchain "arm-linux-gnueabihf")
154+
;; The glibc 2.27 for riscv64 needs gcc 7 to successfully build (see:
155+
;; https://www.gnu.org/software/gcc/gcc-7/changes.html#riscv). The final
156+
;; toolchain is still a gcc 9 toolchain targeting glibc 2.27.
157+
(make-bitcoin-cross-toolchain "riscv64-linux-gnu"
158+
#:base-gcc-for-libc gcc-7)))

0 commit comments

Comments
 (0)