From bb33b2ccdde50516496f368cb9244a58ab0d26d8 Mon Sep 17 00:00:00 2001 From: Adrien Cacciaguerra Date: Mon, 9 Nov 2026 14:20:18 -0800 Subject: [PATCH 1/4] 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 57bcfe19ebc756bcad192539e4523c438b0652b1 Mon Sep 17 00:00:00 2001 From: Adrien Cacciaguerra Date: Mon, 9 Nov 2026 09:55:32 -0800 Subject: [PATCH 2/4] 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 33fcc1e716d9cba456fa7541e8c7ae5be1eeba9e Mon Sep 17 00:00:00 2001 From: Adrien Cacciaguerra Date: Mon, 9 Nov 2026 15:18:43 -0800 Subject: [PATCH 3/4] 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" From 3a2bbac7ae821391c3c7782d7e9d35b1a3973ad7 Mon Sep 17 00:00:00 2001 From: Guillaume Lagrange Date: Thu, 12 Nov 2026 13:40:56 +0100 Subject: [PATCH 4/4] ci: bump cargo-dist to 0.34.0 Sync the action pins with the ones dependabot set in release.yml, otherwise regenerating downgrades them, and list the hand edits to redo after a regen. Refs COD-4123 --- .github/workflows/release.yml | 6 +++--- dist-workspace.toml | 17 +++++++++-------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4be503450..b10d794c5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -64,7 +64,7 @@ jobs: # we specify bash to get pipefail; it guards against the `curl` command # failing. otherwise `sh` won't catch that `curl` returned non-0 shell: bash - run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.31.0/cargo-dist-installer.sh | sh" + run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.34.0/cargo-dist-installer.sh | sh" - name: Cache dist uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a with: @@ -169,7 +169,7 @@ jobs: needs: - plan if: ${{ needs.plan.outputs.publishing == 'true' || fromJson(needs.plan.outputs.val).ci.github.pr_run_mode == 'upload' }} - uses: ./.github/workflows/create-draft-release.yml + uses: $/.github/workflows/create-draft-release.yml with: plan: ${{ needs.plan.outputs.val }} secrets: inherit @@ -320,7 +320,7 @@ jobs: needs: - plan - announce - uses: ./.github/workflows/post-announce.yml + uses: $/.github/workflows/post-announce.yml with: plan: ${{ needs.plan.outputs.val }} secrets: inherit diff --git a/dist-workspace.toml b/dist-workspace.toml index 0e6243ad3..140c5e0de 100644 --- a/dist-workspace.toml +++ b/dist-workspace.toml @@ -6,7 +6,7 @@ members = ["cargo:."] # Whether to consider the binaries in a package for distribution (defaults true) dist = true # The preferred dist version to use in CI (Cargo.toml SemVer syntax) -cargo-dist-version = "0.31.0" +cargo-dist-version = "0.34.0" # CI backends to support ci = "github" # The installers to generate for each app @@ -27,16 +27,17 @@ precise-builds = true create-release = false # Use the stage just after plan because we need its output to create the draft release local-artifacts-jobs = ["./create-draft-release"] -# Uncomment this to rerun `dist generate` -# ⚠️ This will overwrite any manual changes to generated files, make sure to re-apply them if they're still relevant -# We need this to prevent gh release edit from marking any release as latest, but cargo-dist does not support that customizing this yet -# https://github.com/axodotdev/cargo-dist/issues/2244 +# Comment this out to rerun `dist generate`, then redo these hand edits to release.yml: +# - the `gh release edit` call in `host` is replaced so the release is not marked as latest +# (https://github.com/axodotdev/cargo-dist/issues/2244) +# - the `swatinem/rust-cache` step in `build-local-artifacts` is removed allow-dirty = ["ci"] +# Dependabot bumps the pins in release.yml: copy them here before regenerating [dist.github-action-commits] -"actions/checkout" = "de0fac2e4500dabe0009e67214ff5f5447ce83dd" # v6.0.2 -"actions/upload-artifact" = "b7c566a772e6b6bfb58ed0dc250532a479d7789f" # v6.0.0 -"actions/download-artifact" = "37930b1c2abaa49bbe596cd826c3c89aef350131" # v7.0.0 +"actions/checkout" = "3d3c42e5aac5ba805825da76410c181273ba90b1" # v7.0.1 +"actions/upload-artifact" = "043fb46d1a93c77aae656e7c1c64a875d1fc6a0a" # v7.0.1 +"actions/download-artifact" = "3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c" # v8.0.1 [dist.github-custom-runners] aarch64-apple-darwin = "macos-latest"