Skip to content

Give a better error message when a component is missing with a linked toolchain #2470

@jyn514

Description

@jyn514

Describe the problem you are trying to solve
If I try to use a component from a tool that is currently building with x.py, rustup currently gives the following error:

$ rustdoc +stage1
error: 'rustdoc' is not installed for the toolchain 'stage1'
To install, run `rustup component add rustc --toolchain stage1`

The second line is not helpful: when you run it it will always give an error.

$ rustup component add rustc --toolchain stage1
error: stage1 is a custom toolchain

Describe the solution you'd like

Instead it should suggest building the tool with x.py:

To install, run `x.py build src/tools/rustdoc`.

Notes

Ideally, rustup would know about compile stages and suggest --stage 0 or --stage 2 as necessary. However, if the user is using a local toolchain they should know about stages already, so it's ok to let them figure out for themselves which stage they want.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions