Skip to content

ci: pin the toolchain so a rust release cannot redden a green main - #467

Merged
LeadcodeDev merged 2 commits into
mainfrom
fix/ci-pin-toolchain
Oct 1, 2026
Merged

LeadcodeDev merged 2 commits into
mainfrom
fix/ci-pin-toolchain

Conversation

@LeadcodeDev

@LeadcodeDev LeadcodeDev commented Oct 1, 2026 •

Copy link
Copy Markdown
Owner

main is red, and no commit broke it. CI installed the floating stable channel, so each run tested whatever Rust had shipped by then. rustc moved 1.98.1 → 1.99.0 on 28 September, clippy sharpened redundant_field_names, and the schema work that had been green on its own branch failed the moment it merged. Two changes here: the lint, and the reason a Rust release could reach a green main at all.

The lint fires on the two #[from] variants of RustmotionError whose field is named source. thiserror's derive generates Self::JsonParse { source: source } for the From impl, and 1.99 attributes that to our field's span. The allow is on the module rather than on the variants: the generated impl From is a sibling item of the enum, not part of it, so a variant-level attribute leaves the error exactly where it was — measured, not assumed. Renaming the field was the other option and is worse, since source is what thiserror reads to implement Error::source and what the #[error("…{source}")] strings interpolate. The three tuple variants (Io(#[from] …)) expand to positional construction and never fired; FileRead has no #[from] and so has no generated impl.

rust-toolchain.toml is now the only place the version is written. rustup toolchain install with no argument reads it, components included, so no second copy can drift and CI cannot check a version the working tree does not. That replaces dtolnay/rust-toolchain in the four CI jobs and in publish: its toolchain input is required, defaults to stable, and does not read the manifest, so keeping it meant writing 1.99.0 five more times. Runners ship rustup, and the action leaving removes a third-party dependency from every job. Letting rustup auto-install from the manifest implicitly also works today and was rejected: rustup prints a deprecation for it and says it may stop working, which is the same delayed breakage this is meant to remove.

The audit job is deliberately left alone. It fails on a new advisory by design, and its ten --ignore entries carry a review date. Making it unconditionally green would mean not auditing.

Verification — cargo fmt --all --check, cargo clippy --workspace --all-targets --features rustmotion/studio -- -D warnings, and cargo test --workspace --features rustmotion/studio on 1.99.0: 2146 passed, 0 failed, 10 ignored across 52 suites. The clippy failure was reproduced locally on 1.99.0 before the fix, at the same two paths CI reported, and the variant-level allow was confirmed insufficient. Not verified: that the runner image's rustup honours the manifest, which only a CI run on this branch can show.

No issue exists for this; it came from the red run on main.

…ted From impl

`redundant_field_names` now fires on the two `#[from]` variants whose field is
named `source`: the derive generates `Self::JsonParse { source: source }`, and
1.99 attributes that to our field span. rustc 1.98.1 did not report it.

The allow sits on the module, not on the variants, because the generated
`impl From` is a sibling item of the enum rather than part of it: an attribute
on the variant leaves the lint exactly where it was, which is what the first
attempt measured. Renaming the field is not an option either way, since
`source` is what thiserror reads to implement `Error::source` and what the
`#[error("...{source}")]` strings interpolate.
CI installed the floating `stable` channel, so the version it tested was
whatever had shipped by the time the job ran. On 2026-10-01 that turned main red
with no commit in between: rustc moved 1.98.1 -> 1.99.0, clippy gained a lint on
code the repository had not touched, and the schema PR that was green on its own
branch failed once merged.

`rust-toolchain.toml` is now the single place the version is written.
`rustup toolchain install` with no argument reads that file, including its
`components`, so there is no second copy in the workflow to drift out of step
and no way for CI to check a version the working tree does not. It replaces
`dtolnay/rust-toolchain` in all four CI jobs and in publish: that action's
`toolchain` input is required and defaults to `stable`, and it does not read
the manifest, so keeping it would have meant writing the version five more
times. Runners ship rustup, and dropping the action removes a third-party
dependency from every job.

Relying on rustup's implicit auto-install was the alternative and is rejected:
it works today, but rustup prints a deprecation for it and says it may stop
working, which is the same class of delayed breakage this commit exists to
remove.

The `audit` job stays as it is. It is designed to fail on a new advisory, and
the ten `--ignore` entries are reviewed on a date written next to them. Making
that job unconditionally green would mean not auditing.
@LeadcodeDev LeadcodeDev added the bug Something isn't working label Oct 1, 2026
@LeadcodeDev LeadcodeDev self-assigned this Oct 1, 2026
@LeadcodeDev
LeadcodeDev merged commit 3e236d8 into main Oct 1, 2026
4 checks passed
@LeadcodeDev
LeadcodeDev deleted the fix/ci-pin-toolchain branch October 1, 2026 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant