Skip to content

Commit 60312ed

Browse files
committed
tests: update compiler-builtins
Update `run-make/compiler-builtins` to not use `Command::env_clear` for `cargo` to not mess up temp dir on Windows platforms, which need to be set in order for codegen temp files to function properly. Otherwise, if the temp dir falls back to the Windows directory, there will be permission errors (let alone having temp files in non-build directories).
1 parent 2a8516e commit 60312ed

File tree

1 file changed

+5
-1
lines changed
  • tests/run-make/compiler-builtins

1 file changed

+5
-1
lines changed

tests/run-make/compiler-builtins/rmake.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
#![deny(warnings)]
1616

17+
use run_make_support::clear_non_essential_env_vars;
1718
use run_make_support::object;
1819
use run_make_support::object::read::archive::ArchiveFile;
1920
use run_make_support::object::read::Object;
@@ -48,6 +49,10 @@ fn main() {
4849
let rustc = std::env::var("RUSTC").unwrap();
4950
let bootstrap_cargo = std::env::var("BOOTSTRAP_CARGO").unwrap();
5051
let mut cmd = std::process::Command::new(bootstrap_cargo);
52+
53+
// Remove some env vars inherited from parent processes to fully control the env vars
54+
// `cargo` has access to.
55+
clear_non_essential_env_vars(&mut cmd);
5156
cmd.args([
5257
"build",
5358
"--manifest-path",
@@ -56,7 +61,6 @@ fn main() {
5661
"--target",
5762
&target,
5863
])
59-
.env_clear()
6064
.env("PATH", path)
6165
.env("RUSTC", rustc)
6266
.env("RUSTFLAGS", "-Copt-level=0 -Cdebug-assertions=yes")

0 commit comments

Comments
 (0)