From 29be6a28011cb672f49d07ce4308114baab6ff89 Mon Sep 17 00:00:00 2001 From: Konstantin Akimov Date: Thu, 27 Aug 2026 05:06:27 +0700 Subject: [PATCH 1/2] ci: remove superseded build_depends.sh Nothing references ci/dash/build_depends.sh: the depends build moved into .github/workflows/build-depends.yml, which runs `make -C depends` inline. --- ci/dash/build_depends.sh | 27 --------------------------- 1 file changed, 27 deletions(-) delete mode 100755 ci/dash/build_depends.sh diff --git a/ci/dash/build_depends.sh b/ci/dash/build_depends.sh deleted file mode 100755 index 30d4da724a5b..000000000000 --- a/ci/dash/build_depends.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/env bash -# Copyright (c) 2021-2025 The Dash Core developers -# Distributed under the MIT software license, see the accompanying -# file COPYING or http://www.opensource.org/licenses/mit-license.php. -# -# This script is executed inside the builder image - -export LC_ALL=C.UTF-8 - -set -e - -source ./ci/dash/matrix.sh - -unset CC; unset CXX -unset DISPLAY - -mkdir -p "$CACHE_DIR/depends" -mkdir -p "$CACHE_DIR/sdk-sources" - -ln -s "$CACHE_DIR/depends" "${DEPENDS_DIR}/built" -ln -s "$CACHE_DIR/sdk-sources" "${DEPENDS_DIR}/sdk-sources" - -if [[ "${HOST}" == "x86_64-apple-darwin" ]]; then - ./contrib/containers/guix/scripts/setup-sdk -fi - -make "$MAKEJOBS" -C depends HOST="$HOST" "$DEP_OPTS" From e9b40c44b211369cc7fd061cfa684ee1f42b7875 Mon Sep 17 00:00:00 2001 From: Konstantin Akimov Date: Thu, 27 Aug 2026 05:06:27 +0700 Subject: [PATCH 2/2] ci: remove unused test_run_all.sh pipeline inherited from Bitcoin Core Dash CI runs on GitHub Actions via ci/dash/*.sh, which selects a ci/test/00_setup_env*.sh configuration through ci/dash/matrix.sh. The staged Bitcoin Core pipeline was never wired into it: ci/test_run_all.sh sources 04_install.sh and 05_before_script.sh and then stops, because the 06_script_*.sh stages were never adopted, so it sets up an environment without running a single test. Nothing references these files except ci/README.md, yet they keep absorbing backport conflicts and maintenance that has no effect on CI. Same reasoning as the earlier .cirrus.yml (#6704) removal Also removed as fully unreferenced: ci/test/wrap-wine.sh ci/README.md is trimmed accordingly; its removed examples also cited ci/test/00_setup_env_arm.sh, a file that does not exist. --- ci/README.md | 49 ++---------- ci/test/04_install.sh | 146 ------------------------------------ ci/test/05_before_script.sh | 35 --------- ci/test/wrap-wine.sh | 20 ----- ci/test_run_all.sh | 11 --- 5 files changed, 5 insertions(+), 256 deletions(-) delete mode 100755 ci/test/04_install.sh delete mode 100755 ci/test/05_before_script.sh delete mode 100755 ci/test/wrap-wine.sh delete mode 100755 ci/test_run_all.sh diff --git a/ci/README.md b/ci/README.md index 901bb1643d14..433440af1298 100644 --- a/ci/README.md +++ b/ci/README.md @@ -2,40 +2,11 @@ This directory contains scripts for each build step in each build stage. -### Running a Stage Locally - -Be aware that the tests will be built and run in-place, so please run at your own risk. -If the repository is not a fresh git clone, you might have to clean files from previous builds or test runs first. - -The ci needs to perform various sysadmin tasks such as installing packages or writing to the user's home directory. -While most of the actions are done inside a docker container, this is not possible for all. Thus, cache directories, -such as the depends cache, previous release binaries, or ccache, are mounted as read-write into the docker container. While it should be fine to run -the ci system locally on your development box, the ci scripts can generally be assumed to have received less review and -testing compared to other parts of the codebase. If you want to keep the work tree clean, you might want to run the ci -system in a virtual machine with a Linux operating system of your choice. - -To allow for a wide range of tested environments, but also ensure reproducibility to some extent, the test stage -requires `docker` to be installed. To run on different architectures than the host `qemu` is also required. To install all requirements on Ubuntu, run - -``` -sudo apt install docker.io bash qemu-user-static -``` - -To run the default test stage, - -``` -./ci/test_run_all.sh -``` - -To run the test stage with a specific configuration, - -``` -FILE_ENV="./ci/test/00_setup_env_arm.sh" ./ci/test_run_all.sh -``` - ### Configurations -The test files (`FILE_ENV`) are constructed to test a wide range of +Configurations live in `ci/test/00_setup_env*.sh` and are selected by +`BUILD_TARGET` in `ci/dash/matrix.sh`, driven by the GitHub Actions workflows +in `.github/workflows`. They are constructed to test a wide range of configurations, rather than a single pass/fail. This helps to catch build failures and logic errors that present on platforms other than the ones the author has tested. @@ -45,18 +16,8 @@ the system package manager to install build dependencies. This guarantees that the tester is using the same versions as the release builds, which also use `./depends`. -If no `FILE_ENV` has been specified or values are left out, `00_setup_env.sh` -is used as the default configuration with fallback values. - -It is also possible to force a specific configuration without modifying the -file. For example, - -``` -MAKEJOBS="-j1" FILE_ENV="./ci/test/00_setup_env_arm.sh" ./ci/test_run_all.sh -``` - -The files starting with `0n` (`n` greater than 0) are the scripts that are run -in order. +If values are left out, `00_setup_env.sh` is used as the default configuration +with fallback values. ### Cache diff --git a/ci/test/04_install.sh b/ci/test/04_install.sh deleted file mode 100755 index 992d1ed19b17..000000000000 --- a/ci/test/04_install.sh +++ /dev/null @@ -1,146 +0,0 @@ -#!/usr/bin/env bash -# -# Copyright (c) 2018-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 - -if [[ $QEMU_USER_CMD == qemu-s390* ]]; then - export LC_ALL=C -fi - -# Create folders that are mounted into the docker -mkdir -p "${CCACHE_DIR}" -mkdir -p "${PREVIOUS_RELEASES_DIR}" - -export ASAN_OPTIONS="detect_stack_use_after_return=1:check_initialization_order=1:strict_init_order=1" -export LSAN_OPTIONS="suppressions=${BASE_BUILD_DIR}/test/sanitizer_suppressions/lsan:print_suppressions=0" -export TSAN_OPTIONS="suppressions=${BASE_BUILD_DIR}/test/sanitizer_suppressions/tsan:halt_on_error=1" -export UBSAN_OPTIONS="suppressions=${BASE_BUILD_DIR}/test/sanitizer_suppressions/ubsan:print_stacktrace=1:halt_on_error=1:report_error_type=1" -env | grep -E '^(BASE_|QEMU_|CCACHE_|LC_ALL|BOOST_TEST_RANDOM|DEBIAN_FRONTEND|CONFIG_SHELL|(ASAN|LSAN|TSAN|UBSAN)_OPTIONS|PREVIOUS_RELEASES_DIR))' | tee /tmp/env -if [[ $BITCOIN_CONFIG = *--with-sanitizers=*address* ]]; then # If ran with (ASan + LSan), Docker needs access to ptrace (https://github.com/google/sanitizers/issues/764) - DOCKER_ADMIN="--cap-add SYS_PTRACE" -fi - -export P_CI_DIR="$PWD" -export BINS_SCRATCH_DIR="${BASE_SCRATCH_DIR}/bins/" - -if [ -z "$DANGER_RUN_CI_ON_HOST" ]; then - echo "Creating $DOCKER_NAME_TAG container to run in" - LOCAL_UID=$(id -u) - LOCAL_GID=$(id -g) - - # the name isn't important, so long as we use the same UID - LOCAL_USER=nonroot - ${CI_RETRY_EXE} docker pull "$DOCKER_NAME_TAG" - - # shellcheck disable=SC2086 - DOCKER_ID=$(docker run $DOCKER_ADMIN -idt \ - --mount type=bind,src=$BASE_ROOT_DIR,dst=/ro_base,readonly \ - --mount type=bind,src=$CCACHE_DIR,dst=$CCACHE_DIR \ - --mount type=bind,src=$DEPENDS_DIR,dst=$DEPENDS_DIR \ - --mount type=bind,src=$PREVIOUS_RELEASES_DIR,dst=$PREVIOUS_RELEASES_DIR \ - -w $BASE_ROOT_DIR \ - --env-file /tmp/env \ - --name $CONTAINER_NAME \ - $DOCKER_NAME_TAG) - - # Create a non-root user inside the container which matches the local user. - # - # This prevents the root user in the container modifying the local file system permissions - # on the mounted directories - docker exec "$DOCKER_ID" useradd -u "$LOCAL_UID" -o -m "$LOCAL_USER" - docker exec "$DOCKER_ID" groupmod -o -g "$LOCAL_GID" "$LOCAL_USER" - docker exec "$DOCKER_ID" chown -R "$LOCAL_USER":"$LOCAL_USER" "${BASE_ROOT_DIR}" - export DOCKER_CI_CMD_PREFIX_ROOT="docker exec -u 0 $DOCKER_ID" - export DOCKER_CI_CMD_PREFIX="docker exec -u $LOCAL_UID $DOCKER_ID" - # Fixes permission issues when there is a container UID/GID mismatch with the owner - # of the mounted dash src dir. - $DOCKER_CI_CMD_PREFIX_ROOT git config --global --add safe.directory "*" -else - echo "Running on host system without docker wrapper" -fi - -CI_EXEC () { - $DOCKER_CI_CMD_PREFIX bash -c "export PATH=${BINS_SCRATCH_DIR}:\$PATH && cd \"$P_CI_DIR\" && $*" -} -CI_EXEC_ROOT () { - $DOCKER_CI_CMD_PREFIX_ROOT bash -c "export PATH=${BINS_SCRATCH_DIR}:\$PATH && cd \"$P_CI_DIR\" && $*" -} -export -f CI_EXEC -export -f CI_EXEC_ROOT - -CI_EXEC mkdir -p "${BINS_SCRATCH_DIR}" - -if [ -n "$DPKG_ADD_ARCH" ]; then - CI_EXEC_ROOT dpkg --add-architecture "$DPKG_ADD_ARCH" -fi - -if [[ $DOCKER_NAME_TAG == *centos* ]]; then - CI_EXEC_ROOT yum -y install epel-release - CI_EXEC_ROOT yum -y install "$DOCKER_PACKAGES" "$PACKAGES" -elif [ "$CI_USE_APT_INSTALL" != "no" ]; then - if [[ -n "${APPEND_APT_SOURCES_LIST}" ]]; then - CI_EXEC_ROOT echo "${APPEND_APT_SOURCES_LIST}" >> /etc/apt/sources.list - fi - ${CI_RETRY_EXE} CI_EXEC_ROOT apt-get update - ${CI_RETRY_EXE} CI_EXEC_ROOT apt-get install --no-install-recommends --no-upgrade -y "$PACKAGES" "$DOCKER_PACKAGES" -fi - -if [ -n "$PIP_PACKAGES" ]; then - if [ "$CI_OS_NAME" == "macos" ]; then - sudo -H pip3 install --upgrade pip - # shellcheck disable=SC2086 - IN_GETOPT_BIN="$(brew --prefix gnu-getopt)/bin/getopt" ${CI_RETRY_EXE} pip3 install --user $PIP_PACKAGES - else - # shellcheck disable=SC2086 - ${CI_RETRY_EXE} CI_EXEC pip3 install --user $PIP_PACKAGES - fi -fi - -if [ "$CI_OS_NAME" == "macos" ]; then - top -l 1 -s 0 | awk ' /PhysMem/ {print}' - echo "Number of CPUs: $(sysctl -n hw.logicalcpu)" -else - CI_EXEC free -m -h - CI_EXEC echo "Number of CPUs (nproc): $(nproc)" - CI_EXEC echo "$(lscpu | grep Endian)" -fi -CI_EXEC echo "Free disk space:" -CI_EXEC df -h - -if [ "$RUN_FUZZ_TESTS" = "true" ]; then - export DIR_FUZZ_IN=${DIR_QA_ASSETS}/fuzz_seed_corpus/ - if [ ! -d "$DIR_FUZZ_IN" ]; then - CI_EXEC git clone --depth=1 https://github.com/bitcoin-core/qa-assets "${DIR_QA_ASSETS}" - fi - ( - CI_EXEC cd "${DIR_QA_ASSETS}" - CI_EXEC echo "Using qa-assets repo from commit ..." - CI_EXEC git log -1 - ) -elif [ "$RUN_UNIT_TESTS" = "true" ] || [ "$RUN_UNIT_TESTS_SEQUENTIAL" = "true" ]; then - export DIR_UNIT_TEST_DATA=${DIR_QA_ASSETS}/unit_test_data/ - if [ ! -d "$DIR_UNIT_TEST_DATA" ]; then - CI_EXEC mkdir -p "$DIR_UNIT_TEST_DATA" - CI_EXEC curl --location --fail https://github.com/bitcoin-core/qa-assets/raw/main/unit_test_data/script_assets_test.json -o "${DIR_UNIT_TEST_DATA}/script_assets_test.json" - fi -fi - -CI_EXEC mkdir -p "${BASE_SCRATCH_DIR}/sanitizer-output/" - -if [ -z "$DANGER_RUN_CI_ON_HOST" ]; then - echo "Create $BASE_ROOT_DIR" - CI_EXEC rsync -a /ro_base/ "$BASE_ROOT_DIR" -fi - -if [ "$USE_BUSY_BOX" = "true" ]; then - echo "Setup to use BusyBox utils" - # tar excluded for now because it requires passing in the exact archive type in ./depends (fixed in later BusyBox version) - # ar excluded for now because it does not recognize the -q option in ./depends (unknown if fixed) - # shellcheck disable=SC1010 - CI_EXEC for util in \$\(busybox --list \| grep -v "^ar$" \| grep -v "^tar$" \)\; do ln -s \$\(command -v busybox\) "${BINS_SCRATCH_DIR}/\$util"\; done - # Print BusyBox version - CI_EXEC patch --help -fi diff --git a/ci/test/05_before_script.sh b/ci/test/05_before_script.sh deleted file mode 100755 index e8043f65dfd7..000000000000 --- a/ci/test/05_before_script.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/usr/bin/env bash -# -# Copyright (c) 2018-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 - -# Make sure default datadir does not exist and is never read by creating a dummy file -if [ "$CI_OS_NAME" == "macos" ]; then - echo > "${HOME}/Library/Application Support/DashCore" -else - CI_EXEC echo \> \$HOME/.dashcore - CI_EXEC_ROOT echo \> \$HOME/.dashcore -fi - -CI_EXEC mkdir -p "${DEPENDS_DIR}/SDKs" "${DEPENDS_DIR}/sdk-sources" - -if [ -n "$XCODE_VERSION" ] && [ ! -f "$OSX_SDK_PATH" ]; then - CI_EXEC curl --location --fail "${SDK_URL}/${OSX_SDK_BASENAME}" -o "$OSX_SDK_PATH" -fi -if [ -n "$XCODE_VERSION" ] && [ -f "$OSX_SDK_PATH" ]; then - CI_EXEC tar -C "${DEPENDS_DIR}/SDKs" -xf "$OSX_SDK_PATH" -fi -if [ -z "$NO_DEPENDS" ]; then - if [[ $DOCKER_NAME_TAG == *centos* ]]; then - SHELL_OPTS="CONFIG_SHELL=/bin/dash" - else - SHELL_OPTS="CONFIG_SHELL=" - fi - CI_EXEC "$SHELL_OPTS" make "$MAKEJOBS" -C depends HOST="$HOST" "$DEP_OPTS" LOG=1 -fi -if [ "$DOWNLOAD_PREVIOUS_RELEASES" = "true" ]; then - CI_EXEC test/get_previous_releases.py -b -t "$PREVIOUS_RELEASES_DIR" -fi diff --git a/ci/test/wrap-wine.sh b/ci/test/wrap-wine.sh deleted file mode 100755 index 1662f8f6a335..000000000000 --- a/ci/test/wrap-wine.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env bash -# -# Copyright (c) 2020-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 - -for b_name in {"${BASE_OUTDIR}/bin"/*,src/secp256k1/*tests,src/minisketch/test{,-verify},src/univalue/{test_json,unitester,object}}.exe; do - # shellcheck disable=SC2044 - for b in $(find "${BASE_ROOT_DIR}" -executable -type f -name "$(basename "$b_name")"); do - if (file "$b" | grep "Windows"); then - echo "Wrap $b ..." - mv "$b" "${b}_orig" - echo '#!/usr/bin/env bash' > "$b" - echo "( wine \"${b}_orig\" \"\$@\" ) || ( sleep 1 && wine \"${b}_orig\" \"\$@\" )" >> "$b" - chmod +x "$b" - fi - done -done diff --git a/ci/test_run_all.sh b/ci/test_run_all.sh deleted file mode 100755 index da17d8763d84..000000000000 --- a/ci/test_run_all.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env bash -# -# Copyright (c) 2019-2020 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 - -set -o errexit; source ./ci/test/00_setup_env.sh -set -o errexit; source ./ci/test/04_install.sh -set -o errexit; source ./ci/test/05_before_script.sh