Skip to content

Commit 63c4e24

Browse files
authored
build: follow up to #5449. implementing suggestions and deduplication (#5464)
## Additional Information * Based on suggestions by @knst made [here](#5449 (comment)) and [here](#5426 (comment))
1 parent d97ec35 commit 63c4e24

File tree

3 files changed

+38
-23
lines changed

3 files changed

+38
-23
lines changed

.github/workflows/guix-build.yml

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -51,26 +51,19 @@ jobs:
5151
run: |
5252
docker run --privileged -d --rm -t \
5353
--name guix-daemon \
54-
-e ADDITIONAL_GUIX_COMMON_FLAGS='--max-jobs=32' \
54+
-e ADDITIONAL_GUIX_COMMON_FLAGS="--max-jobs=$(nproc --all)" \
5555
-v ${{ github.workspace }}:/src/dash \
5656
-w /src/dash \
5757
guix_ubuntu:latest && \
58-
docker exec guix-daemon bash -c "/usr/local/bin/guix-start"
58+
docker exec guix-daemon bash -c '/usr/local/bin/guix-start'
5959
6060
- name: Ensure build passes
6161
run: |
6262
if [[ $? != 0 ]]; then
6363
echo "Guix build failed!"
6464
exit 1
6565
fi
66-
- name: Compute SHA256 checksums for binaries
67-
run: |
68-
( \
69-
SRC_PATH_PREFIX=guix-build-$(git rev-parse --short=12 HEAD)/distsrc- && \
70-
sha256sum ${SRC_PATH_PREFIX}*/src/dash{d,-cli,-tx,-wallet}{,.exe} && \
71-
sha256sum ${SRC_PATH_PREFIX}*/src/qt/dash-qt{,.exe} && \
72-
sha256sum ${SRC_PATH_PREFIX}*/src/test/test_dash{,.exe} \
73-
) | sort -k 2
74-
- name: Compute SHA256 checksums for archives
66+
67+
- name: Compute SHA256 checksums
7568
run: |
76-
find guix-build-"$(git rev-parse --short=12 HEAD)"/output -type f | grep -v SHA256 | xargs sha256sum | sort -k 2
69+
./contrib/containers/guix/scripts/guix-check ${{ github.workspace }}

contrib/containers/guix/scripts/guix-check

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,27 @@
22

33
set -eo pipefail
44

5-
cd /src/dash
6-
COMMIT_ID=$(git rev-parse --short=12 HEAD)
5+
if [[ -n "${1}" ]]; then
6+
WORKSPACE_PATH="$1"
7+
else
8+
WORKSPACE_PATH="/src/dash"
9+
fi
710

8-
printf "Binaries:\n"
11+
if [[ ! -d "$WORKSPACE_PATH" ]]; then
12+
echo "$0: $WORKSPACE_PATH is not a valid directory, exiting!"
13+
exit 1
14+
fi
15+
16+
cd "$WORKSPACE_PATH"
17+
COMMIT_ID="$(git rev-parse --short=12 HEAD)"
18+
19+
printf "\nBinaries:\n\n"
920
( \
10-
SRC_PATH_PREFIX=guix-build-${COMMIT_ID}/distsrc- && \
21+
SRC_PATH_PREFIX="guix-build-${COMMIT_ID}/distsrc-" && \
1122
sha256sum ${SRC_PATH_PREFIX}*/src/dash{d,-cli,-tx,-wallet}{,.exe} && \
1223
sha256sum ${SRC_PATH_PREFIX}*/src/qt/dash-qt{,.exe} && \
1324
sha256sum ${SRC_PATH_PREFIX}*/src/test/test_dash{,.exe} \
1425
) | sort -k 2
1526

16-
printf "Archives:\n"
17-
find guix-build-"${COMMIT_ID}"/output -type f | grep -v SHA256 | xargs sha256sum | sort -k 2
27+
printf "\nArchives:\n\n"
28+
find "guix-build-${COMMIT_ID}/output" -type f | grep -v SHA256 | xargs sha256sum | sort -k 2

contrib/containers/guix/scripts/guix-start

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,30 @@
22

33
set -eo pipefail
44

5+
if [[ -n "${1}" ]]; then
6+
WORKSPACE_PATH="$1"
7+
else
8+
WORKSPACE_PATH="/src/dash"
9+
fi
10+
11+
if [[ ! -d "$WORKSPACE_PATH" ]]; then
12+
echo "$0: $WORKSPACE_PATH is not a valid directory, exiting!"
13+
exit 1
14+
fi
15+
516
XCODE_VERSION="12.1"
617
XCODE_RELEASE="12A7403"
718
XCODE_ARCHIVE="Xcode-${XCODE_VERSION}-${XCODE_RELEASE}-extracted-SDK-with-libcxx-headers"
819

920
# Check if macOS SDK is present, if not, download it
10-
if [ ! -d "/src/dash/depends/SDKs/${XCODE_ARCHIVE}" ]
21+
if [ ! -d "${WORKSPACE_PATH}/depends/SDKs/${XCODE_ARCHIVE}" ]
1122
then
12-
mkdir -p /src/dash/depends/SDKs
13-
curl -L https://bitcoincore.org/depends-sources/sdks/${XCODE_ARCHIVE}.tar.gz | tar -xz -C /src/dash/depends/SDKs
23+
mkdir -p "${WORKSPACE_PATH}/depends/SDKs"
24+
curl -L https://bitcoincore.org/depends-sources/sdks/${XCODE_ARCHIVE}.tar.gz | tar -xz -C "${WORKSPACE_PATH}/depends/SDKs"
1425
fi
1526

16-
cd /src/dash
27+
cd "${WORKSPACE_PATH}"
28+
git config --global --add safe.directory "${WORKSPACE_PATH}"
1729
git status >> /dev/null
18-
git config --global --add safe.directory /src/dash
1930

2031
./contrib/guix/guix-build

0 commit comments

Comments
 (0)