diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bdfea1cedb69..608aa34a31aa 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -90,18 +90,8 @@ jobs: runs-on-amd64: ${{ needs.check-skip.outputs['runner-amd64'] }} runs-on-arm64: ${{ needs.check-skip.outputs['runner-arm64'] }} - depends-aarch64-linux: - name: aarch64-linux-gnu - uses: ./.github/workflows/build-depends.yml - needs: [check-skip, container, cache-sources] - if: ${{ vars.SKIP_ARM_LINUX == '' }} - with: - build-target: aarch64-linux - container-path: ${{ needs.container.outputs.path }} - runs-on: ${{ needs.check-skip.outputs['runner-amd64'] }} - depends-linux64: - name: x86_64-pc-linux-gnu + name: linux64 (native) uses: ./.github/workflows/build-depends.yml needs: [check-skip, container, cache-sources] if: | @@ -112,7 +102,7 @@ jobs: with: build-target: linux64 container-path: ${{ needs.container.outputs.path }} - runs-on: ${{ needs.check-skip.outputs['runner-amd64'] }} + runs-on: ${{ needs.check-skip.outputs['runner-arm64'] }} depends-linux64_multiprocess: name: linux64_multiprocess @@ -164,18 +154,6 @@ jobs: container-path: ${{ needs.container-slim.outputs.path }} runs-on: ${{ needs.check-skip.outputs['runner-amd64'] }} - src-aarch64-linux: - name: aarch64-linux-build - uses: ./.github/workflows/build-src.yml - needs: [check-skip, container, depends-aarch64-linux] - with: - build-target: aarch64-linux - container-path: ${{ needs.container.outputs.path }} - depends-key: ${{ needs.depends-aarch64-linux.outputs.key }} - depends-host: ${{ needs.depends-aarch64-linux.outputs.host }} - depends-dep-opts: ${{ needs.depends-aarch64-linux.outputs.dep-opts }} - runs-on: ${{ needs.check-skip.outputs['runner-amd64'] }} - src-linux64: name: linux64-build uses: ./.github/workflows/build-src.yml @@ -187,7 +165,7 @@ jobs: depends-key: ${{ needs.depends-linux64.outputs.key }} depends-host: ${{ needs.depends-linux64.outputs.host }} depends-dep-opts: ${{ needs.depends-linux64.outputs.dep-opts }} - runs-on: ${{ needs.check-skip.outputs['runner-amd64'] }} + runs-on: ${{ needs.check-skip.outputs['runner-arm64'] }} src-linux64_fuzz: name: linux64_fuzz-build @@ -200,7 +178,7 @@ jobs: depends-key: ${{ needs.depends-linux64.outputs.key }} depends-host: ${{ needs.depends-linux64.outputs.host }} depends-dep-opts: ${{ needs.depends-linux64.outputs.dep-opts }} - runs-on: ${{ needs.check-skip.outputs['runner-amd64'] }} + runs-on: ${{ needs.check-skip.outputs['runner-arm64'] }} src-linux64_multiprocess: name: linux64_multiprocess-build @@ -238,7 +216,7 @@ jobs: depends-key: ${{ needs.depends-linux64.outputs.key }} depends-host: ${{ needs.depends-linux64.outputs.host }} depends-dep-opts: ${{ needs.depends-linux64.outputs.dep-opts }} - runs-on: ${{ needs.check-skip.outputs['runner-amd64'] }} + runs-on: ${{ needs.check-skip.outputs['runner-arm64'] }} src-linux64_tsan: name: linux64_tsan-build @@ -264,7 +242,7 @@ jobs: depends-key: ${{ needs.depends-linux64.outputs.key }} depends-host: ${{ needs.depends-linux64.outputs.host }} depends-dep-opts: ${{ needs.depends-linux64.outputs.dep-opts }} - runs-on: ${{ needs.check-skip.outputs['runner-amd64'] }} + runs-on: ${{ needs.check-skip.outputs['runner-arm64'] }} src-mac: name: mac-build @@ -298,7 +276,7 @@ jobs: bundle-key: ${{ needs.src-linux64.outputs.key }} build-target: linux64 container-path: ${{ needs.container-slim.outputs.path }} - runs-on: ${{ needs.check-skip.outputs['runner-amd64'] }} + runs-on: ${{ needs.check-skip.outputs['runner-arm64'] }} test-linux64_multiprocess: name: linux64_multiprocess-test @@ -328,7 +306,7 @@ jobs: bundle-key: ${{ needs.src-linux64_sqlite.outputs.key }} build-target: linux64_sqlite container-path: ${{ needs.container-slim.outputs.path }} - runs-on: ${{ needs.check-skip.outputs['runner-amd64'] }} + runs-on: ${{ needs.check-skip.outputs['runner-arm64'] }} test-linux64_tsan: name: linux64_tsan-test @@ -348,4 +326,4 @@ jobs: bundle-key: ${{ needs.src-linux64_ubsan.outputs.key }} build-target: linux64_ubsan container-path: ${{ needs.container-slim.outputs.path }} - runs-on: ${{ needs.check-skip.outputs['runner-amd64'] }} + runs-on: ${{ needs.check-skip.outputs['runner-arm64'] }} diff --git a/ci/dash/matrix.sh b/ci/dash/matrix.sh index 6e249fc476d1..9a5ca9c7583a 100755 --- a/ci/dash/matrix.sh +++ b/ci/dash/matrix.sh @@ -16,9 +16,7 @@ export LSAN_OPTIONS="suppressions=${BASE_ROOT_DIR}/test/sanitizer_suppressions/l export TSAN_OPTIONS="suppressions=${BASE_ROOT_DIR}/test/sanitizer_suppressions/tsan:halt_on_error=1" export UBSAN_OPTIONS="suppressions=${BASE_ROOT_DIR}/test/sanitizer_suppressions/ubsan:print_stacktrace=1:halt_on_error=1:report_error_type=1" -if [ "$BUILD_TARGET" = "aarch64-linux" ]; then - source ./ci/test/00_setup_env_aarch64.sh -elif [ "$BUILD_TARGET" = "linux64" ]; then +if [ "$BUILD_TARGET" = "linux64" ]; then source ./ci/test/00_setup_env_native_qt5.sh elif [ "$BUILD_TARGET" = "linux64_asan" ]; then source ./ci/test/00_setup_env_native_asan.sh diff --git a/ci/test/00_setup_env.sh b/ci/test/00_setup_env.sh index 4207615a1a94..60ca2ad2cb19 100755 --- a/ci/test/00_setup_env.sh +++ b/ci/test/00_setup_env.sh @@ -31,8 +31,31 @@ export MAKEJOBS=${MAKEJOBS:--j$(nproc)} export BASE_SCRATCH_DIR=${BASE_SCRATCH_DIR:-$BASE_ROOT_DIR/ci/scratch} # What host to compile for. See also ./depends/README.md # Tests that need cross-compilation export the appropriate HOST. -# Tests that run natively guess the host -export HOST=${HOST:-$("$BASE_ROOT_DIR/depends/config.guess")} +# Tests that run natively detect the host based on architecture. +# We use explicit triplets rather than config.guess to ensure they match +# the triplets used by depends (e.g. aarch64-linux-gnu, not aarch64-unknown-linux-gnu). +if [ -z "$HOST" ]; then + case "$(uname -m)" in + aarch64) + export HOST=aarch64-linux-gnu + ;; + x86_64) + export HOST=x86_64-pc-linux-gnu + ;; + *) + if command -v dpkg >/dev/null 2>&1; then + arch="$(dpkg --print-architecture)" + if [ "${arch}" = "arm64" ]; then + export HOST=aarch64-linux-gnu + elif [ "${arch}" = "amd64" ]; then + export HOST=x86_64-pc-linux-gnu + fi + fi + # Final fallback to config.guess + export HOST=${HOST:-$("$BASE_ROOT_DIR/depends/config.guess")} + ;; + esac +fi # Whether to prefer BusyBox over GNU utilities export USE_BUSY_BOX=${USE_BUSY_BOX:-false} diff --git a/ci/test/00_setup_env_aarch64.sh b/ci/test/00_setup_env_aarch64.sh deleted file mode 100755 index d1edb9b95f38..000000000000 --- a/ci/test/00_setup_env_aarch64.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/env bash -# -# Copyright (c) 2019-2021 The Bitcoin Core developers -# Distributed under the MIT software license, see the accompanying -# file COPYING or http://www.opensource.org/licenses/mit-license.php. - -export LC_ALL=C.UTF-8 - -export HOST=aarch64-linux-gnu -# The host arch is unknown, so we run the tests through qemu. -# If the host is arm64 and wants to run the tests natively, it can set QEMU_USER_CMD to the empty string. -if [ -z ${QEMU_USER_CMD+x} ]; then export QEMU_USER_CMD="${QEMU_USER_CMD:-"qemu-aarch64 -L /usr/aarch64-linux-gnu/"}"; fi -export DPKG_ADD_ARCH="arm64" -export PACKAGES="python3-zmq g++-aarch64-linux-gnu busybox libc6:arm64 libstdc++6:arm64 libfontconfig1:arm64 libxcb1:arm64" -if [ -n "$QEMU_USER_CMD" ]; then - # Likely cross-compiling, so install the needed gcc and qemu-user - export PACKAGES="$PACKAGES qemu-user" -fi -export CONTAINER_NAME=ci_aarch64_linux -# Use debian to avoid 404 apt errors when cross compiling -export CHECK_DOC=0 -export USE_BUSY_BOX=true -export RUN_UNIT_TESTS=false -export RUN_FUNCTIONAL_TESTS=false -export GOAL="install" -export BITCOIN_CONFIG="--enable-reduce-exports" diff --git a/ci/test/00_setup_env_native_multiprocess.sh b/ci/test/00_setup_env_native_multiprocess.sh index fbb065a1ae95..134e515025de 100755 --- a/ci/test/00_setup_env_native_multiprocess.sh +++ b/ci/test/00_setup_env_native_multiprocess.sh @@ -7,24 +7,6 @@ export LC_ALL=C.UTF-8 export CONTAINER_NAME=ci_native_multiprocess -case "$(uname -m)" in - aarch64) - export HOST=aarch64-linux-gnu - ;; - x86_64) - export HOST=x86_64-pc-linux-gnu - ;; - *) - if command -v dpkg >/dev/null 2>&1; then - arch="$(dpkg --print-architecture)" - if [ "${arch}" = "arm64" ]; then - export HOST=aarch64-linux-gnu - elif [ "${arch}" = "amd64" ]; then - export HOST=x86_64-pc-linux-gnu - fi - fi - ;; -esac export PACKAGES="cmake python3 llvm clang" export DEP_OPTS="MULTIPROCESS=1 CC=clang-19 CXX=clang++-19" export RUN_TIDY=true diff --git a/ci/test/00_setup_env_native_qt5.sh b/ci/test/00_setup_env_native_qt5.sh index 1b41c7d4644e..07b669c0d7a5 100755 --- a/ci/test/00_setup_env_native_qt5.sh +++ b/ci/test/00_setup_env_native_qt5.sh @@ -7,7 +7,6 @@ export LC_ALL=C.UTF-8 export CONTAINER_NAME=ci_native_qt5 -export HOST=x86_64-pc-linux-gnu export PACKAGES="python3-zmq qtbase5-dev qttools5-dev-tools libdbus-1-dev libharfbuzz-dev" export DEP_OPTS="" export TEST_RUNNER_EXTRA="--previous-releases --coverage --extended --exclude feature_pruning,feature_dbcrash" # Run extended tests so that coverage does not fail, but exclude the very slow dbcrash diff --git a/ci/test/00_setup_env_native_tsan.sh b/ci/test/00_setup_env_native_tsan.sh index f84f594735f6..798ded8afd16 100755 --- a/ci/test/00_setup_env_native_tsan.sh +++ b/ci/test/00_setup_env_native_tsan.sh @@ -7,24 +7,6 @@ export LC_ALL=C.UTF-8 export CONTAINER_NAME=ci_native_tsan -case "$(uname -m)" in - aarch64) - export HOST=aarch64-linux-gnu - ;; - x86_64) - export HOST=x86_64-pc-linux-gnu - ;; - *) - if command -v dpkg >/dev/null 2>&1; then - arch="$(dpkg --print-architecture)" - if [ "${arch}" = "arm64" ]; then - export HOST=aarch64-linux-gnu - elif [ "${arch}" = "amd64" ]; then - export HOST=x86_64-pc-linux-gnu - fi - fi - ;; -esac export PACKAGES="clang-19 llvm-19 libclang-rt-19-dev libc++abi-19-dev libc++-19-dev python3-zmq" export DEP_OPTS="CC=clang-19 CXX='clang++-19 -stdlib=libc++'" export TEST_RUNNER_EXTRA="--extended --exclude feature_pruning,feature_dbcrash,wallet_multiwallet.py" # Temporarily suppress ASan heap-use-after-free (see issue #14163) diff --git a/test/get_previous_releases.py b/test/get_previous_releases.py index d56648bf4d43..862e8e0056c6 100755 --- a/test/get_previous_releases.py +++ b/test/get_previous_releases.py @@ -265,7 +265,9 @@ def check_host(args) -> int: './depends/config.guess').decode()) if args.download_binary: platforms = { + 'aarch64-linux-gnu': 'aarch64-linux-gnu', 'aarch64-*-linux*': 'aarch64-linux-gnu', + 'x86_64-linux-gnu': 'x86_64-linux-gnu', 'x86_64-*-linux*': 'x86_64-linux-gnu', 'x86_64-apple-darwin*': 'x86_64-apple-darwin', 'aarch64-apple-darwin*': 'arm64-apple-darwin',