rustup
rustup copied to clipboard
Undocumented environment variables?
Problem you are trying to solve
https://rust-lang.github.io/rustup/environment-variables.html https://rust-lang.github.io/rustup/dev-guide/tips-and-tricks.html
After reading the rustup
code a little (https://github.com/rust-lang/rust-forge/issues/760), I found out that not all the environment variables it supports are documented. A quick search using grep -rniI -e "var(" -e "env\!(" -e "env(" -e "var_os("
revealed at least these:
https://github.com/rust-lang/rustup/blob/edf5c22d478ecce60ae35e3d3a1ae5ff04c6bedb/src/cli/self_update/unix.rs#L21
https://github.com/rust-lang/rustup/blob/edf5c22d478ecce60ae35e3d3a1ae5ff04c6bedb/src/cli/self_update/windows.rs#L186
https://github.com/rust-lang/rustup/blob/edf5c22d478ecce60ae35e3d3a1ae5ff04c6bedb/src/cli/self_update.rs#L512
https://github.com/rust-lang/rustup/blob/edf5c22d478ecce60ae35e3d3a1ae5ff04c6bedb/src/cli/self_update.rs#L627
https://github.com/rust-lang/rustup/blob/edf5c22d478ecce60ae35e3d3a1ae5ff04c6bedb/src/dist/mod.rs#L368
https://github.com/rust-lang/rustup/blob/edf5c22d478ecce60ae35e3d3a1ae5ff04c6bedb/src/dist/mod.rs#L534
https://github.com/rust-lang/rustup/blob/edf5c22d478ecce60ae35e3d3a1ae5ff04c6bedb/src/dist/mod.rs#L660
- Particularly important because current doc directly advises using
RUSTUP_DIST_SERVER
for this, contrary to rust-lang/rustup@f08c4fe8026cb48582b01a27d4ff72cc51b5299d: https://github.com/rust-lang/rustup/blob/edf5c22d478ecce60ae35e3d3a1ae5ff04c6bedb/doc/user-guide/src/environment-variables.md?plain=1#L17-L20
https://github.com/rust-lang/rustup/blob/edf5c22d478ecce60ae35e3d3a1ae5ff04c6bedb/src/utils/utils.rs#L248
https://github.com/rust-lang/rustup/blob/edf5c22d478ecce60ae35e3d3a1ae5ff04c6bedb/src/config.rs#L274
https://github.com/rust-lang/rustup/blob/edf5c22d478ecce60ae35e3d3a1ae5ff04c6bedb/src/config.rs#L400
https://github.com/rust-lang/rustup/blob/edf5c22d478ecce60ae35e3d3a1ae5ff04c6bedb/src/toolchain.rs#L247
Solution you'd like
Describe all this somewhere and/or make a list of variables for internal use so as not to confuse people.