From 6bee7ef133144c62780cfadabd016ed4a1322f25 Mon Sep 17 00:00:00 2001 From: pasta Date: Fri, 30 May 2025 16:43:00 -0500 Subject: [PATCH 1/3] ci: implement native ARM64 builds using dedicated runners Replace cross-compilation approach with native ARM64 builds to resolve build failures and improve performance. Changes: - Remove QEMU setup and multi-platform builds from build-container.yml - Add container-arm64 and container-slim-arm64 jobs using ubuntu-24.04-arm64 runners - Parameterize build-container.yml to accept runs-on input - Simplify shellcheck architecture detection in ci-slim.Dockerfile - Use same container names for both architectures This approach eliminates GCC segfaults during cppcheck compilation on ARM64 and provides faster, more reliable builds compared to emulated cross-compilation. --- .github/workflows/build-container.yml | 8 ++++++-- .github/workflows/build.yml | 18 ++++++++++++++++++ contrib/containers/ci/ci-slim.Dockerfile | 4 +++- 3 files changed, 27 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-container.yml b/.github/workflows/build-container.yml index 67df008c220d..cd89c19173b7 100644 --- a/.github/workflows/build-container.yml +++ b/.github/workflows/build-container.yml @@ -1,5 +1,4 @@ name: Build container - on: workflow_call: inputs: @@ -15,6 +14,11 @@ on: description: "Container name" required: true type: string + runs-on: + description: "Runner to use" + required: false + type: string + default: "ubuntu-24.04" outputs: path: description: "Path to built container" @@ -23,7 +27,7 @@ on: jobs: build: name: Build container - runs-on: ubuntu-24.04 + runs-on: ${{ inputs.runs-on }} outputs: tag: ${{ steps.prepare.outputs.tag }} repo: ${{ steps.prepare.outputs.repo }} diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f77a9a4d26aa..6893b2178da3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -34,6 +34,24 @@ jobs: file: ./contrib/containers/ci/ci-slim.Dockerfile name: dashcore-ci-slim + container-arm64: + name: Build container (ARM64) + uses: ./.github/workflows/build-container.yml + with: + context: ./contrib/containers/ci + file: ./contrib/containers/ci/ci.Dockerfile + name: dashcore-ci-runner + runs-on: ubuntu-24.04-arm + + container-slim-arm64: + name: Build slim container (ARM64) + uses: ./.github/workflows/build-container.yml + with: + context: ./contrib/containers/ci + file: ./contrib/containers/ci/ci-slim.Dockerfile + name: dashcore-ci-slim + runs-on: ubuntu-24.04-arm + depends-arm-linux: name: arm-linux-gnueabihf uses: ./.github/workflows/build-depends.yml diff --git a/contrib/containers/ci/ci-slim.Dockerfile b/contrib/containers/ci/ci-slim.Dockerfile index 2bfb3baea243..c7002a6db443 100644 --- a/contrib/containers/ci/ci-slim.Dockerfile +++ b/contrib/containers/ci/ci-slim.Dockerfile @@ -88,7 +88,9 @@ RUN set -ex; \ ARG SHELLCHECK_VERSION=v0.7.1 RUN set -ex; \ - curl -fL "https://github.com/koalaman/shellcheck/releases/download/${SHELLCHECK_VERSION}/shellcheck-${SHELLCHECK_VERSION}.linux.x86_64.tar.xz" -o /tmp/shellcheck.tar.xz; \ + ARCH=$(uname -m); \ + if [ "$ARCH" = "aarch64" ]; then SHELLCHECK_ARCH="aarch64"; else SHELLCHECK_ARCH="x86_64"; fi; \ + curl -fL "https://github.com/koalaman/shellcheck/releases/download/${SHELLCHECK_VERSION}/shellcheck-${SHELLCHECK_VERSION}.linux.${SHELLCHECK_ARCH}.tar.xz" -o /tmp/shellcheck.tar.xz; \ mkdir -p /opt/shellcheck && tar -xf /tmp/shellcheck.tar.xz -C /opt/shellcheck --strip-components=1 && rm /tmp/shellcheck.tar.xz ENV PATH="/opt/shellcheck:${PATH}" From b071188d2450245027b02b50ddf099e2c10482bb Mon Sep 17 00:00:00 2001 From: pasta Date: Sun, 1 Jun 2025 15:14:07 -0500 Subject: [PATCH 2/3] ci: enhance container build workflow for ARM64 and slim images --- .github/workflows/build-container.yml | 35 ++++++++++++++-- .github/workflows/build.yml | 58 +++++++++++++-------------- 2 files changed, 58 insertions(+), 35 deletions(-) diff --git a/.github/workflows/build-container.yml b/.github/workflows/build-container.yml index cd89c19173b7..7815253143c3 100644 --- a/.github/workflows/build-container.yml +++ b/.github/workflows/build-container.yml @@ -7,11 +7,19 @@ on: required: true type: string file: - description: "Path to Dockerfile" + description: "Path to main Dockerfile" required: true type: string name: - description: "Container name" + description: "Main container name" + required: true + type: string + slim-file: + description: "Path to slim Dockerfile" + required: true + type: string + slim-name: + description: "Slim container name" required: true type: string runs-on: @@ -21,8 +29,11 @@ on: default: "ubuntu-24.04" outputs: path: - description: "Path to built container" + description: "Path to built main container" value: ghcr.io/${{ jobs.build.outputs.repo }}/${{ inputs.name }}:${{ jobs.build.outputs.tag }} + slim-path: + description: "Path to built slim container" + value: ghcr.io/${{ jobs.build.outputs.repo }}/${{ inputs.slim-name }}:${{ jobs.build.outputs.tag }} jobs: build: @@ -55,7 +66,23 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - - name: Build and push Docker image + - name: Build and push SLIM Docker image + uses: docker/build-push-action@v6 + with: + context: ${{ inputs.context }} + file: ${{ inputs.slim-file }} + push: true + tags: | + ghcr.io/${{ steps.prepare.outputs.repo }}/${{ inputs.slim-name }}:${{ hashFiles(inputs.slim-file) }} + ghcr.io/${{ steps.prepare.outputs.repo }}/${{ inputs.slim-name }}:${{ steps.prepare.outputs.tag }} + ghcr.io/${{ steps.prepare.outputs.repo }}/${{ inputs.slim-name }}:latest + cache-from: | + type=registry,ref=ghcr.io/${{ steps.prepare.outputs.repo }}/${{ inputs.slim-name }}:${{ hashFiles(inputs.slim-file) }} + type=registry,ref=ghcr.io/${{ steps.prepare.outputs.repo }}/${{ inputs.slim-name }}:${{ steps.prepare.outputs.tag }} + type=registry,ref=ghcr.io/${{ steps.prepare.outputs.repo }}/${{ inputs.slim-name }}:latest + cache-to: type=inline + + - name: Build and push MAIN Docker image uses: docker/build-push-action@v6 with: context: ${{ inputs.context }} diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6893b2178da3..7a66bf4acfaa 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,37 +19,24 @@ concurrency: jobs: container: - name: Build container + name: Build containers (amd64) uses: ./.github/workflows/build-container.yml with: context: ./contrib/containers/ci file: ./contrib/containers/ci/ci.Dockerfile name: dashcore-ci-runner - - container-slim: - name: Build slim container - uses: ./.github/workflows/build-container.yml - with: - context: ./contrib/containers/ci - file: ./contrib/containers/ci/ci-slim.Dockerfile - name: dashcore-ci-slim + slim-file: ./contrib/containers/ci/ci-slim.Dockerfile + slim-name: dashcore-ci-slim container-arm64: - name: Build container (ARM64) + name: Build containers (ARM64) uses: ./.github/workflows/build-container.yml with: context: ./contrib/containers/ci file: ./contrib/containers/ci/ci.Dockerfile name: dashcore-ci-runner - runs-on: ubuntu-24.04-arm - - container-slim-arm64: - name: Build slim container (ARM64) - uses: ./.github/workflows/build-container.yml - with: - context: ./contrib/containers/ci - file: ./contrib/containers/ci/ci-slim.Dockerfile - name: dashcore-ci-slim + slim-file: ./contrib/containers/ci/ci-slim.Dockerfile + slim-name: dashcore-ci-slim runs-on: ubuntu-24.04-arm depends-arm-linux: @@ -211,53 +198,62 @@ jobs: test-linux64: name: linux64-test uses: ./.github/workflows/test-src.yml - needs: [container-slim, src-linux64] + needs: [container, src-linux64] with: bundle-key: ${{ needs.src-linux64.outputs.key }} build-target: linux64 - container-path: ${{ needs.container-slim.outputs.path }} + container-path: ${{ needs.container.outputs.slim-path }} test-linux64_multiprocess: name: linux64_multiprocess-test uses: ./.github/workflows/test-src.yml - needs: [container-slim, src-linux64_multiprocess] + needs: [container, src-linux64_multiprocess] with: bundle-key: ${{ needs.src-linux64_multiprocess.outputs.key }} build-target: linux64_multiprocess - container-path: ${{ needs.container-slim.outputs.path }} + container-path: ${{ needs.container.outputs.slim-path }} test-linux64_nowallet: name: linux64_nowallet-test uses: ./.github/workflows/test-src.yml - needs: [container-slim, src-linux64_nowallet] + needs: [container, src-linux64_nowallet] with: bundle-key: ${{ needs.src-linux64_nowallet.outputs.key }} build-target: linux64_nowallet - container-path: ${{ needs.container-slim.outputs.path }} + container-path: ${{ needs.container.outputs.slim-path }} test-linux64_sqlite: name: linux64_sqlite-test uses: ./.github/workflows/test-src.yml - needs: [container-slim, src-linux64_sqlite] + needs: [container, src-linux64_sqlite] with: bundle-key: ${{ needs.src-linux64_sqlite.outputs.key }} build-target: linux64_sqlite - container-path: ${{ needs.container-slim.outputs.path }} + container-path: ${{ needs.container.outputs.slim-path }} test-linux64_tsan: name: linux64_tsan-test uses: ./.github/workflows/test-src.yml - needs: [container-slim, src-linux64_tsan] + needs: [container, src-linux64_tsan] with: bundle-key: ${{ needs.src-linux64_tsan.outputs.key }} build-target: linux64_tsan - container-path: ${{ needs.container-slim.outputs.path }} + container-path: ${{ needs.container.outputs.slim-path }} test-linux64_ubsan: name: linux64_ubsan-test uses: ./.github/workflows/test-src.yml - needs: [container-slim, src-linux64_ubsan] + needs: [container, src-linux64_ubsan] with: bundle-key: ${{ needs.src-linux64_ubsan.outputs.key }} build-target: linux64_ubsan - container-path: ${{ needs.container-slim.outputs.path }} + container-path: ${{ needs.container.outputs.slim-path }} + + test-arm-linux: + name: arm-linux-test + uses: ./.github/workflows/test-src.yml + needs: [container-arm64, src-arm-linux] + with: + bundle-key: ${{ needs.src-arm-linux.outputs.key }} + build-target: arm-linux + container-path: ${{ needs.container-arm64.outputs.slim-path }} From bb123cca63305cf6e37283919d281cf93c88f687 Mon Sep 17 00:00:00 2001 From: pasta Date: Thu, 10 Jul 2025 12:51:52 -0500 Subject: [PATCH 3/3] fix: use amd64 container for arm-linux tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The test-arm-linux job runs on standard GitHub runners (amd64) and needs to use the amd64 container image. Previously it was incorrectly configured to use the ARM64 container, causing "no matching manifest for linux/amd64" errors during container pull. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7a66bf4acfaa..7038ff84d903 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -252,8 +252,8 @@ jobs: test-arm-linux: name: arm-linux-test uses: ./.github/workflows/test-src.yml - needs: [container-arm64, src-arm-linux] + needs: [container, src-arm-linux] with: bundle-key: ${{ needs.src-arm-linux.outputs.key }} build-target: arm-linux - container-path: ${{ needs.container-arm64.outputs.slim-path }} + container-path: ${{ needs.container.outputs.slim-path }}