rustup
rustup copied to clipboard
Rustup should not perform implicit installations
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
rustcafterwards implicitly reinstalls the toolchain. i do not expect rustup to implicitly install in any case other than whenrust-toolchain.tomlis in the current directory. in fact, you can see thatrustc +nightlydoes not implicitly install, onlyrustcby itself. - [ ] running
rustup --versionalso silently installs. - [x] running
rustup showalso silently installs.
Notes
rustup 1.26.0 (5af9b9484 2023-04-05)
### Tasks
- [ ] #3319
- [ ] #1397
@jyn514 Thanks a lot for filing this issue! I see basically two points being made here:
- uninstalling the default toolchain happens silently. i would expect either a warning (by the same logic as Give a warning before uninstalling the last/host target for a toolchain #3319), or for rustup to switch to a different default toolchain.
This is a nice suggestion, and I'm looking forward to implementing it :)
- running
rustcafterwards implicitly reinstalls the toolchain. i do not expect rustup to implicitly install in any case other than whenrust-toolchain.tomlis in the current directory. in fact, you can see thatrustc +nightlydoes not implicitly install, onlyrustcby itself.- running
rustup --versionalso 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?
sounds good to me :)
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.
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 Sorry, I've changed this to be a meta tracking issue which has #1397 on its list. Maybe that's not clear enough?