Skip to content

Commit 911f6f1

Browse files
Rollup merge of rust-lang#48938 - alexcrichton:no-leak-makeflags, r=kennytm
test: Forcibly remove MAKEFLAGS in compiletest When executing run-make tests we run a risk of leaking the `MAKEFLAGS` environment variable if `./x.py` itself was called from `make` (aka `make check -j3` as the OSX bots do). We may then leak accidentally fds into the child process and trick it into thinking it's got a jobserver! Hopefully addresses [this] spurious failure [this]: rust-lang#48295 (comment)
2 parents 4d85efe + 9a3128e commit 911f6f1

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Diff for: src/tools/compiletest/src/runtest.rs

+8-1
Original file line numberDiff line numberDiff line change
@@ -2412,7 +2412,14 @@ impl<'test> TestCx<'test> {
24122412
.env("HOST_RPATH_DIR", cwd.join(&self.config.compile_lib_path))
24132413
.env("TARGET_RPATH_DIR", cwd.join(&self.config.run_lib_path))
24142414
.env("LLVM_COMPONENTS", &self.config.llvm_components)
2415-
.env("LLVM_CXXFLAGS", &self.config.llvm_cxxflags);
2415+
.env("LLVM_CXXFLAGS", &self.config.llvm_cxxflags)
2416+
2417+
// We for sure don't want these tests to run in parallel, so make
2418+
// sure they don't have access to these vars if we we run via `make`
2419+
// at the top level
2420+
.env_remove("MAKEFLAGS")
2421+
.env_remove("MFLAGS")
2422+
.env_remove("CARGO_MAKEFLAGS");
24162423

24172424
if let Some(ref linker) = self.config.linker {
24182425
cmd.env("RUSTC_LINKER", linker);

0 commit comments

Comments
 (0)