attempt to test RUSTC and RUSTC_WRAPPER shenanigans on CI

This commit is contained in:
Ralf Jung 2022-07-23 19:30:15 -04:00
parent 25b11f6424
commit 7267e0d4c5
2 changed files with 14 additions and 0 deletions

View File

@ -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);

13
ci.sh
View File

@ -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