Skip to content

Commit d12928a

Browse files
committed
Auto merge of #125426 - jieyouxu:rmake-support-env-reset, r=<try>
Update `compiler-builtins` test to not clear essential env vars Noticed in #122580 (comment), the `compiler-builtins` test failed on Windows for a `cargo` invocation because necessary env vars `TMP` and `TEMP` were cleared by `Command::env_clear`, causing temp dir eventually used by codegen to fallback to the Windows directory, which will trigger permission errors. This PR adds a `clear_non_essential_env_vars` helper, which is a more conservative `Command::env_clear` that does not clear `TMP` or `TEMP` on Windows, and does not clear `TMPDIR` on non-Windows platforms. cc `@ChrisDenton` do you happen to know if there are any more "essential" env vars that we should not clear (on Windows or other platforms)? r? `@saethlin` (feel free to reroll, since you authored the test) try-job: x86_64-msvc try-job: test-various
2 parents 90d6255 + f31f59e commit d12928a

File tree

1 file changed

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

1 file changed

+2
-1
lines changed

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

+2-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ fn main() {
5656
"--target",
5757
&target,
5858
])
59-
.env_clear()
59+
// FIXME(jieyouxu): so what happens if we don't `env_clear`?
60+
//.env_clear()
6061
.env("PATH", path)
6162
.env("RUSTC", rustc)
6263
.env("RUSTFLAGS", "-Copt-level=0 -Cdebug-assertions=yes")

0 commit comments

Comments
 (0)