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" 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/.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 fc1cd22a9..140c5e0de 100644 --- a/dist-workspace.toml +++ b/dist-workspace.toml @@ -6,15 +6,15 @@ 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 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 @@ -27,16 +27,18 @@ 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" aarch64-unknown-linux-musl = "ubuntu-26.04-arm"