build: pin workspace Rust toolchain to 1.95.0 - #701
build: pin workspace Rust toolchain to 1.95.0#701Sander Saares (sandersaares) wants to merge 7 commits into
Conversation
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
There was a problem hiding this comment.
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.tomlto pin the workspace toolchain to Rust1.96.1. - Update
constants.envcommentary to indicateRUST_LATESTmust matchrust-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.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 3c307c0c-048d-4dec-a6e7-bb28716a1f98
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
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
$ToolchainChannelPatternonly matches lines that start withchannelat column 0. A validrust-toolchain.tomlcould 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.tomlwithSet-Contentbut without-Encodingcan 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 Report✅ All modified and coverable lines are covered by tests. 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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
|
||
| [toolchain] | ||
| # Must match RUST_LATEST in constants.env so local and CI diagnostics use the same compiler. | ||
| channel = "1.96.1" |
There was a problem hiding this comment.
This will most likely break the internal release build
There was a problem hiding this comment.
Good point. I will adjust the release pipeline accordingly, as well.
Evgenii (Vaiz)
left a comment
There was a problem hiding this comment.
this will cause issues with publising
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
There was a problem hiding this comment.
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
$Matchesvariable after a-notmatchcheck.$Matchesis 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 likevalue: "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 speaking] Addressed the suppressed review finding in commit |
|
|
||
| .EXAMPLE | ||
| .\update_rust_toolchain.ps1 | ||
| .\update_rust_toolchain.ps1 -InternalToolchainFile ..\ox-sdk\.pipelines\variables\publish.yml |
There was a problem hiding this comment.
ox-sdk might not be the name of the folder under a different worktree
There was a problem hiding this comment.
Well, it's just an example. Or do you see the problem also in some non-example locations?
martin-kolinek
left a comment
There was a problem hiding this comment.
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.
|
|
||
| [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 |
There was a problem hiding this comment.
DANGER: Remove this reference to internal repos!
| # 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 |
There was a problem hiding this comment.
DANGER: remove references to internal repo
[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_LATESTselect the exact Rust 1.95.0 release, matching the upstream version of the internalms-prod-1.95release 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.