Skip to content

feat(toolchain): improve error reporting in rustc_version(), pt. 1 - #5225

Merged
rami3l merged 7 commits into
rust-lang:mainfrom
rami3l:feat/rustc-version-error-2
Nov 19, 2026
Merged

rami3l merged 7 commits into
rust-lang:mainfrom
rami3l:feat/rustc-version-error-2

Conversation

@rami3l

@rami3l rami3l commented Nov 17, 2026 •

Copy link
Copy Markdown
Member

Related to #3607, replaces #4741.

@rami3l
rami3l force-pushed the feat/rustc-version-error-2 branch 3 times, most recently from 2f0c5e4 to a94b6b4 Compare November 17, 2026 16:49
@rami3l
rami3l marked this pull request as ready for review November 17, 2026 17:46
@rami3l
rami3l requested review from ChrisDenton and djc November 17, 2026 17:46
Comment thread src/toolchain.rs Resolved
Comment thread src/toolchain.rs Resolved
@rami3l
rami3l force-pushed the feat/rustc-version-error-2 branch from a94b6b4 to 345b114 Compare November 18, 2026 14:34
@rustbot

This comment has been minimized.

@rami3l
rami3l force-pushed the feat/rustc-version-error-2 branch 4 times, most recently from adecfd7 to 2f0643e Compare November 18, 2026 14:57
…ion()`

Co-authored-by: bogay <pojay11523@gmail.com>
@rami3l
rami3l force-pushed the feat/rustc-version-error-2 branch from 2f0643e to 2a6a997 Compare November 18, 2026 15:34
@rustbot

rustbot commented Nov 18, 2026

Copy link
Copy Markdown
Collaborator

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

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.

🟡 Changes recommended

A custom rustc wrapper’s background helper can keep stderr open after the wrapper fails, causing stderr collection to block indefinitely and bypass the ten-second timeout.

1 open issue
What changed in this PR

This PR improves rustc_version() diagnostics so rustup reports why compiler version detection failed, addressing #3607 and replacing #4741.

Changes:

  • Reports command-creation errors, launch failures, and compiler stderr or exit status.
  • Uses Cow<'static, str> for version strings throughout update reporting.
  • Adds CLI tests for missing compilers, recursion limits, nonzero exits, and permission errors.
File Description
tests/​suite/​cli_rustup.rs Adds verbose toolchain error-reporting tests.
src/​toolchain.rs Expands version diagnostics and extracts first-line reading.
src/​install.rs Adapts stored previous versions to Cow.
src/​dist/​mod.rs Updates previous date/version storage for the new return type.
src/​cli/​self_update.rs Wraps the previous rustup version in Cow::Owned.
src/​cli/​common.rs Adapts channel update output to Cow version strings.

Review effort: Balanced

View changes since this review

Comment thread src/toolchain.rs Resolved
@rami3l
rami3l force-pushed the feat/rustc-version-error-2 branch 2 times, most recently from 023c1a5 to 59c58d5 Compare November 18, 2026 16:59
@rami3l rami3l changed the title feat(toolchain): improve error reporting in rustc_version() feat(toolchain): improve error reporting in rustc_version(), pt. 1 Nov 18, 2026
@rami3l
rami3l requested a review from djc November 18, 2026 17:10
@rami3l
rami3l force-pushed the feat/rustc-version-error-2 branch 2 times, most recently from 9800d85 to eebcd1a Compare November 18, 2026 21:05
Comment thread src/toolchain.rs Resolved
@rami3l
rami3l force-pushed the feat/rustc-version-error-2 branch from eebcd1a to 9638337 Compare November 19, 2026 09:28
rami3l and others added 4 commits November 19, 2026 10:31
@rami3l
rami3l force-pushed the feat/rustc-version-error-2 branch from 9638337 to 041d15e Compare November 19, 2026 09:31
@rami3l
rami3l enabled auto-merge November 19, 2026 09:32
@rami3l
rami3l added this pull request to the merge queue Nov 19, 2026
Merged via the queue into rust-lang:main with commit 630acd3 Nov 19, 2026
29 checks passed
@rami3l
rami3l deleted the feat/rustc-version-error-2 branch November 19, 2026 10:17
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.

4 participants