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

Undocumented environment variables? #3957

Open
cher-nov opened this issue Jul 21, 2024 · 5 comments
Open

Undocumented environment variables? #3957

cher-nov opened this issue Jul 21, 2024 · 5 comments
Labels

Comments

@cher-nov
Copy link

cher-nov commented Jul 21, 2024

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 (rust-lang/rust-forge#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:

.var_os("RUSTUP_INIT_SKIP_SUDO_CHECK")

if process.var("RUSTUP_INIT_SKIP_MSVC_CHECK").is_ok() {

.var_os("RUSTUP_INIT_SKIP_EXISTENCE_CHECKS")

let skip_check = process.var_os("RUSTUP_INIT_SKIP_PATH_CHECK");

if let Some(triple) = option_env!("RUSTUP_OVERRIDE_BUILD_TRIPLE") {

if let Ok(triple) = process.var("RUSTUP_OVERRIDE_HOST_TRIPLE") {

let do_manifest_staging = process.var("RUSTUP_STAGED_MANIFEST").is_ok();

  • Particularly important because current doc directly advises using RUSTUP_DIST_SERVER for this, contrary to f08c4fe:
    - `RUSTUP_DIST_SERVER` (default: `https://static.rust-lang.org`). Sets the root
    URL for downloading static resources related to Rust. You can change this to
    instead use a local mirror, or to test the binaries from the staging
    directory.

.var_os("RUSTUP_USE_RUSTLS")

match process.var("RUSTUP_OVERRIDE_UNIX_FALLBACK_SETTINGS") {

if self.process.var("CI").is_ok() && self.process.var("RUSTUP_CI").is_err() {

.var_os("RUSTUP_WINDOWS_PATH_ADD_BIN")

Solution you'd like

Describe all this somewhere and/or make a list of variables for internal use so as not to confuse people.

@djc
Copy link
Contributor

djc commented Jul 21, 2024

You did not describe the "problem you are trying to solve". What is it? What are you confused about?

@cher-nov
Copy link
Author

You did not describe the "problem you are trying to solve". What is it? What are you confused about?

Sorry, my English is far from perfect.
The thing that confuses me is the support for these variables in the code and their absence in the official documentation. That's it.

@djc
Copy link
Contributor

djc commented Jul 21, 2024

Right -- the question I'm asking is, what are you trying to achieve that you need to understand these variables?

@cher-nov
Copy link
Author

Right -- the question I'm asking is, what are you trying to achieve that you need to understand these variables?

How to correctly access the staging manifests at least. I just noticed that RUSTUP_STAGED_MANIFEST is not the only undocumented variable, and decided to make a list of them so that Rust developers don’t have to bother with this. "It is my duty to report." (c)

@djc
Copy link
Contributor

djc commented Jul 23, 2024

I'm not sure it makes sense to me to document a list of internal-only environment variables. I think most of these should probably remain internal and keeping those undocumented seems okay to me.

@rami3l rami3l changed the title user-guide/environment-variables, dev-guide/tips-and-tricks, ... — Undocumented environment variables?.. Undocumented environment variables? Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants