From 62c0b0ba1cc428c5725c5483f4ff66cde2003f55 Mon Sep 17 00:00:00 2001 From: Gudge Date: Fri, 22 May 2026 16:00:08 -0700 Subject: [PATCH] Pin Rust toolchain to match CI (1.93) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add `src/rust-toolchain.toml` pinning the local Rust toolchain to the same channel CI uses (`ms-prod-1.93` in `.azure-pipelines/templates/*.Build.Job.yml`, equivalent to public `1.93`). Without this pin, developers on a newer rustup toolchain pass local `cargo clippy --all-targets --all-features --release -- -D warnings` and still hit CI failures on lints that were introduced, downgraded, or differently-defaulted between releases — for example `clippy::duplicated_attributes` (added in 1.93, weakened in 1.94) recently bit phase 3.5 (#389) on CI despite running clean locally on 1.94. The pin is honored automatically by rustup: any `cargo` command from `src/` (or below) downloads the channel on first use and selects it thereafter. Opt-out with `cargo + ...` or `RUSTUP_TOOLCHAIN=` for one-off testing. Also document the pin and the bump procedure in `.github/copilot-instructions.md` § Prerequisites. Testing ------- - `cargo --version` from `src/` reports 1.93.1 after rustup auto- syncs the channel on first invocation. - `cargo clippy --target x86_64-pc-windows-msvc --workspace --all-targets --all-features --profile release --locked -- -D warnings` clean under 1.93 (this is the exact CI invocation from `.azure-pipelines/templates/Rust.Build.Job.yml`). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/copilot-instructions.md | 2 ++ src/rust-toolchain.toml | 29 +++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 src/rust-toolchain.toml diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index dc60a9b77..8c15820a6 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -2,6 +2,8 @@ ## Prerequisites +The Rust toolchain version is pinned in [`src/rust-toolchain.toml`](../src/rust-toolchain.toml) to match what CI uses (currently 1.93). The pin is honored automatically by `rustup` — running any `cargo` command from `src/` (or below) downloads and selects that channel on first use. To opt out for one-off testing on a different toolchain, use `cargo + ...` or set `RUSTUP_TOOLCHAIN`. When bumping the pinned version, bump the matching `version: 'ms-prod-1.'` lines in the two `.azure-pipelines/templates/*.Build.Job.yml` files in the same commit. + LSP servers are configured in `.github/lsp.json` for Rust and TypeScript. Install them before use: ``` diff --git a/src/rust-toolchain.toml b/src/rust-toolchain.toml new file mode 100644 index 000000000..e9acd80fb --- /dev/null +++ b/src/rust-toolchain.toml @@ -0,0 +1,29 @@ +# Pin the Rust toolchain used for local development to match CI. +# +# CI uses `ms-prod-1.93` (Microsoft's internal Rust 1.93 distribution +# from the Mxc-Azure-Feed) — see +# `.azure-pipelines/templates/Rust.Build.Job.yml` and +# `.azure-pipelines/templates/Mac.Build.Job.yml`. Public rustup users +# get the equivalent open-source channel `1.93` here. +# +# Why pin: clippy lints can appear, be downgraded, be reworded, or +# change defaults between Rust releases. Without this pin, a developer +# on a newer rustup toolchain can pass local +# `cargo clippy --all-targets --all-features --release -- -D warnings` +# and still hit failures in CI on lints introduced in (or differently +# defaulted by) the older toolchain. Pinning eliminates that skew +# entirely. +# +# Bumping: bump the `version: 'ms-prod-1.'` lines in the two +# `.azure-pipelines/templates/*.Build.Job.yml` files and `channel` +# here in the same commit. Then run the standard pre-push ladder +# (see `.github/copilot-instructions.md` § Verification) against the +# new toolchain. +# +# Opt-out: `cargo + ...` or `RUSTUP_TOOLCHAIN= ...` +# for one-off testing on a different toolchain. + +[toolchain] +channel = "1.93" +components = ["clippy", "rustfmt"] +profile = "minimal"