Skip to content

Commit 2e6a225

Browse files
Merge #7184: build: target aarch64 over armv7, update to macOS 15.0 SDK (Xcode 16.0), add verification step to setup-sdk
1f64bad fix(build): include resource directory in search path for include resolution (Kittywhiskers Van Gogh) d201e43 fix(build): unset `C{,PLUS}_INCLUDE_PATH` to avoid cross-toolchain conflict (Kittywhiskers Van Gogh) 98e244a build: add verification step after downloading macOS SDK (Kittywhiskers Van Gogh) 7e9df77 build: update to macOS 15.0 SDK from Xcode 16.0 (Kittywhiskers Van Gogh) bfb638f build: make list of cross compilers more explicit, switch to ARMv8 (Kittywhiskers Van Gogh) Pull request description: ## Additional Information * Dependency for #7109 * To ensure our list of targets validated are matched with targets used for releases (see [`guix-start`](https://github.com/dashpay/dash/blob/1ea35a436d538c36380b6f3d3514091bf90bfaa8/contrib/containers/guix/scripts/guix-start#L29-L31)), we switch out `arm-linux-gnueabihf` with `aarch64-linux-gnu`, this is now reflected by changes to our GitHub CI configuration, build scripts, Guix CI action. * Additionally, since [dash#7047](#7047), we can't assume our host is x86_64 and must update packages to explicitly mention the desired arch instead of relying on that assumption. * As mentioned in [dash#6927](#6927), we need to update the macOS SDK to ensure we have standards-conformant definitions to deal with [dtolnay/cxx#1574](dtolnay/cxx#1574). * This does result in us using a higher SDK version than used upstream, requiring us to update the source URLs to our own fallback servers as upstream is not expected to host this version of the consolidated SDK. **This has no effect on the target version of macOS, which will continue to be macOS 14.** * SDKs shipped after Xcode 15.3 (15E204a) seem to have problems with Clang not able to determine the include paths correctly (see below for error). To resolve this issue, we now explicitly fetch the resource directory and add it to the includes list. <details> <summary>Build log:</summary> ``` In file included from conftest.cc:3: In file included from /src/dash/depends/SDKs/Xcode-16.0-16A242d-extracted-SDK-with-libcxx-headers/usr/include/c++/v1/iostream:43: [...] In file included from /src/dash/depends/SDKs/Xcode-16.0-16A242d-extracted-SDK-with-libcxx-headers/usr/include/machine/_types.h:34: /src/dash/depends/SDKs/Xcode-16.0-16A242d-extracted-SDK-with-libcxx-headers/usr/include/arm/_types.h:75:9: error: unknown type name 'ptrdiff_t' 75 | typedef ptrdiff_t __darwin_ptrdiff_t; /* ptr1 - ptr2 */ | ^ /src/dash/depends/SDKs/Xcode-16.0-16A242d-extracted-SDK-with-libcxx-headers/usr/include/arm/_types.h:85:9: error: unknown type name 'size_t' 85 | typedef size_t __darwin_size_t; /* sizeof() */ | ^ In file included from conftest.cc:3: [...] In file included from /src/dash/depends/SDKs/Xcode-16.0-16A242d-extracted-SDK-with-libcxx-headers/usr/include/c++/v1/__compare/three_way_comparable.h:12: /src/dash/depends/SDKs/Xcode-16.0-16A242d-extracted-SDK-with-libcxx-headers/usr/include/c++/v1/__compare/common_comparison_category.h:40:11: error: reference to unresolved using declaration 40 | template <size_t _Size> | ^ /src/dash/depends/SDKs/Xcode-16.0-16A242d-extracted-SDK-with-libcxx-headers/usr/include/c++/v1/cstddef:61:1: note: using declaration annotated with 'using_if_exists' here 61 | using ::size_t _LIBCPP_USING_IF_EXISTS; | ^ [...] In file included from conftest.cc:3: [...] In file included from /src/dash/depends/SDKs/Xcode-16.0-16A242d-extracted-SDK-with-libcxx-headers/usr/include/malloc/_malloc.h:44: /src/dash/depends/SDKs/Xcode-16.0-16A242d-extracted-SDK-with-libcxx-headers/usr/include/malloc/_malloc_type.h:54:110: error: unknown type name 'size_t'; did you mean 'sig_t'? 54 | _MALLOC_TYPE_AVAILABILITY void * __sized_by_or_null(size) malloc_type_realloc(void * __unsafe_indexable ptr, size_t size, malloc_type_id_t type_id) __result_use_check __alloc_size(2); | ^ /src/dash/depends/SDKs/Xcode-16.0-16A242d-extracted-SDK-with-libcxx-headers/usr/include/sys/signal.h:331:16: note: 'sig_t' declared here 331 | typedef void (*sig_t)(int); /* type of signal function */ | ^ ``` </summary> * Due to conflicting definitions between the native and cross toolchains, `C{,PLUS}_INCLUDE_PATH` needs to be unset to allow the cross toolchain's definitions to prevail (see build error below). <details> <summary>Build log:</summary> ``` In file included from conftest.cc:3: In file included from /src/dash/depends/SDKs/Xcode-16.0-16A242d-extracted-SDK-with-libcxx-headers/usr/include/c++/v1/iostream:43: [...] In file included from /gnu/store/8xqflpdzl6vzj3sas35q0g1ayiz0895k-gcc-toolchain-13.3.0/include/bits/types/mbstate_t.h:4: /gnu/store/8xqflpdzl6vzj3sas35q0g1ayiz0895k-gcc-toolchain-13.3.0/include/bits/types/__mbstate_t.h:21:3: error: typedef redefinition with different types ('struct __mbstate_t' vs 'union __mbstate_t') 21 | } __mbstate_t; | ^ /src/dash/depends/SDKs/Xcode-16.0-16A242d-extracted-SDK-with-libcxx-headers/usr/include/i386/_types.h:94:3: note: previous definition is here 94 | } __mbstate_t; | ^ 1 error generated. configure:10623: $? = 1 failed program was: /* This test rejects g++ 2.7.2 which doesn't have <iostream>, only a pre-standard iostream.h. */ #include <iostream> ``` </summary> ## Breaking Changes None expected. ## Checklist - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas **(note: N/A)** - [x] I have added or updated relevant unit/integration/functional/e2e tests - [x] I have made corresponding changes to the documentation - [x] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_ ACKs for top commit: UdjinM6: Compiles on macos, same hashes in Guix for ca6c6f5. Rebase to 1f64bad is clean. light ACK 1f64bad Tree-SHA512: fae43927cc72346a0eb87758c4292a329d48c4e86324fd4831a97ccea582c066d2d9aeafb0e209f2661122430d5ad0e6f3cf6d679926dbdc88945a05fc958dbd
2 parents 4000876 + 1f64bad commit 2e6a225

