about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2022-07-23 19:30:15 -0400
committerRalf Jung <post@ralfj.de>2022-07-23 20:23:38 -0400
commit7267e0d4c5eb8ce2d445bb8c28104de489a2c79e (patch)
tree73bea12cd342814cae22107fd02c271660991a5a
parent25b11f6424d928b1c6876ed3d49655fc4b1f6ffc (diff)
downloadrust-7267e0d4c5eb8ce2d445bb8c28104de489a2c79e.tar.gz
rust-7267e0d4c5eb8ce2d445bb8c28104de489a2c79e.zip
attempt to test RUSTC and RUSTC_WRAPPER shenanigans on CI
-rw-r--r--cargo-miri/bin.rs1
-rwxr-xr-xci.sh13
2 files changed, 14 insertions, 0 deletions
diff --git a/cargo-miri/bin.rs b/cargo-miri/bin.rs
index 2478e331191..9cba2e772bc 100644
--- a/cargo-miri/bin.rs
+++ b/cargo-miri/bin.rs
@@ -483,6 +483,7 @@ path = "lib.rs"
     // The `MIRI_CALLED_FROM_XARGO` will mean we dispatch to `phase_setup_rustc`.
     let cargo_miri_path = std::env::current_exe().expect("current executable path invalid");
     if env::var_os("RUSTC_STAGE").is_some() {
+        assert!(env::var_os("RUSTC").is_some());
         command.env("RUSTC_REAL", &cargo_miri_path);
     } else {
         command.env("RUSTC", &cargo_miri_path);
diff --git a/ci.sh b/ci.sh
index 7bd131405bd..f93c218f1b0 100755
--- a/ci.sh
+++ b/ci.sh
@@ -38,8 +38,21 @@ function run_tests {
   else
     PYTHON=python
   fi
+  # Some environment setup that attempts to confuse the heck out of cargo-miri.
+  if [ "$HOST_TARGET" = x86_64-unknown-linux-gnu ]; then
+    # These act up on Windows (`which miri` produces a filename that does not exist?!?),
+    # so let's do this only on Linux. Also makes sure things work without these set.
+    export RUSTC=$(which rustc)
+    export MIRI=$(which miri)
+  fi
+  mkdir -p .cargo
+  echo 'build.rustc-wrapper = "thisdoesnotexist"' > .cargo/config.toml
+  # Run the actual test
   ${PYTHON} test-cargo-miri/run-test.py
   echo
+  # Clean up
+  unset RUSTC MIRI
+  rm -rf .cargo
 
   # Ensure that our benchmarks all work, on the host at least.
   if [ -z "${MIRI_TEST_TARGET+exists}" ]; then