about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMark Simulacrum <mark.simulacrum@gmail.com>2018-05-16 17:04:12 -0600
committerMark Simulacrum <mark.simulacrum@gmail.com>2018-05-17 08:47:25 -0600
commita22af69c8f5b3838a8822b9e6dbe2199cfb8f297 (patch)
treec672c185e29d2307c49ec0d3fab2d2e35cad5860
parent1ae3cff1eb6d849b5179b707f4ef0564e5fe9022 (diff)
Remove MAKEFLAGS to prevent accidental inheritance
-rw-r--r--src/bootstrap/builder.rs9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs
index e5824010ef2..e6795564dec 100644
--- a/src/bootstrap/builder.rs
+++ b/src/bootstrap/builder.rs
@@ -584,11 +584,10 @@ impl<'a> Builder<'a> {
             cargo.env("RUST_CHECK", "1");
         }
 
-        // If we were invoked from `make` then that's already got a jobserver
-        // set up for us so no need to tell Cargo about jobs all over again.
-        if env::var_os("MAKEFLAGS").is_none() && env::var_os("MFLAGS").is_none() {
-             cargo.arg("-j").arg(self.jobs().to_string());
-        }
+        cargo.arg("-j").arg(self.jobs().to_string());
+        // Remove make-related flags to ensure Cargo can correctly set things up
+        cargo.env_remove("MAKEFLAGS");
+        cargo.env_remove("MFLAGS");
 
         // FIXME: Temporary fix for https://github.com/rust-lang/cargo/issues/3005
         // Force cargo to output binaries with disambiguating hashes in the name