Skip to content

Commit 7267e0d

Browse files
committed
attempt to test RUSTC and RUSTC_WRAPPER shenanigans on CI
1 parent 25b11f6 commit 7267e0d

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

cargo-miri/bin.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -483,6 +483,7 @@ path = "lib.rs"
483483
// The `MIRI_CALLED_FROM_XARGO` will mean we dispatch to `phase_setup_rustc`.
484484
let cargo_miri_path = std::env::current_exe().expect("current executable path invalid");
485485
if env::var_os("RUSTC_STAGE").is_some() {
486+
assert!(env::var_os("RUSTC").is_some());
486487
command.env("RUSTC_REAL", &cargo_miri_path);
487488
} else {
488489
command.env("RUSTC", &cargo_miri_path);

ci.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,21 @@ function run_tests {
3838
else
3939
PYTHON=python
4040
fi
41+
# Some environment setup that attempts to confuse the heck out of cargo-miri.
42+
if [ "$HOST_TARGET" = x86_64-unknown-linux-gnu ]; then
43+
# These act up on Windows (`which miri` produces a filename that does not exist?!?),
44+
# so let's do this only on Linux. Also makes sure things work without these set.
45+
export RUSTC=$(which rustc)
46+
export MIRI=$(which miri)
47+
fi
48+
mkdir -p .cargo
49+
echo 'build.rustc-wrapper = "thisdoesnotexist"' > .cargo/config.toml
50+
# Run the actual test
4151
${PYTHON} test-cargo-miri/run-test.py
4252
echo
53+
# Clean up
54+
unset RUSTC MIRI
55+
rm -rf .cargo
4356

4457
# Ensure that our benchmarks all work, on the host at least.
4558
if [ -z "${MIRI_TEST_TARGET+exists}" ]; then

0 commit comments

Comments
 (0)