From dac1f13a3da3d604818b14dbdff7de86e73c59f8 Mon Sep 17 00:00:00 2001 From: Adrien Cacciaguerra Date: Mon, 9 Nov 2026 14:20:18 -0800 Subject: [PATCH 1/3] ci: run the release build on pull requests `pr-run-mode = "upload"` makes dist build every release artifact on pull requests and attach it to the workflow run; publishing still needs a tag push. The draft release job, the one custom job dist also runs on pull requests in this mode, skips them. This replaces `musl-build`, which built the musl targets with plain `cargo build` and so kept the `-lgcc` from `target.aarch64-unknown-linux-musl.rustflags`. dist sets `RUSTFLAGS`, which makes cargo ignore that table: the 5.7.0 aarch64 musl release failed to link while `musl-build` passed. Refs COD-4123 Co-Authored-By: Claude Opus 5.5 --- .github/workflows/ci.yml | 27 ---------------------- .github/workflows/create-draft-release.yml | 1 + dist-workspace.toml | 4 ++-- 3 files changed, 3 insertions(+), 29 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b76593946..b7b10f198 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -310,32 +310,6 @@ jobs: runner-version: rev:${{ env.CODSPEED_REV }} skip-hash-check-warning: true - musl-build: - runs-on: ${{ matrix.runner }} - strategy: - fail-fast: false - matrix: - include: - - runner: ubuntu-latest - target: x86_64-unknown-linux-musl - - runner: ubuntu-24.04-arm - target: aarch64-unknown-linux-musl - steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - submodules: true - - uses: ./.github/actions/install-rust - with: - cache-key: ${{ matrix.target }} - - uses: ./.github/actions/install-bpf-deps - - name: Install the musl toolchain - run: | - sudo apt-get install -y musl-tools linux-libc-dev - rustup target add "${{ matrix.target }}" - - - name: Build - run: cargo build --bin codspeed --target "${{ matrix.target }}" - check: runs-on: ubuntu-latest if: always() @@ -348,7 +322,6 @@ jobs: - basic-run-test - macos-basic-run-test - bpf-tests - - musl-build - benchmarks - memtrack-benchmarks steps: diff --git a/.github/workflows/create-draft-release.yml b/.github/workflows/create-draft-release.yml index ab36ac2f8..c8cf4d511 100644 --- a/.github/workflows/create-draft-release.yml +++ b/.github/workflows/create-draft-release.yml @@ -9,6 +9,7 @@ on: jobs: main: + if: github.event_name != 'pull_request' runs-on: ubuntu-latest env: PLAN: ${{ inputs.plan }} diff --git a/dist-workspace.toml b/dist-workspace.toml index fc1cd22a9..7eb01b278 100644 --- a/dist-workspace.toml +++ b/dist-workspace.toml @@ -13,8 +13,8 @@ ci = "github" installers = ["shell"] # The archive format to use for non-windows builds (defaults .tar.xz) unix-archive = ".tar.gz" -# Which actions to run on pull requests -pr-run-mode = "plan" +# Builds every artifact on PRs and keeps them on the workflow run; only a tag push publishes +pr-run-mode = "upload" # Post-announce jobs to run in CI post-announce-jobs = ["./post-announce"] # Path that installers should place binaries in From b2e2f52a2e4bbdd7d066aac52690e1b804c4f422 Mon Sep 17 00:00:00 2001 From: Adrien Cacciaguerra Date: Mon, 9 Nov 2026 09:55:32 -0800 Subject: [PATCH 2/3] build: inline aarch64 atomics in musl C code instead of linking libgcc The v5.7.0 release failed to link codspeed for aarch64-unknown-linux-musl: dist sets `RUSTFLAGS` for musl targets, which replaces the `-lgcc` from `target.aarch64-unknown-linux-musl.rustflags`, so libbpf's calls to gcc's outline-atomic helpers (`__aarch64_ldadd4_sync`) stayed unresolved. Compile the C code with `-mno-outline-atomics` instead, so the atomics are inlined and nothing is needed at link time, whatever `RUSTFLAGS` holds. Refs COD-4123 Co-Authored-By: Claude Opus 5.5 --- .cargo/config.toml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.cargo/config.toml b/.cargo/config.toml index 95d67cab3..20a61b30e 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -20,10 +20,10 @@ CPATH = { value = "crates/memtrack/musl", relative = true } # have to be added back, last so they never shadow the toolchain's own. Scoped # per target: cc-rs looks up `CFLAGS_` before `CFLAGS`, and libbpf-sys # builds zlib, elfutils and libbpf from `cc::Tool::cflags_env()`. +# +# rustc links with `-nodefaultlibs`, so libgcc's outline-atomic helpers that +# gcc calls by default on aarch64 are missing: inline the atomics instead. A +# `-lgcc` in `target..rustflags` would be dropped whenever `RUSTFLAGS` +# is set in the environment. CFLAGS_x86_64_unknown_linux_musl = "-idirafter /usr/include/x86_64-linux-gnu -idirafter /usr/include" -CFLAGS_aarch64_unknown_linux_musl = "-idirafter /usr/include/aarch64-linux-gnu -idirafter /usr/include" - -# rustc links with `-nodefaultlibs`; libbpf's C code needs the outline-atomic -# helpers from libgcc on aarch64. -[target.aarch64-unknown-linux-musl] -rustflags = ["-C", "link-arg=-lgcc"] +CFLAGS_aarch64_unknown_linux_musl = "-mno-outline-atomics -idirafter /usr/include/aarch64-linux-gnu -idirafter /usr/include" From c9e6764ebb1dbd2fb2cd2b1bb1ba05902845aac6 Mon Sep 17 00:00:00 2001 From: Adrien Cacciaguerra Date: Mon, 9 Nov 2026 15:18:43 -0800 Subject: [PATCH 3/3] ci: build the macOS release on macos-latest GitHub no longer runs macos-14 jobs ("The configuration 'macos-14-arm64-us-default' is not supported"), and dist 0.31.0 picks it for aarch64-apple-darwin, so the v5.7.0 macOS build was cancelled before it started. Use macos-latest, as CI does. Refs COD-4123 Co-Authored-By: Claude Opus 5.5 --- dist-workspace.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/dist-workspace.toml b/dist-workspace.toml index 7eb01b278..0e6243ad3 100644 --- a/dist-workspace.toml +++ b/dist-workspace.toml @@ -39,4 +39,5 @@ allow-dirty = ["ci"] "actions/download-artifact" = "37930b1c2abaa49bbe596cd826c3c89aef350131" # v7.0.0 [dist.github-custom-runners] +aarch64-apple-darwin = "macos-latest" aarch64-unknown-linux-musl = "ubuntu-26.04-arm"