rust-lang / rust-lang/rustup

Use a different exit code when component is missing

Open
#2,708 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

E-mentor enhancement help wanted
Dominant language
Rust
Stars
7k
Forks
1.1k
Avg merge
22h 40m
Merged PRs (30d)
46

Description

Describe the problem you are trying to solve

The rustup wrappers will exit with status code 1 if the component they wrap is not installed or unavailable.

This is bad, because it makes it impossible to distinguish that case from an error reported by the tool itself. Therefore tools that invoke the rustup wrappers (like rust-analyzer) are forced to match against the strings output on stderr if they need to detect this case, which is very brittle.

Describe the solution you'd like

Use a different exit status code for the rustup wrappers, for example 127 (only signed 1-Byte status codes are portable to my knowledge).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the rustup wrapper entry points and tracing how they report a missing or unavailable component. Compare that path with errors reported by the wrapped tool, then verify the selected distinct exit status across the affected wrappers and their tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.