Skip to content

Commit 82ba0f8

Browse files
committed
Merge bitcoin/bitcoin#28962: doc: Rework guix docs after 1.4 release
fad444f doc: Rework guix docs after 1.4 release (MarcoFalke) Pull request description: Follow-up to bitcoin/bitcoin#28902 Fixes bitcoin/bitcoin#28957 ACKs for top commit: TheCharlatan: ACK fad444f fanquake: ACK fad444f Tree-SHA512: 23f270b438ede4e3173da68e63c1d022e2ef23bfd83f0ec038ec63a62348038722278385c5dac63ac29a460b4b61f23d8c9939667e00a1a3571b041d3eecb4cb
2 parents 04978c2 + fad444f commit 82ba0f8

File tree

2 files changed

+63
-108
lines changed

2 files changed

+63
-108
lines changed

contrib/guix/INSTALL.md

Lines changed: 62 additions & 107 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,6 @@ so you should log out and log back in.
6262
Please refer to fanquake's instructions
6363
[here](https://github.com/fanquake/core-review/tree/master/guix).
6464

65-
Note that the `Dockerfile` is largely equivalent to running through the binary
66-
tarball installation steps.
67-
6865
## Option 4: Using a distribution-maintained package
6966

7067
Note that this section is based on the distro packaging situation at the time of
@@ -74,25 +71,15 @@ https://repology.org/project/guix/versions
7471

7572
### Debian / Ubuntu
7673

77-
Guix v1.2.0 is available as a distribution package starting in [Debian
78-
11](https://packages.debian.org/bullseye/guix) and [Ubuntu
79-
21.04](https://packages.ubuntu.com/search?keywords=guix).
80-
81-
Note that if you intend on using Guix without using any substitutes (more
82-
details [here][security-model]), v1.2.0 has a known problem when building GnuTLS
83-
from source. Solutions and workarounds are documented
84-
[here](#gnutls-test-suite-fail-status-request-revoked).
85-
74+
Guix is available as a distribution package in [Debian
75+
](https://packages.debian.org/search?keywords=guix) and [Ubuntu
76+
](https://packages.ubuntu.com/search?keywords=guix).
8677

8778
To install:
8879
```sh
8980
sudo apt install guix
9081
```
9182

92-
For up-to-date information on Debian and Ubuntu's release history:
93-
- [Debian release history](https://www.debian.org/releases/)
94-
- [Ubuntu release history](https://ubuntu.com/about/release-cycle)
95-
9683
### Arch Linux
9784

9885
Guix is available in the AUR as
@@ -167,80 +154,41 @@ For reference, the graphic below outlines Guix v1.3.0's dependency graph:
167154

168155
![bootstrap map](https://user-images.githubusercontent.com/6399679/125064185-a9a59880-e0b0-11eb-82c1-9b8e5dc9950d.png)
169156

170-
#### Consider /tmp on tmpfs
171-
172-
If you use an NVME (SSD) drive, you may encounter [cryptic build errors](#coreutils-fail-teststail-2inotify-dir-recreate). Mounting a [tmpfs at /tmp](https://ubuntu.com/blog/data-driven-analysis-tmp-on-tmpfs) should prevent this and may improve performance as a bonus.
173-
174-
#### Guile
175-
176-
##### Choosing a Guile version and sticking to it
177-
178-
One of the first things you need to decide is which Guile version you want to
179-
use: Guile v2.2 or Guile v3.0. Unlike the python2 to python3 transition, Guile
180-
v2.2 and Guile v3.0 are largely compatible, as evidenced by the fact that most
181-
Guile packages and even [Guix
182-
itself](https://guix.gnu.org/en/blog/2020/guile-3-and-guix/) support running on
183-
both.
184-
185-
What is important here is that you **choose one**, and you **remain consistent**
186-
with your choice throughout **all Guile-related packages**, no matter if they
187-
are installed via the distribution's package manager or installed from source.
188-
This is because the files for Guile packages are installed to directories which
189-
are separated based on the Guile version.
190-
191-
###### Example: Checking that Ubuntu's `guile-git` is compatible with your chosen Guile version
192-
193-
On Ubuntu Focal:
157+
If you do not care about building each dependency from source, and Guix is
158+
already packaged for your distribution, you can easily install only the build
159+
dependencies of Guix. For example, to enable deb-src and install the Guix build
160+
dependencies on Ubuntu/Debian:
194161

195162
```sh
196-
$ apt show guile-git
197-
Package: guile-git
198-
...
199-
Depends: guile-2.2, guile-bytestructures, libgit2-dev
200-
...
163+
sed -i 's|# deb-src|deb-src|g' /etc/apt/sources.list
164+
apt update
165+
apt-get build-dep -y guix
201166
```
202167

203-
As you can see, the package `guile-git` depends on `guile-2.2`, meaning that it
204-
was likely built for Guile v2.2. This means that if you decided to use Guile
205-
v3.0 on Ubuntu Focal, you would need to build guile-git from source instead of
206-
using the distribution package.
168+
If this succeeded, you can likely skip to section
169+
["Building and Installing Guix itself"](#building-and-installing-guix-itself).
207170

208-
On Ubuntu Hirsute:
209-
210-
```sh
211-
$ apt show guile-git
212-
Package: guile-git
213-
...
214-
Depends: guile-3.0 | guile-2.2, guile-bytestructures (>= 1.0.7-3~), libgit2-dev (>= 1.0)
215-
...
216-
```
217-
218-
In this case, `guile-git` depends on either `guile-3.0` or `guile-2.2`, meaning
219-
that it would work no matter what Guile version you decided to use.
171+
#### Guile
220172

221173
###### Corner case: Multiple versions of Guile on one system
222174

223-
It is recommended to only install one version of Guile, so that build systems do
175+
It is recommended to only install the required version of Guile, so that build systems do
224176
not get confused about which Guile to use.
225177

226-
However, if you insist on having both Guile v2.2 and Guile v3.0 installed on
227-
your system, then you need to **consistently** specify one of
228-
`GUILE_EFFECTIVE_VERSION=3.0` or `GUILE_EFFECTIVE_VERSION=2.2` to all
178+
However, if you insist on having more versions of Guile installed on
179+
your system, then you need to **consistently** specify
180+
`GUILE_EFFECTIVE_VERSION=3.0` to all
229181
`./configure` invocations for Guix and its dependencies.
230182

231183
##### Installing Guile
232184

233-
Guile is most likely already packaged for your distribution, so after you have
234-
[chosen a Guile version](#choosing-a-guile-version-and-sticking-to-it), install
235-
it via your distribution's package manager.
236-
237185
If your distribution splits packages into `-dev`-suffixed and
238186
non-`-dev`-suffixed sub-packages (as is the case for Debian-derived
239187
distributions), please make sure to install both. For example, to install Guile
240-
v2.2 on Debian/Ubuntu:
188+
v3.0 on Debian/Ubuntu:
241189

242190
```sh
243-
apt install guile-2.2 guile-2.2-dev
191+
apt install guile-3.0 guile-3.0-dev
244192
```
245193

246194
#### Mixing distribution packages and source-built packages
@@ -258,16 +206,16 @@ source-built packages, you will need to augment the `GUILE_LOAD_PATH` and
258206
`GUILE_LOAD_COMPILED_PATH` environment variables so that Guile will look
259207
under the right prefix and find your source-built packages.
260208

261-
For example, if you are using Guile v2.2, and have Guile packages in the
209+
For example, if you are using Guile v3.0, and have Guile packages in the
262210
`/usr/local` prefix, either add the following lines to your `.profile` or
263211
`.bash_profile` so that the environment variable is properly set for all future
264212
shell logins, or paste the lines into a POSIX-style shell to temporarily modify
265213
the environment variables of your current shell session.
266214

267215
```sh
268-
# Help Guile v2.2.x find packages in /usr/local
269-
export GUILE_LOAD_PATH="/usr/local/share/guile/site/2.2${GUILE_LOAD_PATH:+:}$GUILE_LOAD_PATH"
270-
export GUILE_LOAD_COMPILED_PATH="/usr/local/lib/guile/2.2/site-ccache${GUILE_LOAD_COMPILED_PATH:+:}$GUILE_COMPILED_LOAD_PATH"
216+
# Help Guile v3.0.x find packages in /usr/local
217+
export GUILE_LOAD_PATH="/usr/local/share/guile/site/3.0${GUILE_LOAD_PATH:+:}$GUILE_LOAD_PATH"
218+
export GUILE_LOAD_COMPILED_PATH="/usr/local/lib/guile/3.0/site-ccache${GUILE_LOAD_COMPILED_PATH:+:}$GUILE_COMPILED_LOAD_PATH"
271219
```
272220

273221
Note that these environment variables are used to check for packages during
@@ -352,7 +300,7 @@ Relevant for:
352300
- Those installing `guile-git` from their distribution where `guile-git` is
353301
built against `libgit2 < 1.1`
354302

355-
As of v0.4.0, `guile-git` claims to only require `libgit2 >= 0.28.0`, however,
303+
As of v0.5.2, `guile-git` claims to only require `libgit2 >= 0.28.0`, however,
356304
it actually requires `libgit2 >= 1.1`, otherwise, it will be confused by a
357305
reference of `origin/keyring`: instead of interpreting the reference as "the
358306
'keyring' branch of the 'origin' remote", the reference is interpreted as "the
@@ -366,20 +314,6 @@ Should you be in this situation, you need to build both `libgit2 v1.1.x` and
366314

367315
Source: https://logs.guix.gnu.org/guix/2020-11-12.log#232527
368316

369-
##### `{scheme,guile}-bytestructures` v1.0.8 and v1.0.9 are broken for Guile v2.2
370-
371-
Relevant for:
372-
- Those building `{scheme,guile}-bytestructures` from source against Guile v2.2
373-
374-
Commit
375-
[707eea3](https://github.com/TaylanUB/scheme-bytestructures/commit/707eea3a85e1e375e86702229ebf73d496377669)
376-
introduced a regression for Guile v2.2 and was first included in v1.0.8, this
377-
was later corrected in commit
378-
[ec9a721](https://github.com/TaylanUB/scheme-bytestructures/commit/ec9a721957c17bcda13148f8faa5f06934431ff7)
379-
and included in v1.1.0.
380-
381-
TL;DR If you decided to use Guile v2.2, do not use `{scheme,guile}-bytestructures` v1.0.8 or v1.0.9.
382-
383317
### Building and Installing Guix itself
384318

385319
Start by cloning Guix:
@@ -390,6 +324,7 @@ cd guix
390324
```
391325

392326
You will likely want to build the latest release.
327+
At the time of writing (November 2023), the latest release was `v1.4.0`.
393328

394329
```
395330
git branch -a -l 'origin/version-*' # check for the latest release
@@ -723,26 +658,18 @@ $ bzcat /var/log/guix/drvs/../...-foo-3.6.12.drv.bz2 | less
723658
times, it may be `/tmp/...drv-1` or `/tmp/...drv-2`. Always consult the build
724659
failure output for the most accurate, up-to-date information.
725660
726-
### openssl-1.1.1l and openssl-1.1.1n
727-
728-
OpenSSL includes tests that will fail once some certificate has expired. A workaround
729-
is to change your system clock:
730-
731-
```sh
732-
sudo timedatectl set-ntp no
733-
sudo date --set "28 may 2022 15:00:00"
734-
sudo --login guix build --cores=1 /gnu/store/g9alz81w4q03ncm542487xd001s6akd4-openssl-1.1.1l.drv
735-
sudo --login guix build --cores=1 /gnu/store/mw6ax0gk33gh082anrdrxp2flrbskxv6-openssl-1.1.1n.drv
736-
sudo timedatectl set-ntp yes
737-
```
738-
739661
### python(-minimal): [Errno 84] Invalid or incomplete multibyte or wide character
740662
741663
This error occurs when your `$TMPDIR` (default: /tmp) exists on a filesystem
742664
which rejects characters not present in the UTF-8 character code set. An example
743665
is ZFS with the utf8only=on option set.
744666
745-
More information: https://bugs.python.org/issue37584
667+
More information: https://github.com/python/cpython/issues/81765
668+
669+
### openssl-1.1.1l and openssl-1.1.1n
670+
671+
OpenSSL includes tests that will fail once some certificate has expired.
672+
The workarounds from the GnuTLS section immediately below can be used.
746673
747674
### GnuTLS: test-suite FAIL: status-request-revoked
748675
@@ -778,13 +705,41 @@ authorized.
778705
This workaround was described [here](https://issues.guix.gnu.org/44559#5).
779706
780707
Basically:
781-
1. Turn off networking
782708
2. Turn off NTP
783709
3. Set system time to 2020-10-01
784710
4. guix build --no-substitutes /gnu/store/vhphki5sg9xkdhh2pbc8gi6vhpfzryf0-gnutls-3.6.12.drv
785711
5. Set system time back to accurate current time
786712
6. Turn NTP back on
787-
7. Turn networking back on
713+
714+
For example,
715+
716+
```sh
717+
sudo timedatectl set-ntp no
718+
sudo date --set "01 oct 2020 15:00:00"
719+
guix build /gnu/store/vhphki5sg9xkdhh2pbc8gi6vhpfzryf0-gnutls-3.6.12.drv
720+
sudo timedatectl set-ntp yes
721+
```
722+
723+
#### Workaround 3: Disable the tests in the Guix source code for this single derivation
724+
725+
If all of the above workarounds fail, you can also disable the `tests` phase of
726+
the derivation via the `arguments` option, as described in the official
727+
[`package`
728+
reference](https://guix.gnu.org/manual/en/html_node/package-Reference.html).
729+
730+
For example, to disable the openssl-1.1 check phase:
731+
732+
```diff
733+
diff --git a/gnu/packages/tls.scm b/gnu/packages/tls.scm
734+
index f1e844b..1077c4b 100644
735+
--- a/gnu/packages/tls.scm
736+
+++ b/gnu/packages/tls.scm
737+
@@ -494,4 +494,5 @@ (define-public openssl-1.1
738+
(arguments
739+
`(#:parallel-tests? #f
740+
+ #:tests? #f
741+
#:test-target "test"
742+
```
788743
789744
### coreutils: FAIL: tests/tail-2/inotify-dir-recreate
790745
@@ -793,7 +748,7 @@ The inotify-dir-create test fails on "remote" filesystems such as overlayfs
793748
as non-remote.
794749
795750
A relatively easy workaround to this is to make sure that a somewhat traditional
796-
filesystem is mounted at `/tmp` (where `guix-daemon` performs its builds), see [/tmp on tmpfs](#consider-tmp-on-tmpfs). For
751+
filesystem is mounted at `/tmp` (where `guix-daemon` performs its builds). For
797752
Docker users, this might mean [using a volume][docker/volumes], [binding
798753
mounting][docker/bind-mnt] from host, or (for those with enough RAM and swap)
799754
[mounting a tmpfs][docker/tmpfs] using the `--tmpfs` flag.

contrib/guix/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ We achieve bootstrappability by using Guix as a functional package manager.
1111

1212
# Requirements
1313

14-
Conservatively, you will need an x86_64 machine with:
14+
Conservatively, you will need:
1515

1616
- 16GB of free disk space on the partition that /gnu/store will reside in
1717
- 8GB of free disk space **per platform triple** you're planning on building

0 commit comments

Comments
 (0)