about summary refs log tree commit diff
diff options
context:
space:
mode:
authorNilstrieb <48135649+Nilstrieb@users.noreply.github.com>2023-11-21 09:06:28 +0100
committerGitHub <noreply@github.com>2023-11-21 09:06:28 +0100
commit187d44bfe3930b466bc98bde041220bc0afefbb7 (patch)
tree093f3ed57ecdef25812d49d37b7223fd2a3fcc83
parent6bb671e7e8981954a5ad87fbd917e2a05b3e4060 (diff)
parent251e75ced6d2f5464d1ec87a52cf01e69dc93b3a (diff)
downloadrust-187d44bfe3930b466bc98bde041220bc0afefbb7.tar.gz
rust-187d44bfe3930b466bc98bde041220bc0afefbb7.zip
Rollup merge of #118059 - Nilstrieb:unset-cargo, r=dtolnay
Explicitly unset $CARGO for compiletest

Some UI tests trigger behavior in rustc where it reads $CARGO and changes behavior if it exists. To make the tests work that rely on it not being set, make sure it is not set.

By default, this is not set, but people may do weird hacks that cause it to be set.

closes #118058
-rw-r--r--src/bootstrap/src/core/build_steps/test.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/bootstrap/src/core/build_steps/test.rs b/src/bootstrap/src/core/build_steps/test.rs
index 254fbc72a8c..8d4c58345f7 100644
--- a/src/bootstrap/src/core/build_steps/test.rs
+++ b/src/bootstrap/src/core/build_steps/test.rs
@@ -1932,6 +1932,11 @@ NOTE: if you're sure you want to do this, please open an issue as to why. In the
                 }
             }
         }
+
+        // Some UI tests trigger behavior in rustc where it reads $CARGO and changes behavior if it exists.
+        // To make the tests work that rely on it not being set, make sure it is not set.
+        cmd.env_remove("CARGO");
+
         cmd.env("RUSTC_BOOTSTRAP", "1");
         // Override the rustc version used in symbol hashes to reduce the amount of normalization
         // needed when diffing test output.