Skip to content

Commit 9bfb700

Browse files
committedNov 14, 2024··
Merge #6390: guix: build only supported targets using guix-start, update guix-start and guix-check to work correctly outside of containers
c5d482e chore: suppress `git config` output (UdjinM6) 8ce9bfe chore: tweak error message (UdjinM6) f4d879a guix: more sanity checks for `WORKSPACE_PATH` (UdjinM6) 07f056a guix: Let `XCODE_SOURCE` be specified via env (UdjinM6) 74489dc chore: Log when preparing macOS SDK or adding `safe.directory` option (UdjinM6) 3ac5739 guix: "Invert" `guix-start`/`guix-check` cmd-line argument behaviour, defaults to `pwd` (UdjinM6) 187a4f1 guix: Avoid adding duplicate `safe.directory` option (UdjinM6) 87c9786 guix: `guix-start` should respect `SDK_PATH` (UdjinM6) ee5f62b guix: build only supported targets using Guix container (Kittywhiskers Van Gogh) Pull request description: ## Issue being fixed or feature implemented #6382 (comment) #6388 (comment) alternative to #6388 ## What was done? ## How Has This Been Tested? ## Breaking Changes ## Checklist: - [ ] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have added or updated relevant unit/integration/functional/e2e tests - [ ] I have made corresponding changes to the documentation - [ ] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_ ACKs for top commit: kwvg: ACK c5d482e Tree-SHA512: c0271f243f5912f55276fcb371a135f443f23cc1f29480f303ea77deeadb6fd7d3d97e07e6a1fa323a2b2bad1d65aa6298da33978832eb68a0a6303db3e0063c
2 parents 2625984 + c5d482e commit 9bfb700

File tree

3 files changed

+25
-20
lines changed

3 files changed

+25
-20
lines changed
 

‎.github/workflows/guix-build.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ jobs:
114114
-v ${{ github.workspace }}/.cache:/home/ubuntu/.cache \
115115
-w /src/dash \
116116
ghcr.io/${{ needs.build-image.outputs.repo-name }}/dashcore-guix-builder:${{ needs.build-image.outputs.image-tag }} && \
117-
docker exec guix-daemon bash -c 'HOSTS=${{ matrix.build_target }} /usr/local/bin/guix-start'
117+
docker exec guix-daemon bash -c 'HOSTS=${{ matrix.build_target }} /usr/local/bin/guix-start /src/dash'
118118
119119
- name: Ensure build passes
120120
run: |

‎contrib/containers/guix/scripts/guix-check

+3-7
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,10 @@
22

33
set -eo pipefail
44

5-
if [[ -n "${1}" ]]; then
6-
WORKSPACE_PATH="$1"
7-
else
8-
WORKSPACE_PATH="/src/dash"
9-
fi
5+
WORKSPACE_PATH="${1:-$(pwd)}"
106

11-
if [[ ! -d "$WORKSPACE_PATH" ]]; then
12-
echo "$0: $WORKSPACE_PATH is not a valid directory, exiting!"
7+
if [[ ! -d "${WORKSPACE_PATH}" || ! "${WORKSPACE_PATH}" = /* || ! -f "${WORKSPACE_PATH}/contrib/guix/libexec/prelude.bash" ]]; then
8+
echo "${0##*/}: ${WORKSPACE_PATH} is not the top directory of the Dash Core repository, exiting!"
139
exit 1
1410
fi
1511

‎contrib/containers/guix/scripts/guix-start

+21-12
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,39 @@
22

33
set -eo pipefail
44

5-
if [[ -n "${1}" ]]; then
6-
WORKSPACE_PATH="$1"
7-
else
8-
WORKSPACE_PATH="/src/dash"
9-
fi
5+
WORKSPACE_PATH="${1:-$(pwd)}"
106

11-
if [[ ! -d "$WORKSPACE_PATH" ]]; then
12-
echo "$0: $WORKSPACE_PATH is not a valid directory, exiting!"
7+
if [[ ! -d "${WORKSPACE_PATH}" || ! "${WORKSPACE_PATH}" = /* || ! -f "${WORKSPACE_PATH}/contrib/guix/guix-build" ]]; then
8+
echo "${0##*/}: ${WORKSPACE_PATH} is not the top directory of the Dash Core repository, exiting!"
139
exit 1
1410
fi
1511

1612
XCODE_VERSION="12.2"
1713
XCODE_RELEASE="12B45b"
1814
XCODE_ARCHIVE="Xcode-${XCODE_VERSION}-${XCODE_RELEASE}-extracted-SDK-with-libcxx-headers"
15+
XCODE_SOURCE="${XCODE_SOURCE:-https://bitcoincore.org/depends-sources/sdks}"
16+
17+
export SDK_PATH="${SDK_PATH:-${WORKSPACE_PATH}/depends/SDKs}"
1918

2019
# Check if macOS SDK is present, if not, download it
21-
if [ ! -d "${WORKSPACE_PATH}/depends/SDKs/${XCODE_ARCHIVE}" ]
22-
then
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"
20+
if [[ ! -d "${SDK_PATH}/${XCODE_ARCHIVE}" ]]; then
21+
echo "Preparing macOS SDK..."
22+
mkdir -p "${SDK_PATH}"
23+
curl -L "${XCODE_SOURCE}/${XCODE_ARCHIVE}.tar.gz" | tar -xz -C "${SDK_PATH}"
24+
fi
25+
26+
# Add safe.directory option only when WORKSPACE_PATH was specified via cmd-line arguments (happens in CI)
27+
if [[ -n "${1}" ]]; then
28+
# Avoid adding duplicates
29+
git config --global --fixed-value --get safe.directory "${WORKSPACE_PATH}" >> /dev/null || \
30+
(echo "Adding safe.directory" && git config --global --add safe.directory "${WORKSPACE_PATH}")
2531
fi
2632

2733
cd "${WORKSPACE_PATH}"
28-
git config --global --add safe.directory "${WORKSPACE_PATH}"
2934
git status >> /dev/null
3035

36+
export HOSTS="${HOSTS:-x86_64-linux-gnu aarch64-linux-gnu riscv64-linux-gnu
37+
x86_64-w64-mingw32
38+
x86_64-apple-darwin arm64-apple-darwin}"
39+
3140
./contrib/guix/guix-build

0 commit comments

Comments
 (0)
Please sign in to comment.