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 1c42cd236cf1..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 @@ -206,7 +178,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/.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/.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 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/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"; 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 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} 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 && \