Skip to content

ci-build.yml: Cargo cache key references a step id that does not exist, so it never invalidates on a toolchain bump #243

Description

@alxmrs

Also found while modelling ddx's wheel CI on this workflow.

ci-build.yml L46 keys the Cargo cache on the toolchain:

      - uses: dtolnay/rust-toolchain@stable

      - name: Cache Cargo
        uses: actions/cache@v4
        with:
          key: cargo-cache-${{ steps.rust-toolchain.outputs.cachekey }}-${{ matrix.platform.runner }}-...

but no step carries id: rust-toolchain, so steps.rust-toolchain.outputs.cachekey resolves to the empty string and the key collapses to cargo-cache--<runner>-<target>-<Cargo.lock hash>.

The cache still works, so nothing fails — but it no longer invalidates when the toolchain moves. @stable rolls forward roughly every six weeks, and on that day the job restores artifacts built by the previous compiler under a key that claims to describe the new one. Usually harmless, occasionally a confusing rebuild or a stale-artifact error that does not reproduce locally.

One-line fix:

      - uses: dtolnay/rust-toolchain@stable
        id: rust-toolchain

Worth noting the same key is used across five matrix entries that differ in platform.target but share a runner for the two Ubuntu rows (aarch64 and x86_64 both on ubuntu-latest) — those are distinguished by target, so that part is fine.

Happy to send a PR alongside #242 if useful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions