Skip to content

build: pin workspace Rust toolchain to 1.95.0 - #701

Open
Sander Saares (sandersaares) wants to merge 7 commits into
mainfrom
u/sasaares/rust-toolchain
Open

build: pin workspace Rust toolchain to 1.95.0#701
Sander Saares (sandersaares) wants to merge 7 commits into
mainfrom
u/sasaares/rust-toolchain

Conversation

@sandersaares

@sandersaares Sander Saares (sandersaares) commented Aug 27, 2026

Copy link
Copy Markdown
Member

[Copilot speaking]

Motivation

Workspace commands otherwise use each environment's active default Rust toolchain. Compiler and lint updates can therefore introduce findings unrelated to a pull request, as seen in #700, rather than providing reproducible results.

Changes

The workspace and RUST_LATEST select the exact Rust 1.95.0 release, matching the upstream version of the internal ms-prod-1.95 release toolchain. Cross-linked comments define the three-way alignment contract.

The toolchain refresh script treats the internal release channel as the source of truth: maintainers select that channel first, then the script updates both public pins to the latest upstream patch in the selected minor.

The internal release-template protection is delivered by ox-sdk PR 5587019, which must merge before this pull request.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 3c307c0c-048d-4dec-a6e7-bb28716a1f98
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 3c307c0c-048d-4dec-a6e7-bb28716a1f98
Copilot AI lite review requested due to automatic review settings August 27, 2026 06:46

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Pins the workspace’s default Rust toolchain so local developer commands use a consistent compiler version, reducing “incidental” diagnostics caused by developer-machine toolchain drift and keeping results aligned with CI’s static-analysis toolchain selection.

Changes:

  • Add rust-toolchain.toml to pin the workspace toolchain to Rust 1.96.1.
  • Update constants.env commentary to indicate RUST_LATEST must match rust-toolchain.toml.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
rust-toolchain.toml Introduces a pinned workspace Rust toolchain channel (1.96.1).
constants.env Updates toolchain documentation to keep RUST_LATEST synchronized with the pinned workspace toolchain.

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread constants.env Outdated
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 3c307c0c-048d-4dec-a6e7-bb28716a1f98
Copilot AI review requested due to automatic review settings August 27, 2026 07:02

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

Comment thread scripts/update_rust_toolchain.ps1
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings August 27, 2026 07:07

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.

Suppressed comments (2)

Previously missed (2) — in code that hasn't changed since the last review.

scripts/update_rust_toolchain.ps1:38

  • $ToolchainChannelPattern only matches lines that start with channel at column 0. A valid rust-toolchain.toml could still indent the key (e.g. channel = "..."), in which case the script will fail to detect/update it and exit with an error. Consider allowing leading whitespace so the updater is resilient to harmless formatting changes.
$ToolchainChannelPattern = '(?m)^(channel[ \t]*=[ \t]*)"([^"]*)"'

scripts/update_rust_toolchain.ps1:265

  • Writing rust-toolchain.toml with Set-Content but without -Encoding can produce a non-UTF8 file on Windows PowerShell (e.g. UTF-16LE), which may break rustup parsing of the toolchain file. Since this is a TOML config consumed by external tooling, it’s safer to write it explicitly as UTF-8 (as other scripts do for *.toml).
if ($toolchainNeedsUpdate) {
    $newToolchainContent = Update-RustToolchain -FilePath $ToolchainFile -Version $newStableVersion
    Set-Content -Path $ToolchainFile -Value $newToolchainContent -NoNewline
}

@codecov

codecov Bot commented Aug 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.0%. Comparing base (9827a27) to head (3c3183c).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #701   +/-   ##
=======================================
  Coverage   100.0%   100.0%           
=======================================
  Files         559      560    +1     
  Lines       60826    60861   +35     
=======================================
+ Hits        60826    60861   +35     
Flag Coverage Δ
linux ?
linux-arm ?
scheduled ?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread rust-toolchain.toml Outdated

[toolchain]
# Must match RUST_LATEST in constants.env so local and CI diagnostics use the same compiler.
channel = "1.96.1"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will most likely break the internal release build

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. I will adjust the release pipeline accordingly, as well.

@Vaiz Evgenii (Vaiz) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this will cause issues with publising

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 3c307c0c-048d-4dec-a6e7-bb28716a1f98
Copilot AI review requested due to automatic review settings August 27, 2026 10:03
@sandersaares Sander Saares (sandersaares) changed the title build: pin workspace Rust toolchain to 1.96.1 build: pin workspace Rust toolchain to 1.95.0 Aug 27, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

Comment thread scripts/update_rust_toolchain.ps1
Comment thread README.md
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 3c307c0c-048d-4dec-a6e7-bb28716a1f98
Copilot AI review requested due to automatic review settings August 27, 2026 10:15

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.

Suppressed comments (1)

Previously missed (1) — in code that hasn't changed since the last review.

scripts/update_rust_toolchain.ps1:207

  • Get-InternalToolchainMinorVersion relies on the automatic $Matches variable after a -notmatch check. $Matches is global state and can be stale/overwritten by other regex operations, making the extracted minor version brittle. It’s safer to explicitly capture the match result (and this also makes it easy to tolerate quoted YAML values like value: "ms-prod-1.95").
        $versions += $Matches[1]

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 3c307c0c-048d-4dec-a6e7-bb28716a1f98
Copilot AI review requested due to automatic review settings August 27, 2026 10:22
@sandersaares

Copy link
Copy Markdown
Member Author

[Copilot speaking]

Addressed the suppressed review finding in commit 3c3183c. Get-InternalToolchainMinorVersion now stores an explicit Regex.Match result and reads its named minor group instead of relying on automatic $Matches state. The parser also accepts consistently quoted YAML channel values.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.


.EXAMPLE
.\update_rust_toolchain.ps1
.\update_rust_toolchain.ps1 -InternalToolchainFile ..\ox-sdk\.pipelines\variables\publish.yml

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ox-sdk might not be the name of the folder under a different worktree

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, it's just an example. Or do you see the problem also in some non-example locations?

@martin-kolinek martin-kolinek left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rejecting this until it's clarified that this is the right approach. Most Rust libraries don't use rust-toolchain.toml file, we should be sure that it's desirable before we add it. We also should make sure that our internal build pipelines can handle it first.

Comment thread rust-toolchain.toml

[toolchain]
# Must match RUST_LATEST in constants.env. Its major/minor must match MSRUSTUP_TOOLCHAIN in:
# https://o365exchange.visualstudio.com/O365%20Core/_git/ox-sdk?path=/.pipelines/variables/publish.yml

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DANGER: Remove this reference to internal repos!

Comment thread constants.env
# used for static analysis & mutation testing
RUST_LATEST=1.96.1
# used for static analysis & mutation testing; must match rust-toolchain.toml; its major/minor must match:
# https://o365exchange.visualstudio.com/O365%20Core/_git/ox-sdk?path=/.pipelines/variables/publish.yml

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DANGER: remove references to internal repo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants