Skip to content

Commit

Permalink
Inherit $RUSTUP_HOME
Browse files Browse the repository at this point in the history
Summary:
Without this, it is impossible to run the prelude-provided `system_rust_toolchain` on systems with a Rustup-managed `rustc` in a non-default location. This includes official Microsoft devcontainers such as <https://hub.docker.com/r/microsoft/devcontainers-rust> which use `RUSTUP_HOME=/usr/local/rustup`.

```lang=text,counterexample
Action failed: root//third-party:unicode-ident-1.0.14 (rustc diag)
Local command returned non-zero exit code 1

error: rustup could not choose a version of rustc to run, because one wasn't specified explicitly, and no default is configured.

help: run 'rustup default stable' to download the latest stable release of Rust and set it as your default toolchain.

Stack backtrace:
   0: anyhow::error::<impl core::convert::From<E> for anyhow::Error>::from
   1: rustup::config::Cfg::find_or_install_override_toolchain_or_default
   2: rustup::cli::proxy_mode::main
   3: rustup_init::main
   4: std::sys_common::backtrace::__rust_begin_short_backtrace
   5: main
   6: <unknown>
   7: __libc_start_main
   8: <unknown>
```

Reviewed By: zertosh

Differential Revision: D68675864

fbshipit-source-id: 98d4685b8f59fc6304b8665115fe1027c942f74b
  • Loading branch information
David Tolnay authored and facebook-github-bot committed Jan 26, 2025
1 parent 9efce18 commit 50a45b1
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions rust/tools/rustc_action.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"PATH",
"PWD",
"HOME",
"RUSTUP_HOME",
"TMPDIR",
# Required on Windows
"LOCALAPPDATA",
Expand Down

0 comments on commit 50a45b1

Please sign in to comment.