diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs index d3f571dd8ae..6619838cce0 100644 --- a/src/tools/compiletest/src/runtest.rs +++ b/src/tools/compiletest/src/runtest.rs @@ -2412,7 +2412,14 @@ impl<'test> TestCx<'test> { .env("HOST_RPATH_DIR", cwd.join(&self.config.compile_lib_path)) .env("TARGET_RPATH_DIR", cwd.join(&self.config.run_lib_path)) .env("LLVM_COMPONENTS", &self.config.llvm_components) - .env("LLVM_CXXFLAGS", &self.config.llvm_cxxflags); + .env("LLVM_CXXFLAGS", &self.config.llvm_cxxflags) + + // We for sure don't want these tests to run in parallel, so make + // sure they don't have access to these vars if we we run via `make` + // at the top level + .env_remove("MAKEFLAGS") + .env_remove("MFLAGS") + .env_remove("CARGO_MAKEFLAGS"); if let Some(ref linker) = self.config.linker { cmd.env("RUSTC_LINKER", linker);