CARGO
environment variable, if set to a proxy, should be changed to match the selected toolchain
#4274
Labels
CARGO
environment variable, if set to a proxy, should be changed to match the selected toolchain
#4274
Problem you are trying to solve
This is a follow up to rust-lang/cargo#15099
In short, it used to be that setting the
CARGO
environment variable to, e.g.$CARGO_HOME/bin/cargo
prior to invokingcargo
could result in mismatched toolchains whencargo
is managed by rustup, E.g.cargo +nightly
will run the nightly cargo but later use of theCARGO
environment variable would mean running the default toolchain instead (which may be different).That issue is fixed for newer versions of Cargo but rustup obviously supports installing old versions. Should we make a best effort to ensure the
CARGO
environment variable is correctly set to the right toolchain when running via a proxy?Solution you'd like
If running
cargo
via rustup and if theCARGO
environment variable is set to a rustup proxy (e.g. as in rustup managed$CARGO_HOME/bin/cargo
) then setCARGO
to the actual path forcargo
.Notes
This mimics newer cargo behaviour. We shouldn't go out of our way to fix this in all cases but if a minimal change works around this issue in most cases then it would still be useful, I think.
The text was updated successfully, but these errors were encountered: