You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
rustup show should not force-install the default toolchain if it is not installed. #1397
Is rustup show supposed to actually start installing components? I was under the impression that it was just for listing out what you have installed.
I'm on a macOS 10.12.6 host.
Reacted by ncaq, Maxwell, Daniel Mikusa, Mark, Sam Harrington, Tomasz bla Fortuna, Yerkebulan Tulibergenov, Magnus Markling, zjp-CN, Gabriel and 1 more
The behaviour here comes from the fact that the default toolchain was uninstalled. Rustup forces the default toolchain to exist in many places semi-automatically. This is done to reduce surprise in a number of places, but has the side-effect of being surprising here. Perhaps we need an info: Default toolchain not installed, attempting to install... which would make it clear why it's happening?
@kinnison Personally I think a command like show should never actually install something and change the user's environment. That just seems very odd to me and I can't think of another example of a tool that does something like that.
Reacted by Maximilian Roos, Magnus Markling and Gabriel
changed the title [-]Should `rustup show` update toolchains?[/-][+]`rustup show` should not force-install the default toolchain if it is not installed.[/+]on Nov 17, 2019
@johnthagen That's fair, I have retitled the issue and I'm happy to mentor yourself or anyone else through the process of determining why this happens, and what we can do to improve the UX and ensure it doesn't happen in future. This is nominally a breaking change in how rustup show works, but frankly I think it's right to do it.
If anyone wants help with working this one through to a PR, please comment here or find me on #wg-rustup on our Discord.
@SummerGram I think that noone is working on this per-se. It should be fairly easy to work out what's going on after recent refactoring done by Robert.
I think, for each case we need to think about whether or not having the toolchain absent would cause confusion or breakage in scripting which may already exist and rely on behaviour. I'm prepared to introduce some breaking change so long as it's very well thought out.
In my view, if you are explicitly stating a toolchain via +toolchain or via a rust-toolchain file then we should always install that since I know some people rely on that behaviour in CI (i.e. running rustup show as part of their CI to both ensure the toolchain is present, and to display the toolchain information in the CI logs, but IIRC the projects I know doing this all have rust-toolchain files).
I also think if you're explicitly asking questions of the toolchain then it should be installed if absent (rustup show active-toolchain).
Of the examples you gave, I think that means a plain rustup --version and a plain rustup show (plain in the sense of no +toolchain and no rust-toolchain override file) are the only ones I'd entertain not force-installing the toolchain for. And they should emit a warning if the toolchain is absent.
All in all this is a somewhat confusing situation to be in, made worse because people are relying on the theoretically 'odd' behaviour.
I think we should break things. Not cavalierly, but carefully, perhaps even with an RFC. But we have 'install', and we can make that idempotent. We can make a version of install that honours toolchain files etc. But (ab)using show to trigger an install is just counter intuitive and will be an ongoing source of WTFs forever.
Reacted by Begley Brothers (Development) and William Lyles
Activity
kinnison commentedon Nov 10, 2019
The behaviour here comes from the fact that the default toolchain was uninstalled. Rustup forces the default toolchain to exist in many places semi-automatically. This is done to reduce surprise in a number of places, but has the side-effect of being surprising here. Perhaps we need an
info: Default toolchain not installed, attempting to install...which would make it clear why it's happening?johnthagen commentedon Nov 16, 2019
@kinnison Personally I think a command like
showshould never actually install something and change the user's environment. That just seems very odd to me and I can't think of another example of a tool that does something like that.[-]Should `rustup show` update toolchains?[/-][+]`rustup show` should not force-install the default toolchain if it is not installed.[/+]kinnison commentedon Nov 17, 2019
@johnthagen That's fair, I have retitled the issue and I'm happy to mentor yourself or anyone else through the process of determining why this happens, and what we can do to improve the UX and ensure it doesn't happen in future. This is nominally a breaking change in how
rustup showworks, but frankly I think it's right to do it.If anyone wants help with working this one through to a PR, please comment here or find me on
#wg-rustupon our Discord.SummerGram commentedon Mar 21, 2020
@kinnison
anyone doing this?
kinnison commentedon Mar 21, 2020
@SummerGram I think that noone is working on this per-se. It should be fairly easy to work out what's going on after recent refactoring done by Robert.
kellda commentedon Feb 11, 2021
What about
rustup --versionorrustup +toolchain --version?kinnison commentedon Feb 12, 2021
I think if you explicitly say
+toolchainthen you're saying you want that to be installed.kellda commentedon Feb 13, 2021
I'm still unsure what is the right behaviour: which commands of the following should install a toolchain ?
rustup --versionrustup +toolchain --versionrustup showrustup +toolchain showrustup show active-toolchainrustup +toolchain show active-toolchainWhat about healing damaged toolchains ?
Furthermore, there are actually tests (
*_not_installedincli-rustup.rs) that check thatrustup showinstalls the toolchain.kellda commentedon Feb 13, 2021
cc #1250 for the tests
cc #2252 for always installing toolchains
kinnison commentedon Feb 16, 2021
I think, for each case we need to think about whether or not having the toolchain absent would cause confusion or breakage in scripting which may already exist and rely on behaviour. I'm prepared to introduce some breaking change so long as it's very well thought out.
In my view, if you are explicitly stating a toolchain via
+toolchainor via arust-toolchainfile then we should always install that since I know some people rely on that behaviour in CI (i.e. runningrustup showas part of their CI to both ensure the toolchain is present, and to display the toolchain information in the CI logs, but IIRC the projects I know doing this all haverust-toolchainfiles).I also think if you're explicitly asking questions of the toolchain then it should be installed if absent (
rustup show active-toolchain).Of the examples you gave, I think that means a plain
rustup --versionand a plainrustup show(plain in the sense of no+toolchainand norust-toolchainoverride file) are the only ones I'd entertain not force-installing the toolchain for. And they should emit a warning if the toolchain is absent.All in all this is a somewhat confusing situation to be in, made worse because people are relying on the theoretically 'odd' behaviour.
rbtcollins commentedon Feb 16, 2021
I think we should break things. Not cavalierly, but carefully, perhaps even with an RFC. But we have 'install', and we can make that idempotent. We can make a version of install that honours toolchain files etc. But (ab)using show to trigger an install is just counter intuitive and will be an ongoing source of WTFs forever.
22 remaining items
Update format of `show` and `show active-toolchain`
Update format of `show` and `show active-toolchain`
Update format of `show` and `show active-toolchain`
Update format of `show` and `show active-toolchain`
Update format of `show` and `show active-toolchain`
Update format of `show` and `show active-toolchain`
Update format of `show` and `show active-toolchain`
Update format of `show` and `show active-toolchain`
Update format of `show` and `show active-toolchain`
Update format of `show` and `show active-toolchain`
rami3l commentedon Jul 15, 2024
This issue will only track the
rustup showcase, which is already addressed by #3225. For other cases, let's continue the discussion at #3635.