File tree

13 files changed

+62
-53
lines changed

13 files changed

+62
-53
lines changed

.github/workflows/build.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,13 @@ jobs:
6363
file: ./contrib/containers/ci/ci-slim.Dockerfile
6464
name: dashcore-ci-slim
6565

66-
depends-arm-linux:
67-
name: arm-linux-gnueabihf
66+
depends-aarch64-linux:
67+
name: aarch64-linux-gnu
6868
uses: ./.github/workflows/build-depends.yml
6969
needs: [container, cache-sources]
7070
if: ${{ vars.SKIP_ARM_LINUX == '' }}
7171
with:
72-
build-target: arm-linux
72+
build-target: aarch64-linux
7373
container-path: ${{ needs.container.outputs.path }}
7474

7575
depends-linux64:
@@ -131,16 +131,16 @@ jobs:
131131
with:
132132
container-path: ${{ needs.container-slim.outputs.path }}
133133

134-
src-arm-linux:
135-
name: arm-linux-build
134+
src-aarch64-linux:
135+
name: aarch64-linux-build
136136
uses: ./.github/workflows/build-src.yml
137-
needs: [container, depends-arm-linux]
137+
needs: [container, depends-aarch64-linux]
138138
with:
139-
build-target: arm-linux
139+
build-target: aarch64-linux
140140
container-path: ${{ needs.container.outputs.path }}
141-
depends-key: ${{ needs.depends-arm-linux.outputs.key }}
142-
depends-host: ${{ needs.depends-arm-linux.outputs.host }}
143-
depends-dep-opts: ${{ needs.depends-arm-linux.outputs.dep-opts }}
141+
depends-key: ${{ needs.depends-aarch64-linux.outputs.key }}
142+
depends-host: ${{ needs.depends-aarch64-linux.outputs.host }}
143+
depends-dep-opts: ${{ needs.depends-aarch64-linux.outputs.dep-opts }}
144144

