Skip to content

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

Description

@jyn514

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
- [ ] https://github.com/rust-lang/rustup/pull/3637
- [ ] https://github.com/rust-lang/rustup/pull/3924

Activity

  1. 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[/+] on Jan 13, 2024
  2. self-assigned this
    on Jan 13, 2024
  3. 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[/+] on Jan 13, 2024
  4. 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[/+] on Jan 13, 2024
  5. rami3l commented on Jan 13, 2024

    @rami3l
    Member

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

  6. added this to the 1.28.0 milestone on May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions