Use `harness = false` instead of `#![feature(custom_test_frameworks)]`
Quoting from the comment in `tests/compiletest.rs`:
> Custom test runner, to avoid libtest being wrapped around compiletest which wraps libtest.
I believe `harness = false` is more suitable for that purpose.
I have verified that both `./miri test` and `LD_LIBRARY_PATH=$PWD/build/x86_64-unknown-linux-gnu/stage2/lib PATH=$PWD/build/bin:$PATH ./x.py test src/tools/miri` work well.
remove compatibility code for passing miri flags via cargo arguments
With https://github.com/rust-lang/miri/pull/1540, we deprecated `cargo miri test -- -Zmiri-disable-stacked-borrows` as a style of passing flags to Miri, introducing `MIRIFLAGS="-Zmiri-disable-stacked-borrows" cargo miri test` instead. This made `cargo miri` more compatible with `cargo`; both now behave the same in terms of argument parsing.
However, to avoid breaking things, I introduced some backwards compatibility hack such that the old way would still work. Six months later, I think it is time to remove that hack.
fix MIRI_BE_RUSTC value during sysroot build
`@hyd-dev` pointed out that `MIRI_BE_RUSTC` is set to an incorrect value during the xargo sysroot build. This fixes that.
only check timeouts when a thread yields
Currently, we check for expired timeouts after each step of execution. That seems excessive. This changes the scheduler to only check for timeouts when the active thread cannot continue running any more.
`@vakaras` does this sound right? `pthread_cond_timedwait` anyway already yields, of course, since it blocks on getting the signal (or the timeout).
Don't use `MIRI_DEFAULT_ARGS` to compile host crates
They (specifically, `--cfg=miri`) may cause procedural macros (and probably build scripts) to depend on Miri-only symbols, such as `miri_resolve_frame`.
This PR makes `miri` detect host crates inspecting the value of the `MIRI_BE_RUSTC` environment variable (`target` -> target crate, `host` -> host crate, other -> panic) and skip the insertion of `MIRI_DEFAULT_ARGS` if it's a host crate.
Fixes#1760