145145
src-linux64:
146146
name: linux64-build

.github/workflows/guix-build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ jobs:
7575
runs-on: ubuntu-24.04-arm
7676
strategy:
7777
matrix:
78-
build_target: [x86_64-linux-gnu, arm-linux-gnueabihf, aarch64-linux-gnu, riscv64-linux-gnu, powerpc64-linux-gnu, x86_64-w64-mingw32, x86_64-apple-darwin, arm64-apple-darwin]
78+
build_target: [x86_64-linux-gnu, aarch64-linux-gnu, riscv64-linux-gnu, powerpc64-linux-gnu, x86_64-w64-mingw32, x86_64-apple-darwin, arm64-apple-darwin]
7979

8080
timeout-minutes: 480
8181
steps:

ci/dash/matrix.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ export LSAN_OPTIONS="suppressions=${BASE_ROOT_DIR}/test/sanitizer_suppressions/l
1616
export TSAN_OPTIONS="suppressions=${BASE_ROOT_DIR}/test/sanitizer_suppressions/tsan:halt_on_error=1"
1717
export UBSAN_OPTIONS="suppressions=${BASE_ROOT_DIR}/test/sanitizer_suppressions/ubsan:print_stacktrace=1:halt_on_error=1:report_error_type=1"
1818

19-
if [ "$BUILD_TARGET" = "arm-linux" ]; then
20-
source ./ci/test/00_setup_env_arm.sh
19+
if [ "$BUILD_TARGET" = "aarch64-linux" ]; then
20+
source ./ci/test/00_setup_env_aarch64.sh
2121
elif [ "$BUILD_TARGET" = "linux64" ]; then
2222
source ./ci/test/00_setup_env_native_qt5.sh
2323
elif [ "$BUILD_TARGET" = "linux64_asan" ]; then

