Skip to content

Improve error message for removing components of targets other than the host's #1091

Closed as not planned
@andradei

Description

@andradei

If I rustup target add x86_64-unknown-linux-gnu on a x86_64-apple-darwin host, a component is also installed, namely: rust-std-x86_64-unknown-linux-gnu.

The usability issue arrives when you try to rustup component remove rust-std-x86_64-unknown-linux-gnu. Which will throw the following error:

error: toolchain 'stable-x86_64-apple-darwin' does not contain component 'rust-std-x86_64-unknown-linux-gnu' for target 'x86_64-apple-darwin'

Removing that component is probably impossible (from all of the methods I tried) and the only thing that works is removing the target: rustup target remove x86_64-unknown-linux-gnu which also removes its components.

To improve usability, a message could accompany the error above:

"You are on a x86_64-apple-darwin system. Try rustup target add x86_64-unknown-linux-gnu instead."

Or something along those lines.

Thank you for rustup. It is an amazing tool.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions