[CI]: pin Rust toolchain to 1.98.1 via rust-toolchain.toml - #2335
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In raising this pull request, I confirm the following (please check boxes):
Reason for this PR:
Sanity check:
Repro instructions:
CI-only change, so no media sample — the repro is the failure history:
format_rustgoes red on unrelated PRs every rustc release (#1706, #1753, #1758, #2332), most recently hitting #2327 and #2298.Background
format.ymlrunscargo clippy -- -D warningsontoolchain: stable, which floats to whatever rustc is newest on the day CI runs. Every stable release adds lints, so a new rustc turnsformat_rustred on every open PR, regardless of what those PRs changed.It has needed a dedicated fix PR almost every release: #1706 (1.88), #1753 (1.90), #1758 (1.91), and most recently #2332 for
needless_late_initon 1.98.The side effect is the one #2332 describes: authors fix shared-code lints inside unrelated PRs just to go green. #2298 carried a
style(rust): ...satisfy clippy byte_char_slicescommit in an unrelated report fix; #2327 (C-only, no Rust touched) failed clippy purely on master's lint. As #2332 puts it: "a lint fix on shared code should land once, on its own." This PR makes that the default instead of something to be arranged.What this changes
rust-toolchain.tomlat repo root, pinningchannel = "1.98.1"— the current stable, so this is not a rollback: it changes nothing about what CI runs today, it only stops the version from moving on its own. Bumps become deliberate PRs where new lints are fixed once, together, rather than surprising every open PR.components = ["rustfmt", "clippy"]— supplied by the file, so the workflow no longer has to request them.targets = [...MSVC triples]— required:windows/rust.batalways builds withcargo build --target, and.vcxprojusesi686-pc-windows-msvcfor Win32. The toolchain action installs targets onto the toolchain it installed, not onto the pinned one, so the target std has to come from the file.actions-rs/toolchain@v1→dtolnay/rust-toolchain@stable(4 workflows). This is required, not cosmetic: those steps setoverride: true, i.e.rustup override set stable. A directory override outranksrust-toolchain.tomlin rustup's precedence, so with it in place the pin would be silently ignored and clippy would keep running on floating stable.dtolnay/rust-toolchainonly sets the default toolchain, which the file correctly outranks. (actions-rs/*has also been archived and unmaintained since 2022; the other five workflows already usedtolnay.)Dependabot —
package-ecosystem: rust-toolchain, so a new rustc arrives as a reviewable PR instead of arriving unannounced in everyone's CI.Path filters —
rust-toolchain.tomladded toformat.ymlandtest_rust.yml. Without this a Dependabot bump (which touches only that file) would match no path filter, so clippy and the tests would not run and the bump would merge unvalidated — reintroducing the same problem through the back door.Testing
format_ruston master is already green on it — the upstream runs after that release succeeded. So CI behaviour on x86_64 is unchanged by this PR; only the drift stops.stableinstalled and set as default — the state CI is in after the toolchain action runs — rustup reports1.98.1-... (overridden by '.../rust-toolchain.toml'), and installs rustfmt + clippy and both MSVC targets from the file.cargo check --target i686-pc-windows-msvcresolves.rustup override set stableflips the active toolchain tostable ... (directory override)— i.e. the oldoverride: truedid defeat the file. Removing it is what makes the pin effective.cargo clippy -- -D warningsandcargo fmt --all -- --checkclean on both workdirs (src/rust,src/rust/lib_ccxr), macOS aarch64.