-
Notifications
You must be signed in to change notification settings - Fork 892
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
rustup show
should not force-install the default toolchain if it is not installed.
#1397
Comments
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 |
@kinnison Personally I think a command like |
rustup show
update toolchains?rustup show
should not force-install the default toolchain if it is not installed.
@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 If anyone wants help with working this one through to a PR, please comment here or find me on |
@kinnison |
@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. |
What about |
I think if you explicitly say |
I'm still unsure what is the right behaviour: which commands of the following should install a toolchain ?
What about healing damaged toolchains ? Furthermore, there are actually tests ( |
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 I also think if you're explicitly asking questions of the toolchain then it should be installed if absent ( Of the examples you gave, I think that means a plain 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. |
If we are going to make such a breaking change I agree that an RFC would be best. If we're to file an RFC we need to think through all the implications of disabling implicit installation for the various commands and decide which retain implicit installation and which will no longer support it. As a starter for ten, I think the following must continue to support implicit installation:
I'm sure there's other places where implicit install is still preferable, but as a starting point, would people agree that the above should include it? |
It doesn't make intrinsic sense to me that merely adding +toolchain to a command causes an install. I think of rustup as an API, and there are metadata operations such as show and version which should strictly show what the state of the system is without mutating it; operations such as as 'default' that mutate metadata and also shouldn't obviously install, but perhaps the ergonomics of ease of ease make 'default stable' doing an install desirable - I'm not a purist on this model - and then operations like install /update/target add, where the operation is doing the install, and finally anything via a proxy where the implicit install is super useful, but not the goal of the command. And the implicit install in that last case bites us in some places such as the docker bugs we get from time to time where implicit toolchain installation will break rather than erroring with a 'not installed' error which would allow direct debugging of the situation (obviously supporting docker layers would also help :P). Having used goenv/pyenv etc a lot, I really do quite like implicit install, so I think even with the occasional bite we probably should keep it; but it should be very clear and reasoned where it triggers. I would suggest:
|
I think that's a reasonable compromise. I will note though that not autoinstalling on |
It might be nice for instance to have a 'please install whatever the current toolchain is' command, maybe via options to install? Rather than having folk run 'rustup rustc' to trigger autoinstalls when using toolchain files. |
I can almost imagine that as |
My only concern about that is that what-if we wanted to permit installing a toolchain from a dir/tarball etc in future. We'd need to make sure that we can discriminate effectively. Probably we can but lets think it through. |
I think installing from a dir is more |
We could look for a new verb for this though like 'ensure' or something.
|
Hmm I like |
I think
I've thought about 'auto-install' although ensure is also good.
|
Regarding implicit installs, as a user it seems obvious to me that commands that I expect be purely informational wouldn't modify my system under any circumstances: It wouldn't really bother me to have commands that already modify the behaviour of my system in some way automatically install things, and would often be a pleasant convenience: I think |
|
I was just bit by this (again!) in a very surprising and unpleasant way (again!). I issued the command The command |
As I was bit by this today (complete with reflexive panic ctrl+c, uninstall and reinstall of rustup, and bafflement until I found where directory overrides are stored), I'd love to see any path forwards here. Would it be acceptable to at least add a flag to disable all downloads? Something like: |
This changes the format of `rustup show` to be in a more logical order, and changes the format of `rustup show active-toolchain` to match. Also, as suggested in a comment, these commands will no longer install the active toolchain if it is not already installed, as they now call `cfg.find_active_toolchain()` instead of `cfg.find_or_install_active_toolchain()`. This fixes rust-lang#1397
This comment was marked as spam.
This comment was marked as spam.
This changes the format of `rustup show` to be in a more logical order, and changes the format of `rustup show active-toolchain` to match. Also, as suggested in a comment, these commands will no longer install the active toolchain if it is not already installed, as they now call `cfg.find_active_toolchain()` instead of `cfg.find_or_install_active_toolchain()`. This fixes rust-lang#1397
This changes the format of `rustup show` to be in a more logical order, and changes the format of `rustup show active-toolchain` to match. Also, as suggested in a comment, these commands will no longer install the active toolchain if it is not already installed, as they now call `cfg.find_active_toolchain()` instead of `cfg.find_or_install_active_toolchain()`. This fixes rust-lang#1397
This changes the format of `rustup show` to be in a more logical order, and changes the format of `rustup show active-toolchain` to match. Also, as suggested in a comment, these commands will no longer install the active toolchain if it is not already installed, as they now call `cfg.find_active_toolchain()` instead of `cfg.find_or_install_active_toolchain()`. This fixes rust-lang#1397
This changes the format of `rustup show` to be in a more logical order, and changes the format of `rustup show active-toolchain` to match. Also, as suggested in a comment, these commands will no longer install the active toolchain if it is not already installed, as they now call `cfg.find_active_toolchain()` instead of `cfg.find_or_install_active_toolchain()`. This fixes rust-lang#1397
This changes the format of `rustup show` to be in a more logical order, and changes the format of `rustup show active-toolchain` to match. Also, as suggested in a comment, these commands will no longer install the active toolchain if it is not already installed, as they now call `cfg.find_active_toolchain()` instead of `cfg.find_or_install_active_toolchain()`. This fixes rust-lang#1397
This changes the format of `rustup show` to be in a more logical order, and changes the format of `rustup show active-toolchain` to match. Also, as suggested in a comment, these commands will no longer install the active toolchain if it is not already installed, as they now call `cfg.find_active_toolchain()` instead of `cfg.find_or_install_active_toolchain()`. This fixes rust-lang#1397
This changes the format of `rustup show` to be in a more logical order, and changes the format of `rustup show active-toolchain` to match. Also, as suggested in a comment, these commands will no longer install the active toolchain if it is not already installed, as they now call `cfg.find_active_toolchain()` instead of `cfg.find_or_install_active_toolchain()`. This fixes rust-lang#1397
This changes the format of `rustup show` to be in a more logical order, and changes the format of `rustup show active-toolchain` to match. Also, as suggested in a comment, these commands will no longer install the active toolchain if it is not already installed, as they now call `cfg.find_active_toolchain()` instead of `cfg.find_or_install_active_toolchain()`. This fixes rust-lang#1397
This changes the format of `rustup show` to be in a more logical order, and changes the format of `rustup show active-toolchain` to match. Also, as suggested in a comment, these commands will no longer install the active toolchain if it is not already installed, as they now call `cfg.find_active_toolchain()` instead of `cfg.find_or_install_active_toolchain()`. This fixes rust-lang#1397
This changes the format of `rustup show` to be in a more logical order, and changes the format of `rustup show active-toolchain` to match. Also, as suggested in a comment, these commands will no longer install the active toolchain if it is not already installed, as they now call `cfg.find_active_toolchain()` instead of `cfg.find_or_install_active_toolchain()`. This fixes rust-lang#1397
This changes the format of `rustup show` to be in a more logical order, and changes the format of `rustup show active-toolchain` to match. Also, as suggested in a comment, these commands will no longer install the active toolchain if it is not already installed, as they now call `cfg.find_active_toolchain()` instead of `cfg.find_or_install_active_toolchain()`. This fixes #1397
This behavior confused me:
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.
The text was updated successfully, but these errors were encountered: