summaryrefslogtreecommitdiffstats
path: root/src/bootstrap/bin/rustc.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-18 02:49:50 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-18 02:49:50 +0000
commit9835e2ae736235810b4ea1c162ca5e65c547e770 (patch)
tree3fcebf40ed70e581d776a8a4c65923e8ec20e026 /src/bootstrap/bin/rustc.rs
parentReleasing progress-linux version 1.70.0+dfsg2-1~progress7.99u1. (diff)
downloadrustc-9835e2ae736235810b4ea1c162ca5e65c547e770.tar.xz
rustc-9835e2ae736235810b4ea1c162ca5e65c547e770.zip
Merging upstream version 1.71.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/bootstrap/bin/rustc.rs')
-rw-r--r--src/bootstrap/bin/rustc.rs11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/bootstrap/bin/rustc.rs b/src/bootstrap/bin/rustc.rs
index 040fec361..e87125a49 100644
--- a/src/bootstrap/bin/rustc.rs
+++ b/src/bootstrap/bin/rustc.rs
@@ -19,7 +19,7 @@ include!("../dylib_util.rs");
use std::env;
use std::path::PathBuf;
-use std::process::{Child, Command};
+use std::process::{exit, Child, Command};
use std::str::FromStr;
use std::time::Instant;
@@ -47,7 +47,12 @@ fn main() {
} else {
("RUSTC_REAL", "RUSTC_LIBDIR")
};
- let stage = env::var("RUSTC_STAGE").expect("RUSTC_STAGE was not set");
+ let stage = env::var("RUSTC_STAGE").unwrap_or_else(|_| {
+ // Don't panic here; it's reasonable to try and run these shims directly. Give a helpful error instead.
+ eprintln!("rustc shim: fatal: RUSTC_STAGE was not set");
+ eprintln!("rustc shim: note: use `x.py build -vvv` to see all environment variables set by bootstrap");
+ exit(101);
+ });
let sysroot = env::var_os("RUSTC_SYSROOT").expect("RUSTC_SYSROOT was not set");
let on_fail = env::var_os("RUSTC_ON_FAIL").map(Command::new);
@@ -150,7 +155,7 @@ fn main() {
// allow the `rustc_private` feature to link to other unstable crates
// also in the sysroot. We also do this for host crates, since those
// may be proc macros, in which case we might ship them.
- if env::var_os("RUSTC_FORCE_UNSTABLE").is_some() && (stage != "0" || target.is_some()) {
+ if env::var_os("RUSTC_FORCE_UNSTABLE").is_some() {
cmd.arg("-Z").arg("force-unstable-if-unmarked");
}