ci/test/00_setup_env.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ export BASE_OUTDIR=${BASE_OUTDIR:-$BASE_SCRATCH_DIR/out/$HOST}
7171
# Folder where the build is done (dist and out-of-tree build).
7272
export BASE_BUILD_DIR=${BASE_BUILD_DIR:-$BASE_SCRATCH_DIR/build-ci}
7373
export PREVIOUS_RELEASES_DIR=${PREVIOUS_RELEASES_DIR:-$BASE_ROOT_DIR/releases/$HOST}
74-
export SDK_URL=${SDK_URL:-https://bitcoincore.org/depends-sources/sdks}
74+
export SDK_URL=${SDK_URL:-https://s3.us-west-2.amazonaws.com/dash-depends-sources}
7575
export DOCKER_PACKAGES=${DOCKER_PACKAGES:-build-essential libtool autotools-dev automake pkg-config bsdmainutils curl ca-certificates ccache python3 rsync git procps}
7676
export GOAL=${GOAL:-install}
7777
export DIR_QA_ASSETS=${DIR_QA_ASSETS:-${BASE_SCRATCH_DIR}/qa-assets}
Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,21 @@
66

77
export LC_ALL=C.UTF-8
88

9-
export HOST=arm-linux-gnueabihf
9+
export HOST=aarch64-linux-gnu
1010
# The host arch is unknown, so we run the tests through qemu.
11-
# If the host is arm and wants to run the tests natively, it can set QEMU_USER_CMD to the empty string.
12-
if [ -z ${QEMU_USER_CMD+x} ]; then export QEMU_USER_CMD="${QEMU_USER_CMD:-"qemu-arm -L /usr/arm-linux-gnueabihf/"}"; fi
13-
export DPKG_ADD_ARCH="armhf"
14-
export PACKAGES="python3-zmq g++-arm-linux-gnueabihf busybox libc6:armhf libstdc++6:armhf libfontconfig1:armhf libxcb1:armhf"
11+
# If the host is arm64 and wants to run the tests natively, it can set QEMU_USER_CMD to the empty string.
12+
if [ -z ${QEMU_USER_CMD+x} ]; then export QEMU_USER_CMD="${QEMU_USER_CMD:-"qemu-aarch64 -L /usr/aarch64-linux-gnu/"}"; fi
13+
export DPKG_ADD_ARCH="arm64"
14+
export PACKAGES="python3-zmq g++-aarch64-linux-gnu busybox libc6:arm64 libstdc++6:arm64 libfontconfig1:arm64 libxcb1:arm64"
1515
if [ -n "$QEMU_USER_CMD" ]; then
1616
# Likely cross-compiling, so install the needed gcc and qemu-user
1717
export PACKAGES="$PACKAGES qemu-user"
1818
fi
19-
export CONTAINER_NAME=ci_arm_linux
19+
export CONTAINER_NAME=ci_aarch64_linux
2020
# Use debian to avoid 404 apt errors when cross compiling
2121
export CHECK_DOC=0
2222
export USE_BUSY_BOX=true
2323
export RUN_UNIT_TESTS=false
2424
export RUN_FUNCTIONAL_TESTS=false
2525
export GOAL="install"
26-
# -Wno-psabi is to disable ABI warnings: "note: parameter passing for argument of type ... changed in GCC 7.1"
27-
# This could be removed once the ABI change warning does not show up by default
28-
export BITCOIN_CONFIG="--enable-reduce-exports CXXFLAGS=-Wno-psabi"
26+
export BITCOIN_CONFIG="--enable-reduce-exports"

ci/test/00_setup_env_mac.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ export LC_ALL=C.UTF-8
88

99
export CONTAINER_NAME=ci_macos_cross
1010
export HOST=x86_64-apple-darwin
11-
export PACKAGES="clang cmake lld llvm zip"
12-
export XCODE_VERSION=15.0
13-
export XCODE_BUILD_ID=15A240d
11+
export PACKAGES="clang cmake lld llvm zip"
12+
export XCODE_VERSION=16.0
13+
export XCODE_BUILD_ID=16A242d
1414
export RUN_UNIT_TESTS=false
1515
export RUN_FUNCTIONAL_TESTS=false
1616
export GOAL="all deploy"

contrib/containers/ci/ci.Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@ RUN set -ex; \
1919
cmake \
2020
g++-11 \
2121
g++-14 \
22-
g++-arm-linux-gnueabihf \
22+
g++-aarch64-linux-gnu \
2323
g++-mingw-w64-x86-64 \
24+
g++-x86-64-linux-gnu \
2425
gawk \
2526
gettext \
2627
libtool \

contrib/containers/deploy/Dockerfile.GitHubActions.Dispatch

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ RUN apt-get update && \
99
build-essential \
1010
ca-certificates \
1111
curl \
12-
g++-arm-linux-gnueabihf \
12+
g++-aarch64-linux-gnu \
1313
libtool \
1414
pkg-config \
1515
python3 \
@@ -23,22 +23,22 @@ COPY . .
2323
ARG TARGETPLATFORM
2424

2525
RUN case "$TARGETPLATFORM" in \
26-
"linux/arm64") make HOST=arm-linux-gnueabihf -C depends -j`nproc | awk '{x=$1/2; print x}'` ;; \
26+
"linux/arm64") make HOST=aarch64-linux-gnu -C depends -j`nproc | awk '{x=$1/2; print x}'` ;; \
2727
"linux/amd64") make HOST=x86_64-pc-linux-gnu -C depends -j`nproc | awk '{x=$1/2; print x}'` ;; \
2828
*) exit 1 ;; \
2929
esac
3030

