Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
andradei opened this issue May 3, 2017 · 3 comments

Comments

@andradei
Copy link

andradei commented May 3, 2017

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.

@setharnold
Copy link

Perhaps if components cannot be removed separately then the rustup component remove subcommand should be removed?

Thanks

@andradei
Copy link
Author

andradei commented May 3, 2017

There are components that can be added and removed like target's docs (which are installed by default now), and rust-src.

So maybe the components that can't be removed should be signified as such instead of removing rustup component remove.

In other words, if there are components that can be installed via rustup component add, then its remove counterpart shouldn't be removed.

@rami3l
Copy link
Member

rami3l commented Jun 9, 2024

I believe this is a duplicate of #3320, which is itself a duplicate of #3166, fixed in #3601:

> rustup --version
rustup 1.27.1+198 (81a71647f 2024-06-09)
info: This is the version for the rustup toolchain manager, not the rustc compiler.
info: The currently active `rustc` version is `rustc 1.78.0 (9b00956e5 2024-04-29)`
> rustup component add rust-std-aarch64-apple-darwin
info: component 'rust-std' for target 'aarch64-apple-darwin' is up to date
> rustup component add rust-std-x86_64-apple-darwin
info: downloading component 'rust-std' for 'x86_64-apple-darwin'
info: installing component 'rust-std' for 'x86_64-apple-darwin'
 23.4 MiB /  23.4 MiB (100 %)  20.7 MiB/s in  1s
> rustup component remove rust-std-x86_64-apple-darwin
info: removing component 'rust-std' for 'x86_64-apple-darwin'

@rami3l rami3l closed this as not planned Won't fix, can't repro, duplicate, stale Jun 9, 2024
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

No branches or pull requests

3 participants