forked from bitcoin/bitcoin
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
contrib: create container for interactive guix builds
- Loading branch information
Showing
6 changed files
with
85 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# syntax = edrevo/dockerfile-plus | ||
|
||
FROM alpine:3.17 | ||
|
||
INCLUDE+ Dockerfile.base | ||
|
||
ENV PATH /root/.local/bin:$PATH | ||
RUN mkdir -p /root/.local/bin | ||
|
||
COPY ./extras/motd.txt /etc/motd | ||
COPY ./extras/entrypoint /root/.local/bin/entrypoint | ||
COPY ./extras/guix-check /root/.local/bin/guix-check | ||
COPY ./extras/guix-start /root/.local/bin/guix-start | ||
|
||
ENTRYPOINT ["/root/.local/bin/entrypoint"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Note: Using 'docker compose up' will leave you hanging, you need | ||
# to use 'docker compose run guix-alpine' to drop into an | ||
# interactive shell | ||
|
||
version: "3.9" | ||
services: | ||
guix-alpine: | ||
network_mode: host | ||
build: | ||
context: '.' | ||
dockerfile: './Dockerfile.local' | ||
tty: true # Equivalent to -t | ||
stdin_open: true # Equivalent to -i | ||
privileged: true # Needed for Guix to run properly | ||
volumes: | ||
- "../..:/dash:rw" | ||
- "guix-alpine-cache:/root/.cache/guix:rw" | ||
volumes: | ||
guix-alpine-cache: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/usr/bin/env bash | ||
export LC_ALL=C | ||
set -e -o pipefail | ||
|
||
# Read instructions | ||
cat /etc/motd | ||
|
||
# Start the Guix daemon | ||
/root/.config/guix/current/bin/guix-daemon \ | ||
--build-users-group='guixbuild' \ | ||
--substitute-urls='https://bordeaux.guix.gnu.org https://ci.guix.gnu.org' < /dev/null 2>&1 | | ||
tee /var/log/guix.log > /dev/null & | ||
|
||
# Hand over control | ||
exec bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/usr/bin/env bash | ||
export LC_ALL=C | ||
set -e -o pipefail | ||
|
||
cd /dash | ||
COMMIT_ID=guix-build-$(git rev-parse --short=12 HEAD) | ||
|
||
printf "Binaries:\n" | ||
( \ | ||
SRC_PATH_PREFIX=guix-build-${COMMIT_ID}/distsrc- && \ | ||
sha256sum ${SRC_PATH_PREFIX}*/src/dash{d,-cli,-tx,-wallet}{,.exe} && \ | ||
sha256sum ${SRC_PATH_PREFIX}*/src/qt/dash-qt{,.exe} && \ | ||
sha256sum ${SRC_PATH_PREFIX}*/src/test/test_dash{,.exe} \ | ||
) | sort -k 2 | ||
|
||
printf "Archives:\n" | ||
find guix-build-"${COMMIT_ID}"/output -type f | grep -v SHA256 | xargs sha256sum | sort -k 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/usr/bin/env bash | ||
export LC_ALL=C | ||
set -e -o pipefail | ||
|
||
# Check if macOS SDK is present, if not, download it | ||
if [ ! -d "/dash/depends/SDKs/Xcode-12.1-12A7403-extracted-SDK-with-libcxx-headers" ] | ||
then | ||
curl -L https://bitcoincore.org/depends-sources/sdks/Xcode-12.1-12A7403-extracted-SDK-with-libcxx-headers.tar.gz | tar -xz -C /dash/depends/SDKs | ||
fi | ||
|
||
cd /dash | ||
git status >> /dev/null | ||
git config --global --add safe.directory /dash | ||
|
||
./contrib/guix/guix-build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
##################################################### | ||
To get started, run 'guix-start' and then calculate | ||
hashes using 'guix-check' | ||
##################################################### |