3131
RUN ./autogen.sh && \
3232
case "$TARGETPLATFORM" in \
33-
"linux/arm64") ./configure --prefix=`pwd`/depends/arm-linux-gnueabihf ;; \
33+
"linux/arm64") ./configure --prefix=`pwd`/depends/aarch64-linux-gnu ;; \
3434
"linux/amd64") ./configure --prefix=`pwd`/depends/x86_64-pc-linux-gnu ;; \
3535
esac
3636

3737
RUN make -j`nproc | awk '{x=$1/2; print x}'` && make install
3838

3939
RUN mkdir built-target && \
4040
case "$TARGETPLATFORM" in \
41-
"linux/arm64") cp depends/arm-linux-gnueabihf/bin/dash* /home/dash/built-target ;; \
41+
"linux/arm64") cp depends/aarch64-linux-gnu/bin/dash* /home/dash/built-target ;; \
4242
"linux/amd64") cp depends/x86_64-pc-linux-gnu/bin/dash* /home/dash/built-target ;; \
4343
esac
4444

contrib/containers/guix/scripts/setup-sdk

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,13 @@ export LC_ALL=C.UTF-8
77

88
set -eo pipefail
99

10-
SDK_URL="${SDK_URL:-https://bitcoincore.org/depends-sources/sdks}"
10+
SDK_URL="${SDK_URL:-https://s3.us-west-2.amazonaws.com/dash-depends-sources}"
1111
SDK_PATH="${SDK_PATH:-depends/SDKs}"
1212
SDK_SOURCES="${SDK_SOURCES:-depends/sdk-sources}"
13-
XCODE_VERSION="${XCODE_VERSION:-15.0}"
14-
XCODE_RELEASE="${XCODE_RELEASE:-15A240d}"
13+
XCODE_VERSION="${XCODE_VERSION:-16.0}"
14+
XCODE_RELEASE="${XCODE_RELEASE:-16A242d}"
1515
XCODE_ARCHIVE="Xcode-${XCODE_VERSION}-${XCODE_RELEASE}-extracted-SDK-with-libcxx-headers"
16+
XCODE_AR_HASH="${XCODE_AR_HASH:-bce59aa16560f182e44200a0b9539bd637c8b5c7089fbff13b0712730ce162ff}"
1617
XCODE_AR_PATH="${SDK_SOURCES}/${XCODE_ARCHIVE}.tar.gz"
1718

1819
if [ ! -d "${SDK_PATH}/${XCODE_ARCHIVE}" ]; then
@@ -21,6 +22,11 @@ if [ ! -d "${SDK_PATH}/${XCODE_ARCHIVE}" ]; then
2122
mkdir -p "${SDK_SOURCES}"
2223
curl --location --fail "${SDK_URL}/${XCODE_ARCHIVE}.tar.gz" -o "${XCODE_AR_PATH}"
2324
fi
25+
echo "Verifying macOS SDK..."
26+
if [ "$(sha256sum "${XCODE_AR_PATH}" | cut -d' ' -f1)" != "${XCODE_AR_HASH}" ]; then
27+
echo "ERROR: Checksum mismatch for ${XCODE_AR_PATH}"
28+
exit 1
29+
fi
2430
echo "Extracting macOS SDK..."
2531
mkdir -p "${SDK_PATH}"
2632
tar -C "${SDK_PATH}" -xf "${XCODE_AR_PATH}"

contrib/guix/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ details.
249249
Set the path where _extracted_ SDKs can be found. This is passed through to
250250
the depends tree. Note that this is should be set to the _parent_ directory of
251251
the actual SDK (e.g. `SDK_PATH=$HOME/Downloads/macOS-SDKs` instead of
252-
`$HOME/Downloads/macOS-SDKs/Xcode-12.2-12B45b-extracted-SDK-with-libcxx-headers`).
252+
`$HOME/Downloads/macOS-SDKs/Xcode-16.0-16A242d-extracted-SDK-with-libcxx-headers`).
253253

254254
The path that this environment variable points to **must be a directory**, and
255255
**NOT a symlink to a directory**.

0 commit comments

Comments
 (0)