Skip to content
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

Get the Rust version for a specific directory #2934

Closed
TonalidadeHidrica opened this issue Jan 14, 2022 · 4 comments
Closed

Get the Rust version for a specific directory #2934

TonalidadeHidrica opened this issue Jan 14, 2022 · 4 comments

Comments

@TonalidadeHidrica
Copy link

Problem you are trying to solve

If we run rustc --version for a directory when the version specified in e.g. rust-toolchain is not installed, rustup automatically downloads the version.

Solution you'd like

It's better to have a way to obtain the Rust version that would be used for current working directory (or any other directory) without obtaining actual binary.

Notes

This would be especially useful for shell extensions that shows the current Rust version. The real-world examples are:

  • starship, which re-implements the algorithm to resolve the Rust version in order to avoid running anything like rustup or rustc;
  • tide plugin for fish shell, which has a feature to show the Rust version in the prompt, which triggers inevitable download when cd-ing to a working directory containing rust-toolchain specifying not-currently-installed toolchain
@rbtcollins
Copy link
Contributor

rustc itself cannot be run without being downloaded - and the proxy doesn't know what version an arbitrary binary will output.

We could make rustup show work without downloading the toolchain, and there is an open feature request to enable that. Would that be sufficient?

@TonalidadeHidrica
Copy link
Author

@rbtcollins Yes, making rustup show wor without downloading the toolchain will do.

@TonalidadeHidrica
Copy link
Author

@rbtcollins Which specific ticket requests the feature?

@TonalidadeHidrica
Copy link
Author

(After two years) I found the issue about this topic, #1397, and by luck it has been closed just three days ago. So I think I can close the issue, horray!

@djc djc closed this as not planned Won't fix, can't repro, duplicate, stale May 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants