-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
rustc --version
should not trigger/initiate toolchain updates
#127649
Comments
This is a rustup issue (the toolchain manager) and not caused by rust itself. See: rust-lang/rustup#3635 |
What is the alternative? Have it report an error to the user that they need to manually invoke rustup to update their toolchain? That is a lot less ergonomic and likely breaks tools that invoke rustc or cargo and don't expect this error and may not even have a good way to show the error. |
I expect In my humble opinion The To be clear... I think it's ok to trigger updates for calls to |
That justification makes sense, but it would also mean that if you run |
Note that when the toolchain is managed by rustup, the rustc command is a rustup proxy. rustc itself will never download or install toolchains (it wouldn't even know how to). So discussion should move to the rustup repository. Discussing it here will not affect changes to rustup. |
I can even imagine this behavior to pose a security risk, as users would not expect |
If I run So maybe then it should indeed also report that the versions do not match... and how to update. Or maybe an extra flag to also trigger an update if necessary. |
I understand. Should I repeat this Issue on the rustup repo, or did you effectively do that already with your first reply? (thanks for the quick response, by the way) |
It looks like there is already a related PR rust-lang/rustup#2658. |
You could mention |
If you invoke a But since you may well have many versions of rustc installed, the question then becomes which of those many rustc's do you want to invoke? The proxy decided (from the |
@ChrisDenton Err not quite; that's not about the shim but about Anyway rust-lang/rustup#3635 has already covered this even before this issue's appearance, so I suggest we close this issue in favor of that one. |
Ah thanks! Ok then, closing this in favour of the rustup issue. |
@ChrisDenton Thanks! BTW can you transfer the issue to Rustup so that we might keep the conversation history while keeping this sub-task tracked individually? (Don't worry if you don't have the permission, I'll make a new issue there instead if that is the case.) |
Yeah sorry, I don't have any permissions on the rustup repo. |
(@ChrisDenton you can use |
rustc --version
should, in my humble opinion, not perform any unexpected behavior like initiating toolchain updates.As a user I expect just the current active version of rustc to be returned and nothing else to happen.
Instead running
rustc --version
within a newly cloned rust-project triggers installation of a toolchain.I ran into this issue within an application like oh-my-posh which uses
rustc --version
to display rustc's version number in the command prompt.The issue can easily be replicated by cloning a project that require a toolchain update and then running
rustc --version
:output:
Meta
rustc --version --verbose
:The text was updated successfully, but these errors were encountered: