Set BUILD_TRIPLE via build script
This moves build triple discovery for rustbuild from bootstrap.py into a build script, meaning it will "just work" if building rustbuild via Cargo rather than Python.
This commit is contained in:
parent
81e02708f1
commit
6d19561587
@ -3,6 +3,7 @@ authors = ["The Rust Project Developers"]
|
||||
name = "bootstrap"
|
||||
version = "0.0.0"
|
||||
edition = "2018"
|
||||
build = "build.rs"
|
||||
|
||||
[lib]
|
||||
path = "lib.rs"
|
||||
|
@ -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
|
||||
|
3
src/bootstrap/build.rs
Normal file
3
src/bootstrap/build.rs
Normal file
@ -0,0 +1,3 @@
|
||||
fn main() {
|
||||
println!("cargo:rustc-env=BUILD_TRIPLE={}", std::env::var("HOST").unwrap());
|
||||
}
|
@ -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");
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user