Skip to content

Commit

Permalink
tests: update compiler-builtins
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
jieyouxu committed May 22, 2024
1 parent 2a8516e commit 60312ed
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tests/run-make/compiler-builtins/rmake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

#![deny(warnings)]

use run_make_support::clear_non_essential_env_vars;
use run_make_support::object;
use run_make_support::object::read::archive::ArchiveFile;
use run_make_support::object::read::Object;
Expand Down Expand Up @@ -48,6 +49,10 @@ fn main() {
let rustc = std::env::var("RUSTC").unwrap();
let bootstrap_cargo = std::env::var("BOOTSTRAP_CARGO").unwrap();
let mut cmd = std::process::Command::new(bootstrap_cargo);

// Remove some env vars inherited from parent processes to fully control the env vars
// `cargo` has access to.
clear_non_essential_env_vars(&mut cmd);
cmd.args([
"build",
"--manifest-path",
Expand All @@ -56,7 +61,6 @@ fn main() {
"--target",
&target,
])
.env_clear()
.env("PATH", path)
.env("RUSTC", rustc)
.env("RUSTFLAGS", "-Copt-level=0 -Cdebug-assertions=yes")
Expand Down

0 comments on commit 60312ed

Please sign in to comment.