rustup icon indicating copy to clipboard operation
rustup copied to clipboard

Rustup should not perform implicit installations

Open jyn514 opened this issue 1 year ago • 5 comments

Problem you are trying to solve

here is a transcript of a session with rustup

PS C:\Users\jyn\src\example> rustup toolchain list                              
nightly-x86_64-pc-windows-msvc (default)
1.74-x86_64-pc-windows-msvc
stage1
PS C:\Users\jyn\src\example> rustup uninstall nightly
info: uninstalling toolchain 'nightly-x86_64-pc-windows-msvc'
info: toolchain 'nightly-x86_64-pc-windows-msvc' uninstalled
PS C:\Users\jyn\src\example> rustup toolchain list   
1.74-x86_64-pc-windows-msvc
stage1
PS C:\Users\jyn\src\example> rustc
info: syncing channel updates for 'nightly-x86_64-pc-windows-msvc'
info: latest update on 2024-01-07, rust version 1.77.0-nightly (b6a8c762e 2024-01-06)
info: downloading component 'cargo'
^C
PS C:\Users\jyn\src\example> rustc +nightly
error: toolchain 'nightly-x86_64-pc-windows-msvc' is not installed
PS C:\Users\jyn\src\example> rustup --version
rustup 1.26.0 (5af9b9484 2023-04-05)
info: This is the version for the rustup toolchain manager, not the rustc compiler.
info: syncing channel updates for 'nightly-x86_64-pc-windows-msvc'

Proposed Solution & Progress

  • [x] uninstalling the default toolchain happens silently. i would expect either a warning (by the same logic as https://github.com/rust-lang/rustup/issues/3319), or for rustup to switch to a different default toolchain.
  • [ ] running rustc afterwards implicitly reinstalls the toolchain. i do not expect rustup to implicitly install in any case other than when rust-toolchain.toml is in the current directory. in fact, you can see that rustc +nightly does not implicitly install, only rustc by itself.
  • [ ] running rustup --version also silently installs.
  • [x] running rustup show also silently installs.

Notes

rustup 1.26.0 (5af9b9484 2023-04-05)

### Tasks
- [ ] #3319 
- [ ] #1397

jyn514 avatar Jan 07 '24 15:01 jyn514

@jyn514 Thanks a lot for filing this issue! I see basically two points being made here:

This is a nice suggestion, and I'm looking forward to implementing it :)

  • running rustc afterwards implicitly reinstalls the toolchain. i do not expect rustup to implicitly install in any case other than when rust-toolchain.toml is in the current directory. in fact, you can see that rustc +nightly does not implicitly install, only rustc by itself.
  • running rustup --version also silently installs.

As for removing implicit installations, it's already on our list (https://github.com/rust-lang/rustup/issues/3546#issuecomment-1831292725), but it seems to me that a separate issue hasn't been created yet.

Would you mind if I split this issue into two so that they can be tracked separately? I personally suggest use #3546 to track the removal of implicit installations, and move the first point over to #3319. Does that sound okay to you?

rami3l avatar Jan 08 '24 09:01 rami3l

sounds good to me :)

jyn514 avatar Jan 08 '24 20:01 jyn514

Hmmm I tried to change the description of #3546 but maybe it's not the best place to track implicit installation removal. I'll reuse this thread for that instead.

rami3l avatar Jan 12 '24 06:01 rami3l

See https://github.com/rust-lang/rustup/pull/2797#issuecomment-864506040 and follow the links out fro there. Multiple toolchains in #3546 seems entirely orthogonal. Closing as duplicate with https://github.com/rust-lang/rustup/issues/1397

rbtcollins avatar Jan 29 '24 05:01 rbtcollins

@rbtcollins Sorry, I've changed this to be a meta tracking issue which has #1397 on its list. Maybe that's not clear enough?

rami3l avatar Jan 29 '24 05:01 rami3l