diff --git a/src/bootstrap/Cargo.toml b/src/bootstrap/Cargo.toml index faec2c53742ec..890315a744e56 100644 --- a/src/bootstrap/Cargo.toml +++ b/src/bootstrap/Cargo.toml @@ -3,6 +3,7 @@ authors = ["The Rust Project Developers"] name = "bootstrap" version = "0.0.0" edition = "2018" +build = "build.rs" [lib] path = "lib.rs" diff --git a/src/bootstrap/bootstrap.py b/src/bootstrap/bootstrap.py index 5f78031e1c7cb..c9a9a484ee338 100644 --- a/src/bootstrap/bootstrap.py +++ b/src/bootstrap/bootstrap.py @@ -1032,7 +1032,6 @@ def bootstrap(help_triggered): args = [build.bootstrap_binary()] args.extend(sys.argv[1:]) env = os.environ.copy() - env["BUILD"] = build.build env["SRC"] = build.rust_root env["BOOTSTRAP_PARENT_ID"] = str(os.getpid()) env["BOOTSTRAP_PYTHON"] = sys.executable diff --git a/src/bootstrap/build.rs b/src/bootstrap/build.rs new file mode 100644 index 0000000000000..5e5c31de5b6dc --- /dev/null +++ b/src/bootstrap/build.rs @@ -0,0 +1,3 @@ +fn main() { + println!("cargo:rustc-env=BUILD_TRIPLE={}", std::env::var("HOST").unwrap()); +} diff --git a/src/bootstrap/config.rs b/src/bootstrap/config.rs index 6de4388495baf..1ec99ef30ffa5 100644 --- a/src/bootstrap/config.rs +++ b/src/bootstrap/config.rs @@ -487,7 +487,7 @@ impl Config { config.missing_tools = false; // set by bootstrap.py - config.build = TargetSelection::from_user(&env::var("BUILD").expect("'BUILD' to be set")); + config.build = TargetSelection::from_user(&env!("BUILD_TRIPLE")); config.src = Config::path_from_python("SRC"); config.out = Config::path_from_python("BUILD_DIR");