Skip to content

Commit b4cb17f

Browse files
Merge pull request dashpay#5822 from PastaPastaPasta/backport-guix
backport: Guix related backports
2 parents 83ec7f2 + 69737c0 commit b4cb17f

File tree

12 files changed

+124
-96
lines changed

12 files changed

+124
-96
lines changed

.github/workflows/semantic-pull-request.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ jobs:
2828
perf
2929
test
3030
build
31+
guix
3132
ci
3233
chore
3334
revert

CONTRIBUTING.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ include:
131131
- *utils* for changes to the utils and libraries
132132
- *wallet* for changes to the wallet code
133133
- *zmq* for changes to the ZMQ APIs
134+
- *guix* for changes to the GUIX reproducible builds
134135

135136
Examples:
136137

contrib/guix/INSTALL.md

Lines changed: 64 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,11 @@ writing (July 2021). Guix is expected to be more widely packaged over time. For
7272
an up-to-date view on Guix's package status/version across distros, please see:
7373
https://repology.org/project/guix/versions
7474

75-
### Debian 11 (Bullseye)/Ubuntu 21.04 (Hirsute Hippo)
75+
### Debian / Ubuntu
7676

7777
Guix v1.2.0 is available as a distribution package starting in [Debian
7878
11](https://packages.debian.org/bullseye/guix) and [Ubuntu
79-
21.04](https://packages.ubuntu.com/hirsute/guix).
79+
21.04](https://packages.ubuntu.com/search?keywords=guix).
8080

8181
Note that if you intend on using Guix without using any substitutes (more
8282
details [here][security-model]), v1.2.0 has a known problem when building GnuTLS
@@ -167,6 +167,10 @@ For reference, the graphic below outlines Guix v1.3.0's dependency graph:
167167

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

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+
170174
#### Guile
171175

172176
##### Choosing a Guile version and sticking to it
@@ -334,6 +338,8 @@ packages in Debian at the time of writing.
334338
|-----------------------|---------------------|
335339
| guile-gcrypt | libgcrypt-dev |
336340
| guile-git | libgit2-dev |
341+
| guile-gnutls | (none) |
342+
| guile-json | (none) |
337343
| guile-lzlib | liblz-dev |
338344
| guile-ssh | libssh-dev |
339345
| guile-sqlite3 | libsqlite3-dev |
@@ -384,8 +390,9 @@ cd guix
384390
```
385391

386392
You will likely want to build the latest release, however, if the latest release
387-
when you're reading this is still 1.2.0 then you may want to use 95aca29 instead
388-
to avoid a problem in the GnuTLS test suite.
393+
when you're reading this is still 1.3.0 then you may want to use 998eda30 instead
394+
to avoid the issues described in [#25099](
395+
https://github.com/bitcoin/bitcoin/pull/25099).
389396

390397
```
391398
git branch -a -l 'origin/version-*' # check for the latest release
@@ -609,6 +616,8 @@ systemctl enable guix-daemon
609616
systemctl start guix-daemon
610617
```
611618
619+
Remember to set `--no-substitute` in `$libdir/systemd/system/guix-daemon.service` and other customizations if you used them for `guix-daemon-original.service`.
620+
612621
##### If you installed Guix via the Debian/Ubuntu distribution packages
613622
614623
You will need to create a `guix-daemon-latest` service which points to the new
@@ -717,6 +726,19 @@ $ bzcat /var/log/guix/drvs/../...-foo-3.6.12.drv.bz2 | less
717726
times, it may be `/tmp/...drv-1` or `/tmp/...drv-2`. Always consult the build
718727
failure output for the most accurate, up-to-date information.
719728
729+
### openssl-1.1.1l and openssl-1.1.1n
730+
731+
OpenSSL includes tests that will fail once some certificate has expired. A workaround
732+
is to change your system clock:
733+
734+
```sh
735+
sudo timedatectl set-ntp no
736+
sudo date --set "28 may 2022 15:00:00"
737+
sudo --login guix build --cores=1 /gnu/store/g9alz81w4q03ncm542487xd001s6akd4-openssl-1.1.1l.drv
738+
sudo --login guix build --cores=1 /gnu/store/mw6ax0gk33gh082anrdrxp2flrbskxv6-openssl-1.1.1n.drv
739+
sudo timedatectl set-ntp yes
740+
```
741+
720742
### python(-minimal): [Errno 84] Invalid or incomplete multibyte or wide character
721743
722744
This error occurs when your `$TMPDIR` (default: /tmp) exists on a filesystem
@@ -774,15 +796,15 @@ The inotify-dir-create test fails on "remote" filesystems such as overlayfs
774796
as non-remote.
775797
776798
A relatively easy workaround to this is to make sure that a somewhat traditional
777-
filesystem is mounted at `/tmp` (where `guix-daemon` performs its builds). For
799+
filesystem is mounted at `/tmp` (where `guix-daemon` performs its builds), see [/tmp on tmpfs](#consider-tmp-on-tmpfs). For
778800
Docker users, this might mean [using a volume][docker/volumes], [binding
779801
mounting][docker/bind-mnt] from host, or (for those with enough RAM and swap)
780802
[mounting a tmpfs][docker/tmpfs] using the `--tmpfs` flag.
781803
782804
Please see the following links for more details:
783805
784806
- An upstream coreutils bug has been filed: [debbugs#47940](https://debbugs.gnu.org/cgi/bugreport.cgi?bug=47940)
785-
- A Guix bug detailing the underlying problem has been filed: [guix-issues#47935](https://issues.guix.gnu.org/47935)
807+
- A Guix bug detailing the underlying problem has been filed: [guix-issues#47935](https://issues.guix.gnu.org/47935), [guix-issues#49985](https://issues.guix.gnu.org/49985#5)
786808
- A commit to skip this test in Guix has been merged into the core-updates branch:
787809
[savannah/guix@6ba1058](https://git.savannah.gnu.org/cgit/guix.git/commit/?id=6ba1058df0c4ce5611c2367531ae5c3cdc729ab4)
788810
@@ -799,3 +821,39 @@ Please see the following links for more details:
799821
[docker/volumes]: https://docs.docker.com/storage/volumes/
800822
[docker/bind-mnt]: https://docs.docker.com/storage/bind-mounts/
801823
[docker/tmpfs]: https://docs.docker.com/storage/tmpfs/
824+
825+
# Purging/Uninstalling Guix
826+
827+
In the extraordinarily rare case where you messed up your Guix installation in
828+
an irreversible way, you may want to completely purge Guix from your system and
829+
start over.
830+
831+
1. Uninstall Guix itself according to the way you installed it (e.g. `sudo apt
832+
purge guix` for Ubuntu packaging, `sudo make uninstall` for a build from source).
833+
2. Remove all build users and groups
834+
835+
You may check for relevant users and groups using:
836+
837+
```
838+
getent passwd | grep guix
839+
getent group | grep guix
840+
```
841+
842+
Then, you may remove users and groups using:
843+
844+
```
845+
sudo userdel <user>
846+
sudo groupdel <group>
847+
```
848+
849+
3. Remove all possible Guix-related directories
850+
- `/var/guix/`
851+
- `/var/log/guix/`
852+
- `/gnu/`
853+
- `/etc/guix/`
854+
- `/home/*/.config/guix/`
855+
- `/home/*/.cache/guix/`
856+
- `/home/*/.guix-profile/`
857+
- `/root/.config/guix/`
858+
- `/root/.cache/guix/`
859+
- `/root/.guix-profile/`

contrib/guix/README.md

Lines changed: 1 addition & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ https://ci.guix.gnu.org is automatically used unless the `--no-substitutes` flag
382382
is supplied. This default list of substitute servers is overridable both on a
383383
`guix-daemon` level and when you invoke `guix` commands. See examples below for
384384
the various ways of adding dongcarl's substitute server after having [authorized
385-
his signing key](#authorize-the-signing-keys).
385+
his signing key](#step-1-authorize-the-signing-keys).
386386

387387
Change the **default list** of substitute servers by starting `guix-daemon` with
388388
the `--substitute-urls` option (you will likely need to edit your init script):
@@ -430,55 +430,6 @@ used.
430430
If you start `guix-daemon` using an init script, you can edit said script to
431431
supply this flag.
432432

433-
434-
# Purging/Uninstalling Guix
435-
436-
In the extraordinarily rare case where you messed up your Guix installation in
437-
an irreversible way, you may want to completely purge Guix from your system and
438-
start over.
439-
440-
1. Uninstall Guix itself according to the way you installed it (e.g. `sudo apt
441-
purge guix` for Ubuntu packaging, `sudo make uninstall` for a build from source).
442-
2. Remove all build users and groups
443-
444-
You may check for relevant users and groups using:
445-
446-
```
447-
getent passwd | grep guix
448-
getent group | grep guix
449-
```
450-
451-
Then, you may remove users and groups using:
452-
453-
```
454-
sudo userdel <user>
455-
sudo groupdel <group>
456-
```
457-
458-
3. Remove all possible Guix-related directories
459-
- `/var/guix/`
460-
- `/var/log/guix/`
461-
- `/gnu/`
462-
- `/etc/guix/`
463-
- `/home/*/.config/guix/`
464-
- `/home/*/.cache/guix/`
465-
- `/home/*/.guix-profile/`
466-
- `/root/.config/guix/`
467-
- `/root/.cache/guix/`
468-
- `/root/.guix-profile/`
469-
470433
[b17e]: http://bootstrappable.org/
471434
[r12e/source-date-epoch]: https://reproducible-builds.org/docs/source-date-epoch/
472-
473-
[guix/install.sh]: https://git.savannah.gnu.org/cgit/guix.git/plain/etc/guix-install.sh
474-
[guix/bin-install]: https://www.gnu.org/software/guix/manual/en/html_node/Binary-Installation.html
475-
[guix/env-setup]: https://www.gnu.org/software/guix/manual/en/html_node/Build-Environment-Setup.html
476-
[guix/substitutes]: https://www.gnu.org/software/guix/manual/en/html_node/Substitutes.html
477-
[guix/substitute-server-auth]: https://www.gnu.org/software/guix/manual/en/html_node/Substitute-Server-Authorization.html
478-
[guix/time-machine]: https://guix.gnu.org/manual/en/html_node/Invoking-guix-time_002dmachine.html
479-
480-
[debian/guix-bullseye]: https://packages.debian.org/bullseye/guix
481-
[ubuntu/guix-hirsute]: https://packages.ubuntu.com/hirsute/guix
482-
[guix-docker]: https://github.com/dashpay/dash/tree/master/contrib/guix/Dockerfile
483-
484435
[env-vars-list]: #recognized-environment-variables

contrib/guix/guix-attest

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -213,29 +213,28 @@ mkdir -p "$outsigdir"
213213
exit 1
214214
fi
215215

216-
temp_codesigned="$(mktemp)"
217-
trap 'rm -rf -- "$temp_codesigned"' EXIT
216+
temp_all="$(mktemp)"
217+
trap 'rm -rf -- "$temp_all"' EXIT
218218

219219
if (( ${#codesigned_fragments[@]} )); then
220220
# Note: all.SHA256SUMS attests to all of $sha256sum_fragments, but is
221221
# not needed if there are no $codesigned_fragments
222222
cat "${sha256sum_fragments[@]}" \
223223
| sort -u \
224224
| sort -k2 \
225-
| sed 's/$/\r/' \
226225
| basenameify_SHA256SUMS \
227-
> "$temp_codesigned"
228-
if [ -e codesigned.SHA256SUMS ]; then
226+
> "$temp_all"
227+
if [ -e all.SHA256SUMS ]; then
229228
# The SHA256SUMS already exists, make sure it's exactly what we
230229
# expect, error out if not
231-
if diff -u all.SHA256SUMS "$temp_codesigned"; then
230+
if diff -u all.SHA256SUMS "$temp_all"; then
232231
echo "An all.SHA256SUMS file already exists for '${VERSION}' and is up-to-date."
233232
else
234233
shasum_already_exists all.SHA256SUMS
235234
exit 1
236235
fi
237236
else
238-
mv "$temp_codesigned" codesigned.SHA256SUMS
237+
mv "$temp_all" all.SHA256SUMS
239238
fi
240239
else
241240
# It is fine to have the codesigned outputs be missing (perhaps the

contrib/guix/guix-build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ host_to_commonname() {
233233
}
234234

235235
# Determine the reference time used for determinism (overridable by environment)
236-
SOURCE_DATE_EPOCH="${SOURCE_DATE_EPOCH:-$(git log --format=%at -1)}"
236+
SOURCE_DATE_EPOCH="${SOURCE_DATE_EPOCH:-$(git -c log.showSignature=false log --format=%at -1)}"
237237

238238
# Precious directories are those which should not be cleaned between successive
239239
# guix builds

contrib/guix/guix-codesign

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ fi
220220
JOBS="${JOBS:-$(nproc)}"
221221

222222
# Determine the reference time used for determinism (overridable by environment)
223-
SOURCE_DATE_EPOCH="${SOURCE_DATE_EPOCH:-$(git log --format=%at -1)}"
223+
SOURCE_DATE_EPOCH="${SOURCE_DATE_EPOCH:-$(git -c log.showSignature=false log --format=%at -1)}"
224224

225225
# Make sure an output directory exists for our builds
226226
OUTDIR_BASE="${OUTDIR_BASE:-${VERSION_BASE}/output}"

contrib/guix/guix-verify

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,11 @@ cmd_usage() {
2828
cat <<EOF
2929
Synopsis:
3030
31-
env GUIX_SIGS_REPO=<path/to/guix.sigs> ./contrib/guix/guix-verify
31+
env GUIX_SIGS_REPO=<path/to/guix.sigs> [ SIGNER=<signer> ] ./contrib/guix/guix-verify
32+
33+
Example overriding signer's manifest to use as base
34+
35+
env GUIX_SIGS_REPO=/home/dongcarl/guix.sigs SIGNER=achow101 ./contrib/guix/guix-verify
3236
3337
EOF
3438
}
@@ -94,6 +98,17 @@ echo "--------------------"
9498
echo ""
9599
if (( ${#all_noncodesigned[@]} )); then
96100
compare_noncodesigned="${all_noncodesigned[0]}"
101+
if [[ -n "$SIGNER" ]]; then
102+
signer_noncodesigned="$OUTSIGDIR_BASE/$SIGNER/noncodesigned.SHA256SUMS"
103+
if [[ -f "$signer_noncodesigned" ]]; then
104+
echo "Using $SIGNER's manifest as the base to compare against"
105+
compare_noncodesigned="$signer_noncodesigned"
106+
else
107+
echo "Unable to find $SIGNER's manifest, using the first one found"
108+
fi
109+
else
110+
echo "No SIGNER provided, using the first manifest found"
111+
fi
97112

98113
for current_manifest in "${all_noncodesigned[@]}"; do
99114
verify "$compare_noncodesigned" "$current_manifest"
@@ -114,6 +129,17 @@ echo "--------------------"
114129
echo ""
115130
if (( ${#all_all[@]} )); then
116131
compare_all="${all_all[0]}"
132+
if [[ -n "$SIGNER" ]]; then
133+
signer_all="$OUTSIGDIR_BASE/$SIGNER/all.SHA256SUMS"
134+
if [[ -f "$signer_all" ]]; then
135+
echo "Using $SIGNER's manifest as the base to compare against"
136+
compare_all="$signer_all"
137+
else
138+
echo "Unable to find $SIGNER's manifest, using the first one found"
139+
fi
140+
else
141+
echo "No SIGNER provided, using the first manifest found"
142+
fi
117143

118144
for current_manifest in "${all_all[@]}"; do
119145
verify "$compare_all" "$current_manifest"

contrib/guix/libexec/build.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -207,9 +207,9 @@ make -C depends --jobs="$JOBS" HOST="$HOST" \
207207
${SDK_PATH+SDK_PATH="$SDK_PATH"} \
208208
x86_64_linux_CC=x86_64-linux-gnu-gcc \
209209
x86_64_linux_CXX=x86_64-linux-gnu-g++ \
210-
x86_64_linux_AR=x86_64-linux-gnu-ar \
211-
x86_64_linux_RANLIB=x86_64-linux-gnu-ranlib \
212-
x86_64_linux_NM=x86_64-linux-gnu-nm \
210+
x86_64_linux_AR=x86_64-linux-gnu-gcc-ar \
211+
x86_64_linux_RANLIB=x86_64-linux-gnu-gcc-ranlib \
212+
x86_64_linux_NM=x86_64-linux-gnu-gcc-nm \
213213
x86_64_linux_STRIP=x86_64-linux-gnu-strip \
214214
qt_config_opts_x86_64_linux='-platform linux-g++ -xplatform bitcoin-linux-g++' \
215215
FORCE_USE_SYSTEM_CLANG=1

0 commit comments

Comments
 (0)