Navigation Menu

Skip to content

Commit

Permalink
test: Forcibly remove MAKEFLAGS in compiletest
Browse files Browse the repository at this point in the history
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]: #48295 (comment)
  • Loading branch information
alexcrichton committed Mar 11, 2018
1 parent 5f2efb0 commit 9a3128e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/tools/compiletest/src/runtest.rs
Expand Up @@ -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);
Expand Down

0 comments on commit 9a3128e

Please sign in to comment.