From f6a7aeeb2539f9c4978179353400e3b0acd0517f Mon Sep 17 00:00:00 2001 From: Konstantin Akimov Date: Thu, 22 Oct 2026 02:10:13 +0700 Subject: [PATCH 1/5] ci: upload guix outputs without recompressing them The guix output directory holds .tar.gz, .zip and .dmg files, so the default zip compression of upload-artifact only burns CPU. --- .github/workflows/guix-build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/guix-build.yml b/.github/workflows/guix-build.yml index 5bd5897eed09..9004df28ec4e 100644 --- a/.github/workflows/guix-build.yml +++ b/.github/workflows/guix-build.yml @@ -163,6 +163,7 @@ jobs: name: guix-artifacts-${{ matrix.build_target }} path: | ${{ github.workspace }}/dash/guix-build*/output/${{ matrix.build_target }}/ + compression-level: 0 - name: Attest build provenance uses: actions/attest@v4 From 494531fafdbec855d2b37de3f17a0491e8e7da65 Mon Sep 17 00:00:00 2001 From: Konstantin Akimov Date: Thu, 22 Oct 2026 02:10:13 +0700 Subject: [PATCH 2/5] ci: write ccache entries at zstd level 9 instead of recompressing later Entries were written at ccache's default level 1 and then every build, including pull request builds that never save the cache, ran ccache -X 9 to recompress them. Writing at level 9 from the start removes that pass and also shrinks what gets uploaded to the remote ccache, which only ever saw the level 1 bytes. On 1 GB of object files level 9 is 7% smaller than level 1, and level 5 gains nothing over level 1. --- .github/workflows/build-src.yml | 1 - ci/test/00_setup_env.sh | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-src.yml b/.github/workflows/build-src.yml index 1c42cd236cf1..5d38ea6c3c8d 100644 --- a/.github/workflows/build-src.yml +++ b/.github/workflows/build-src.yml @@ -206,7 +206,6 @@ jobs: source ./ci/dash/matrix.sh ./ci/dash/build_src.sh { echo "### ccache: ${BUILD_TARGET}"; echo '```'; ccache --show-stats; echo '```'; } >> "${GITHUB_STEP_SUMMARY}" - ccache -X 9 ccache -c du -hd0 "${BASE_OUTDIR}" rm -rf "${BASE_OUTDIR}" diff --git a/ci/test/00_setup_env.sh b/ci/test/00_setup_env.sh index 33d878d7b20a..ad0974934be1 100755 --- a/ci/test/00_setup_env.sh +++ b/ci/test/00_setup_env.sh @@ -60,6 +60,7 @@ export CACHE_DIR=${CACHE_DIR:-$HOST_CACHE_DIR} export CCACHE_MAXSIZE=${CCACHE_MAXSIZE:-100M} export CCACHE_TEMPDIR=${CCACHE_TEMPDIR:-/tmp/.ccache-temp} export CCACHE_COMPRESS=${CCACHE_COMPRESS:-1} +export CCACHE_COMPRESSLEVEL=${CCACHE_COMPRESSLEVEL:-9} # The cache dir. # This folder exists only on the ci guest, and on the ci host as a volume. export CCACHE_DIR=${CCACHE_DIR:-$CACHE_DIR/ccache} From bb9e9af76dab49b2f5e8a97b47b1a79544e86bf8 Mon Sep 17 00:00:00 2001 From: Konstantin Akimov Date: Thu, 22 Oct 2026 02:10:13 +0700 Subject: [PATCH 3/5] ci: compress functional test logs with zstd level 9 Test logs are highly repetitive text, and on a 160 MB sample level 9 is 13% smaller than level 5 while taking 0.3 s instead of 0.2 s. The highest Level 19 would be 32% smaller but more than a hundred times slower, which does not scale to the multi-gigabyte sanitizer logs. Level 9 seems as a good balance of CPU / storage --- ci/dash/bundle-logs.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/dash/bundle-logs.sh b/ci/dash/bundle-logs.sh index f2c022a7a929..9e8432e3b5b0 100755 --- a/ci/dash/bundle-logs.sh +++ b/ci/dash/bundle-logs.sh @@ -24,5 +24,5 @@ if [ -f "${LOG_ARCHIVE}" ]; then exit 1; fi -tar --use-compress-program="zstd -T0 -5" -cf "${LOG_ARCHIVE}" "${LOG_DIRECTORY}" +tar --use-compress-program="zstd -T0 -9" -cf "${LOG_ARCHIVE}" "${LOG_DIRECTORY}" sha256sum "${LOG_ARCHIVE}" > "${LOG_ARCHIVE}.sha256"; From 4d3394a0879f840311c3b02d4d35209e392ac33b Mon Sep 17 00:00:00 2001 From: Konstantin Akimov Date: Thu, 22 Oct 2026 02:10:13 +0700 Subject: [PATCH 4/5] ci: stop bundling the test binaries that the test job deletes on arrival slim-workspace.sh removes test_dash, bench_dash, fuzz, test_dash-qt and the generated qrc_*.cpp right after extracting the build bundle, so the functional test job pays to download them and thte build job pays to compress and upload them for nothing. In a local build these files are about two thirds of the binaries in the bundle. The unit tests run before bundling, so leaving them out of the archive changes nothing else. dash-qt and dash-tx stay in the bundle: the win64 and mac bundles have no test job and exist so people can download the product binaries. --- ci/dash/bundle-artifacts.sh | 8 ++++++++ ci/dash/slim-workspace.sh | 7 ------- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/ci/dash/bundle-artifacts.sh b/ci/dash/bundle-artifacts.sh index 4dee64717933..8625a8bbc686 100755 --- a/ci/dash/bundle-artifacts.sh +++ b/ci/dash/bundle-artifacts.sh @@ -42,6 +42,14 @@ if [ "${VERB}" = "create" ]; then "*.o" ".deps" ".libs" + # Test binaries and generated sources that only the unit tests, run + # before bundling, need + "src/bench/bench_dash" + "src/qt/qrc_bitcoin.cpp" + "src/qt/qrc_dash_locale.cpp" + "src/qt/test/test_dash-qt" + "src/test/fuzz/fuzz" + "src/test/test_dash" ) EXCLUSIONS_ARG="" for excl in "${EXCLUSIONS[@]}" diff --git a/ci/dash/slim-workspace.sh b/ci/dash/slim-workspace.sh index 0ccb4de77830..e8f98fd155f4 100755 --- a/ci/dash/slim-workspace.sh +++ b/ci/dash/slim-workspace.sh @@ -22,14 +22,7 @@ TARGETS=( "${BUNDLE_KEY}.tar.zst" # Binaries not needed by functional tests "build-ci/dashcore-${BUILD_TARGET}/src/dash-tx" - "build-ci/dashcore-${BUILD_TARGET}/src/bench/bench_dash" "build-ci/dashcore-${BUILD_TARGET}/src/qt/dash-qt" - "build-ci/dashcore-${BUILD_TARGET}/src/qt/test/test_dash-qt" - "build-ci/dashcore-${BUILD_TARGET}/src/test/test_dash" - "build-ci/dashcore-${BUILD_TARGET}/src/test/fuzz/fuzz" - # Misc. files that can be heavy - "build-ci/dashcore-${BUILD_TARGET}/src/qt/qrc_bitcoin.cpp" - "build-ci/dashcore-${BUILD_TARGET}/src/qt/qrc_dash_locale.cpp" ) # Delete what we don't need From 289c7f8acc07c10e6285b54ee96cefd3426ec1c2 Mon Sep 17 00:00:00 2001 From: Konstantin Akimov Date: Thu, 22 Oct 2026 01:02:39 +0700 Subject: [PATCH 5/5] ci: bake the macOS SDK into the CI runner image The mac depends and build jobs fetched the SDK at job time: a cache lookup in check-cache, a download from bitcoincore.org on a miss, an artifact handoff for runs whose cache token is read-only, and a restore-or-download-or-fail step triplet in each consuming job. That is nine workflow steps and a workflow output/input pair for a 200 MB input that only changes when depends/hosts/darwin.mk bumps the Xcode version, and it took a slot in the 10 GB repository cache that the ccache generations already fill. Download, verify and extract the SDK while building ci.Dockerfile instead, the way bitcoin/bitcoin#27028 moved the SDK into its CI images, and hand its location to depends through SDK_PATH, since depends/Makefile defaults that to depends/SDKs inside the checkout. The depends and ccache cache keys already hash ci.Dockerfile, so an SDK bump there invalidates them as before. contrib/containers/guix/scripts/setup-sdk stays for the Guix container. --- .github/workflows/build-depends.yml | 58 ----------------------------- .github/workflows/build-src.yml | 28 -------------- .github/workflows/build.yml | 1 - contrib/containers/ci/ci.Dockerfile | 15 ++++++++ 4 files changed, 15 insertions(+), 87 deletions(-) diff --git a/.github/workflows/build-depends.yml b/.github/workflows/build-depends.yml index fdd09c425545..211958857ae4 100644 --- a/.github/workflows/build-depends.yml +++ b/.github/workflows/build-depends.yml @@ -41,9 +41,6 @@ on: built-artifact: description: "Artifact holding freshly built depends (empty when restored from cache)" value: ${{ jobs.build.outputs.built-artifact }} - sdk-artifact: - description: "Artifact holding prepared SDKs (empty when restored from cache)" - value: ${{ jobs.check-cache.outputs.sdk-artifact }} jobs: check-cache: @@ -55,7 +52,6 @@ jobs: cache-key-prefix: ${{ steps.setup.outputs.cache-key-prefix }} host: ${{ steps.setup.outputs.HOST }} dep-opts: ${{ steps.setup.outputs.DEP_OPTS }} - sdk-artifact: ${{ steps.prepare-sdks.outputs.artifact }} steps: - name: Checkout code uses: actions/checkout@v6 @@ -69,7 +65,6 @@ jobs: depends contrib/containers/ci/ci.Dockerfile contrib/containers/ci/ci-slim.Dockerfile - contrib/containers/guix/scripts/setup-sdk - name: Compute cache key id: setup @@ -104,36 +99,6 @@ jobs: key: ${{ steps.setup.outputs.cache-key }} lookup-only: true - - name: Cache SDKs - id: cache-sdk-check - uses: actions/cache@v5 - if: inputs.build-target == 'mac' - with: - path: depends/SDKs - key: depends-sdks-${{ hashFiles('depends/hosts/darwin.mk') }} - restore-keys: depends-sdks- - - - name: Prepare SDKs - id: prepare-sdks - if: inputs.build-target == 'mac' && steps.cache-sdk-check.outputs.cache-hit != 'true' - env: - BUILD_TARGET: ${{ inputs.build-target }} - run: | - ./contrib/containers/guix/scripts/setup-sdk - echo "artifact=depends-sdks-${BUILD_TARGET}" >> "${GITHUB_OUTPUT}" - - - name: Upload prepared SDKs - # This originates in check-cache so both Build depends (when needed) - # and Build source can use it even when a PR cannot save the cache. - if: steps.prepare-sdks.outputs.artifact != '' - uses: actions/upload-artifact@v6 - with: - name: ${{ steps.prepare-sdks.outputs.artifact }} - path: depends/SDKs - compression-level: 0 - retention-days: 1 - overwrite: true - build: name: Build depends needs: [check-cache] @@ -173,29 +138,6 @@ jobs: key: depends-sources-${{ hashFiles('depends/packages/*') }} restore-keys: depends-sources- - - name: Restore SDKs cache - id: sdk-cache - uses: actions/cache/restore@v5 - if: inputs.build-target == 'mac' - with: - path: depends/SDKs - key: depends-sdks-${{ hashFiles('depends/hosts/darwin.mk') }} - restore-keys: depends-sdks- - - - name: Download prepared SDKs - if: inputs.build-target == 'mac' && steps.sdk-cache.outputs.cache-hit != 'true' && needs.check-cache.outputs.sdk-artifact != '' - uses: actions/download-artifact@v8 - with: - name: ${{ needs.check-cache.outputs.sdk-artifact }} - path: depends/SDKs - - - name: Check prepared SDKs are present - if: inputs.build-target == 'mac' && steps.sdk-cache.outputs.cache-hit != 'true' && needs.check-cache.outputs.sdk-artifact == '' - run: | - echo "::error::SDK cache restore missed and no prepared SDK artifact was provided" - exit 1 - shell: bash - - name: Restore cached depends uses: actions/cache/restore@v5 with: diff --git a/.github/workflows/build-src.yml b/.github/workflows/build-src.yml index 5d38ea6c3c8d..bea05051f72a 100644 --- a/.github/workflows/build-src.yml +++ b/.github/workflows/build-src.yml @@ -29,11 +29,6 @@ on: required: false type: string default: "" - sdk-artifact: - description: "Artifact holding prepared SDKs, used if the cache restore misses" - required: false - type: string - default: "" runs-on: description: "Runner label to use (e.g., ubuntu-24.04 or ubuntu-24.04-arm)" required: true @@ -84,29 +79,6 @@ jobs: echo "PR_BASE_SHA=${PR_BASE_SHA}" >> $GITHUB_OUTPUT shell: bash - - name: Restore SDKs cache - id: sdk-cache - uses: actions/cache/restore@v5 - if: inputs.build-target == 'mac' - with: - path: | - depends/SDKs - key: depends-sdks-${{ hashFiles('depends/hosts/darwin.mk') }} - - - name: Download prepared SDKs - if: inputs.build-target == 'mac' && steps.sdk-cache.outputs.cache-hit != 'true' && inputs.sdk-artifact != '' - uses: actions/download-artifact@v8 - with: - name: ${{ inputs.sdk-artifact }} - path: depends/SDKs - - - name: Check prepared SDKs are present - if: inputs.build-target == 'mac' && steps.sdk-cache.outputs.cache-hit != 'true' && inputs.sdk-artifact == '' - run: | - echo "::error::SDK cache restore missed and no prepared SDK artifact was provided" - exit 1 - shell: bash - - name: Restore depends cache id: depends-cache uses: actions/cache/restore@v5 diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 52811ebc8276..ecd017fe24fa 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -425,7 +425,6 @@ jobs: depends-host: ${{ needs.depends-mac.outputs.host }} depends-dep-opts: ${{ needs.depends-mac.outputs.dep-opts }} depends-artifact: ${{ needs.depends-mac.outputs.built-artifact }} - sdk-artifact: ${{ needs.depends-mac.outputs.sdk-artifact }} runs-on: ${{ needs.check-skip.outputs['runner-amd64'] }} secrets: *remote-ccache-auth diff --git a/contrib/containers/ci/ci.Dockerfile b/contrib/containers/ci/ci.Dockerfile index 070e0f26d65f..e73be67c7dfc 100644 --- a/contrib/containers/ci/ci.Dockerfile +++ b/contrib/containers/ci/ci.Dockerfile @@ -108,6 +108,21 @@ RUN set -ex; \ -o /usr/local/bin/clang-tidy-cache; \ chmod +x /usr/local/bin/clang-tidy-cache; +# The SDK lives in the image rather than in a per-run cache. depends/Makefile +# looks for it under depends/SDKs, inside the checkout, so point it here. +# Keep the version in sync with depends/hosts/darwin.mk. +ARG XCODE_VERSION=26.1.1 +ARG XCODE_BUILD_ID=17B100 +ARG OSX_SDK_SHA256=9600fa93644df674ee916b5e2c8a6ba8dacf631996a65dc922d003b98b5ea3b1 +ENV SDK_PATH=/opt/SDKs +RUN set -ex; \ + OSX_SDK_BASENAME="Xcode-${XCODE_VERSION}-${XCODE_BUILD_ID}-extracted-SDK-with-libcxx-headers"; \ + curl -fL "https://bitcoincore.org/depends-sources/sdks/${OSX_SDK_BASENAME}.tar" -o /tmp/sdk.tar; \ + echo "${OSX_SDK_SHA256} /tmp/sdk.tar" | sha256sum -c -; \ + mkdir -p "${SDK_PATH}"; \ + tar -C "${SDK_PATH}" -xf /tmp/sdk.tar; \ + rm -f /tmp/sdk.tar + RUN \ mkdir -p /cache/ccache && \ mkdir /cache/ctcache && \