tide
tide copied to clipboard
rustup causes `rustc` invocation to automatically download toolchain
Describe the bug
If a rust folder contains rust-toolchain.toml requiring version that isn't installed, rustc --version automatically tries to install the toolchain. So if we quickly open nvim or any other cli program after switching to the folder, contents from stderr is displayed.
Steps to reproduce
- Create empty rust project with cargo init
- Create rust-toolchain.toml file with content as follows:
[toolchain]
# set channel to one that is not installed
channel = "1.72"
- Switch to the directory and open any CLI program like nvim or top.
Screenshots
Can't reproduce. I have rustc
installed through pacman
as opposed to rustup or whatever, not sure if that makes the difference.
I have installed rustup thorough pacman and it installs the rust toolchain. Rustup allows multiple versions of rust to be installed and it checks the rust-toolchain.toml for the required version for project. That's also probably why rustc --version is showing latest version and not installing the defined version in your case.
Yah ok, doing things through rustup causes this behavior. I have to say I think this is terrible behavior on the part of rustup. If you try to get tab completion on rustc
when you don't have the proper version installed, fish will lock up while it is silently downloading the correct version in the background.
I really don't want to have Tide causing a 30s download in the background. Is there any way to like, politely ask rustc
/rustup
if calling rustc
will give you rustc
, or if it will download something?
I was also trying to find if there is some way to only ask for version and not download but didn't find one. Seems like this issue has been open since long time: https://github.com/rust-lang/rustup/issues/1397
The issue has been resolved by https://github.com/rust-lang/rustup/pull/3225 , and it will be released as 1.28.0. Once released, we can simply use rustup show active-toolchain
.