Skip to content

Prefer stable Rust toolchains#1974

Merged
j178 merged 1 commit intomasterfrom
rust-stable
Apr 21, 2026
Merged

Prefer stable Rust toolchains#1974
j178 merged 1 commit intomasterfrom
rust-stable

Conversation

@j178
Copy link
Copy Markdown
Owner

@j178 j178 commented Apr 21, 2026

Prefer stable Rust toolchains over newer nightly toolchains when resolving system Rust for default requests. Nightly is still used when it is the only matching candidate.

Closes #1970

@j178 j178 added the bug Something isn't working label Apr 21, 2026
@j178 j178 marked this pull request as ready for review April 21, 2026 10:36
Copilot AI review requested due to automatic review settings April 21, 2026 10:36
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 21, 2026

Codecov Report

❌ Patch coverage is 98.41270% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 92.23%. Comparing base (fba1c85) to head (2c2c600).
⚠️ Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
crates/prek/src/languages/rust/installer.rs 98.27% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1974      +/-   ##
==========================================
+ Coverage   92.18%   92.23%   +0.04%     
==========================================
  Files         116      116              
  Lines       23287    23338      +51     
==========================================
+ Hits        21468    21525      +57     
+ Misses       1819     1813       -6     

☔ View full report in Codecov by Sentry.
📢 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.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates Rust toolchain resolution to prefer stable toolchains over newer beta/nightly ones when selecting from installed/system candidates, addressing the “system Rust uses nightly by default” behavior.

Changes:

  • Add RustVersion::channel() accessor to expose the detected toolchain channel (stable/beta/nightly).
  • Prefer stable/unnamed toolchains over beta and nightly when sorting installed/system toolchain candidates.
  • Record the resolved toolchain channel in InstallInfo for RustRequest::Any, and add unit tests covering the new selection order.

Reviewed changes

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

File Description
crates/prek/src/languages/rust/version.rs Exposes the parsed toolchain channel via a new accessor on RustVersion.
crates/prek/src/languages/rust/rust.rs Stores the resolved toolchain channel for RustRequest::Any based on the selected toolchain.
crates/prek/src/languages/rust/installer.rs Introduces deterministic toolchain sorting that prefers stable over beta/nightly; adds unit tests for the new behavior.

@j178 j178 merged commit ba745f6 into master Apr 21, 2026
59 of 60 checks passed
@j178 j178 deleted the rust-stable branch April 21, 2026 10:46
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.

System Rust uses nightly by default instead of stable.

2 participants