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

Give a warning before uninstalling the active/default toolchain, or the last/host target for a toolchain #3319

Closed
2 tasks done
Tracked by #3635
jyn514 opened this issue Apr 12, 2023 · 1 comment · Fixed by #3924
Closed
2 tasks done
Tracked by #3635
Assignees
Milestone

Comments

@jyn514
Copy link
Member

jyn514 commented Apr 12, 2023

Problem you are trying to solve

Rustup currently lets you do some silly things:

; rustup target list --installed
x86_64-unknown-linux-gnu
; rustup target remove x86_64-unknown-linux-gnu
info: removing component 'rust-std'
; cargo build
   Compiling inner v0.1.0 (/home/jyn/src/example/inner)
error[E0463]: can't find crate for `std`

This isn't a bug, but it seems ... confusing.

Solution you'd like

I think rustup should warn in either of the following cases:

  1. If you're trying to remove the host target, which means you can no longer build proc-macros or build scripts
  2. If you're trying to remove the last remaining target installed
  3. If you're uninstalling the active/default toolchain

Notes

No response

Tasks

Preview Give feedback
@rami3l rami3l changed the title Give a warning before uninstalling the last/host target for a toolchain Give a warning before uninstalling the default toolchain, or the last/host target for a toolchain Jan 13, 2024
@rami3l rami3l self-assigned this Jan 13, 2024
@rami3l rami3l changed the title Give a warning before uninstalling the default toolchain, or the last/host target for a toolchain Give a warning before uninstalling the active toolchain, or the last/host target for a toolchain Jan 13, 2024
@rami3l rami3l changed the title Give a warning before uninstalling the active toolchain, or the last/host target for a toolchain Give a warning before uninstalling the active/default toolchain, or the last/host target for a toolchain Jan 13, 2024
@rami3l
Copy link
Member

rami3l commented Jan 13, 2024

I think I can try to tackle this after #3225, where the logic of detecting the active/default toolchain is refined.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants