build: follow up to #5449. implementing suggestions and deduplication (#5464)

## Additional Information

* Based on suggestions by @knst made
[here](https://github.com/dashpay/dash/pull/5449#issuecomment-1609937147)
and
[here](https://github.com/dashpay/dash/pull/5426#discussion_r1241789033)
This commit is contained in:
Kittywhiskers Van Gogh 2023-06-29 00:29:16 +05:30 committed by GitHub
parent d97ec350f0
commit 63c4e2456b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 38 additions and 23 deletions

View File

@ -51,11 +51,11 @@ jobs:
run: |
docker run --privileged -d --rm -t \
--name guix-daemon \
-e ADDITIONAL_GUIX_COMMON_FLAGS='--max-jobs=32' \
-e ADDITIONAL_GUIX_COMMON_FLAGS="--max-jobs=$(nproc --all)" \
-v ${{ github.workspace }}:/src/dash \
-w /src/dash \
guix_ubuntu:latest && \
docker exec guix-daemon bash -c "/usr/local/bin/guix-start"
docker exec guix-daemon bash -c '/usr/local/bin/guix-start'
- name: Ensure build passes
run: |
@ -63,14 +63,7 @@ jobs:
echo "Guix build failed!"
exit 1
fi
- name: Compute SHA256 checksums for binaries
- name: Compute SHA256 checksums
run: |
( \
SRC_PATH_PREFIX=guix-build-$(git rev-parse --short=12 HEAD)/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
- name: Compute SHA256 checksums for archives
run: |
find guix-build-"$(git rev-parse --short=12 HEAD)"/output -type f | grep -v SHA256 | xargs sha256sum | sort -k 2
./contrib/containers/guix/scripts/guix-check ${{ github.workspace }}

View File

@ -2,16 +2,27 @@
set -eo pipefail
cd /src/dash
COMMIT_ID=$(git rev-parse --short=12 HEAD)
if [[ -n "${1}" ]]; then
WORKSPACE_PATH="$1"
else
WORKSPACE_PATH="/src/dash"
fi
printf "Binaries:\n"
if [[ ! -d "$WORKSPACE_PATH" ]]; then
echo "$0: $WORKSPACE_PATH is not a valid directory, exiting!"
exit 1
fi
cd "$WORKSPACE_PATH"
COMMIT_ID="$(git rev-parse --short=12 HEAD)"
printf "\nBinaries:\n\n"
( \
SRC_PATH_PREFIX=guix-build-${COMMIT_ID}/distsrc- && \
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
printf "\nArchives:\n\n"
find "guix-build-${COMMIT_ID}/output" -type f | grep -v SHA256 | xargs sha256sum | sort -k 2

View File

@ -2,19 +2,30 @@
set -eo pipefail
if [[ -n "${1}" ]]; then
WORKSPACE_PATH="$1"
else
WORKSPACE_PATH="/src/dash"
fi
if [[ ! -d "$WORKSPACE_PATH" ]]; then
echo "$0: $WORKSPACE_PATH is not a valid directory, exiting!"
exit 1
fi
XCODE_VERSION="12.1"
XCODE_RELEASE="12A7403"
XCODE_ARCHIVE="Xcode-${XCODE_VERSION}-${XCODE_RELEASE}-extracted-SDK-with-libcxx-headers"
# Check if macOS SDK is present, if not, download it
if [ ! -d "/src/dash/depends/SDKs/${XCODE_ARCHIVE}" ]
if [ ! -d "${WORKSPACE_PATH}/depends/SDKs/${XCODE_ARCHIVE}" ]
then
mkdir -p /src/dash/depends/SDKs
curl -L https://bitcoincore.org/depends-sources/sdks/${XCODE_ARCHIVE}.tar.gz | tar -xz -C /src/dash/depends/SDKs
mkdir -p "${WORKSPACE_PATH}/depends/SDKs"
curl -L https://bitcoincore.org/depends-sources/sdks/${XCODE_ARCHIVE}.tar.gz | tar -xz -C "${WORKSPACE_PATH}/depends/SDKs"
fi
cd /src/dash
cd "${WORKSPACE_PATH}"
git config --global --add safe.directory "${WORKSPACE_PATH}"
git status >> /dev/null
git config --global --add safe.directory /src/dash
./contrib/guix/guix-build