Closed hkBst closed 7 months ago
One such situation in which rustversion does the wrong thing is when you run:
cargo run
then change to RUSTC=rustc_with_other_version_or_nightlyness cargo run
. The second run will not pickup on the changed version because rustversion does not currently think it should rerun if RUSTC changed.
I can provide a test crate and a test wrapper for rustc if it helps.
The reason I am interested in this is that I currently have 1.76.0 installed but with nightly enabled. Since nightly has evolved since, I now need to disable nightly-detection by crates to avoid errors. There does not seem to be a direct way to do that, so I'd like to wrap rustc to change the way it reports its version.
Cargo already runs $RUSTC -vV
and re-runs all build scripts when the rustc version is changed. The relevant thing is the rustc version, not the $RUSTC environment variable. If $RUSTC changes but the rustc version does not, there is no need to rebuild. If $RUSTC does not change but the rustc version does, we do rebuild.
If the only issue is that your wrapper only recognizes -V
and not -vV
, then I would prefer not to accept this change.
Ah, indeed the wrapper started out not supporting "-vV". I will retest with that support. Thanks for the tip!
Currently rustversion uses RUSTC to determine which executable to ask for a version. If RUSTC changes, then it is possible that the version information changes as well, so should rerun in that case.