Skip to content

rust-toolchain.toml omits rustfmt, so a fresh checkout cannot run the fmt gate and CI works around it twice #726

Closed

Description

@vyncint

rust-toolchain.toml pins the components a contributor needs:

components = ["rust-src", "rustc-dev", "rust-analyzer", "clippy", "llvm-tools"]

clippy is there. rustfmt is not — even though cargo fmt --check is a
required CI gate exactly like clippy. On a machine that has never installed
rustfmt for this nightly, cargo fmt fails, and nothing in the toolchain file
says why.

CI compensates for the gap rather than closing it, in two separate workflows:

  • .github/workflows/fmt.yml:24 — with a comment naming the cause directly:

    "rust-toolchain.toml pins nightly-2026-04-03 but does not list rustfmt as a
    component. Add it explicitly so cargo fmt resolves against the same
    nightly the rest of CI uses."

  • .github/workflows/unit-tests.yml:183 — the generated-intrinsics job needs
    it too, because cuda-intrinsics-gen shells out to rustfmt when it writes
    generated sources.

So the workaround has already had to be copied once. A third job needing rustfmt
would need it again.

This also bites outside CI: provisioning a fresh build machine from the repo
gives you a toolchain that cannot run just fmt-check, which is a confusing
first experience given the file exists precisely to make the toolchain
reproducible.

Suggested fix

Add rustfmt to the component list and drop the two workaround steps, making
the toolchain file the single source of truth for both required formatting and
linting components.

Activity

  1. added
    bug
    build-related
    on Aug 10, 2026
  2. added a commit that references this issue on Aug 10, 2026
    0aec129
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugbuild-related

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions