Skip to content

Latest commit

 

History

History
106 lines (75 loc) · 3.81 KB

README.md

File metadata and controls

106 lines (75 loc) · 3.81 KB

Guix

Guix is a transactional package manager much like Nix, but unlike Nix, it has more of a focus on bootstrappability and reproducibility which are attractive for security-sensitive projects like bitcoin.

If you're interested in downloading a pre-built VM and testing Guix (using QEMU), I have a short guide here.

Alpine Guix Dockerfile

Create the alpine_guix image:

DOCKER_BUILDKIT=1 docker build --pull --no-cache -t alpine_guix - < Dockerfile

By default, an image setup to use substitutes will be created.

If you do not want to use substitutes, you can pass --target no-substitutes to the build command

DOCKER_BUILDKIT=1 docker build --pull --no-cache --target no-substitutes -t no_subs - < Dockerfile

You can also override where the docker image fetches the guix binary from with --build-args.

pushd bitcoin
docker build -f Dockerfile \
             --build-arg guix_download_path=https://ftpmirror.gnu.org/gnu/guix/ \
             --build-arg guix_file_name=guix-binary-1.4.0.x86_64-linux.tar.xz \
             --build-arg guix_checksum=236ca7c9c5958b1f396c2924fcc5bc9d6fdebcb1b4cf3c7c6d46d4bf660ed9c9 \
             -t alpine_guix .

Run the alpine_guix container

To exec a guix-daemon (a prerequisite for guix builds):

docker run -it --name alpine_guix --privileged alpine_guix

The daemon will run in the foreground, so don't be alarmed if it hangs (you may see output like accepted connection from pid 2828, user root).

Note the use of --privileged. Read the Docker capabilities documentation before running any image with this flag.

Do a Bitcoin Core build:

Exec into the container:

docker exec -it alpine_guix /bin/bash

Default HOSTS:

x86_64-linux-gnu
arm-linux-gnueabihf
aarch64-linux-gnu
riscv64-linux-gnu
powerpc64-linux-gnu
powerpc64le-linux-gnu
x86_64-w64-mingw32
x86_64-apple-darwin
arm64-apple-darwin

Build:

# Set HOSTS to build for a specific target. i.e
time BASE_CACHE="/base_cache" SOURCE_PATH="/sources" SDK_PATH="/SDKs" HOSTS="x86_64-w64-mingw32" ./contrib/guix/guix-build

Debian Guix Dockerfile

A Debian based Dockerfile is also available, which uses the Debian Guix package.

It can be created using:

DOCKER_BUILDKIT=1 docker build --pull --no-cache -t debian_guix - < debian.Dockerfile

and used the same way as the Alpine container (see above).

Build output

Providing the following information is useful after a successful build:

guix describe
uname -m
find guix-build-$(git rev-parse --short=12 HEAD)/output/ -type f -print0 | env LC_ALL=C sort -z | xargs -r0 sha256sum

Bitcoin Core Guix Package

Bitcoin Core is also available via the Guix package manager.

Submitting an update requires guix hash and fixing any build issues.

Recent Updates: