Skip to content

Commit 93a3b29

Browse files
committed
rustbuild: Only pass RUSTC_FLAGS to target compiles
These flags aren't applicable to build scripts, and may actuall wreak havoc.
1 parent 90d28ec commit 93a3b29

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/bootstrap/rustc.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ fn main() {
6161
root.push("/lib");
6262
cmd.arg("-L").arg(&root);
6363
}
64+
if let Ok(s) = env::var("RUSTC_FLAGS") {
65+
cmd.args(&s.split(" ").filter(|s| !s.is_empty()).collect::<Vec<_>>());
66+
}
6467
}
6568

6669
// Set various options from config.toml to configure how we're building
@@ -79,9 +82,6 @@ fn main() {
7982
if let Ok(s) = env::var("RUSTC_CODEGEN_UNITS") {
8083
cmd.arg("-C").arg(format!("codegen-units={}", s));
8184
}
82-
if let Ok(s) = env::var("RUSTC_FLAGS") {
83-
cmd.args(&s.split(" ").filter(|s| !s.is_empty()).collect::<Vec<_>>());
84-
}
8585

8686
// Actually run the compiler!
8787
std::process::exit(match cmd.status() {

0 commit comments

Comments
 (0)