Auto merge of #2436 - RalfJung:lib-crates, r=oli-obk
fix build.rs invoking RUSTC to do check builds
This makes the Miri driver, when invokved via the RUSTC env var from inside a build script, behave almost entirely like rustc. I had to redo how we propagate sysroot information for this (which is actually back to how we used to do sysroot propagation many years ago).
make miri a better RUSTC by default inside cargo-miri
this requires a change in sysroot handling: miri driver now requires
MIRI_SYSROOT to be set when it is in 'target' mode, rather than relying on
`--sysroot` always being present.
Auto merge of #2428 - RalfJung:cargo-miri-runner, r=RalfJung
cargo-miri: use '--config target.runner' rather than the TARGET_RUNNER env vars
That means we can properly escape spaces in our filename. This should fix https://github.com/rust-lang/miri/issues/2417, hopefully for real this time. We can also specify a "leading command" which makes it much easier to disambiguate runner invocations from rustdoc invocations!
Auto merge of #2425 - RalfJung:hide-xargo, r=RalfJung
don't dump xargo output onto users of 'cargo miri test'
The xargo invocation prints a lot of details users probably won't care about, so let's hide them (unless the user did `cargo miri setup`, then we still print everything).
Auto merge of #2424 - RalfJung:weak-memory-debug, r=RalfJung
add a flag to print a diagnostic when an outdated value is returned from an atomic load
Helps with https://github.com/rust-lang/miri/issues/2313. It can still be annoying to figure out *which* outdated load is the important one in case there are many of them (and the issue contains some ideas for how to help with that situation), but having this flag is better than nothing.
Auto merge of #2415 - RalfJung:cargo-miri, r=oli-obk
support MIRI_HOST_SYSROOT env var for stage 0 builds
Together with a [patch on the rustc side](https://github.com/rust-lang/rust/pull/99599), this makes `./x.py test src/tools/miri --stage 0` work again. :)
Auto merge of #2035 - RalfJung:small-bitmask, r=RalfJung
portable-simd: test bitmasks smaller than a byte
Blocked on https://github.com/rust-lang/portable-simd/pull/267 propagating to the [rustc repo](https://github.com/rust-lang/rust/tree/master/library/portable-simd)
remove rand (large dependency) and page-size (testing the dependency, not cargo-miri).
keep only byteorder as a "demo" dependency, it is a leaf and builds quickly.
Auto merge of #2398 - sunshowers:nextest-compat, r=RalfJung
[cargo-miri] support nextest
Add the ability to run `cargo miri nextest list` and `cargo miri nextest run`.
[cargo-nextest](https://nexte.st) is a new test runner for Rust maintained mostly by myself. It has several new features, but the most relevant to miri is the fact that it runs [each test in its own process](https://nexte.st/book/how-it-works.html#the-nextest-model). This gives miri users better leak detection (https://github.com/rust-lang/miri/issues/1481) for free, for example.
See https://github.com/nextest-rs/nextest/issues/181 for discussion, including comments by `@eddyb` and `@RalfJung.`
Future work might be to have miri read [the list of tests](https://docs.rs/nextest-metadata/latest/nextest_metadata/struct.TestListSummary.html) (or [test binaries](https://docs.rs/nextest-metadata/latest/nextest_metadata/struct.BinaryListSummary.html)) generated by `nextest list`. `@eddyb` thinks that might be useful.
I tested `cargo miri nextest run` against smallvec, and it worked great.
Note: Running tests out of archives is currently broken, as the comment in run-test.py explains.
Also handle get_alloc_extra the same throughout Stacked Borrows. I don't think this `unwrap` can actually cause an ICE since another part of SB will raise an error before, but still, seems strange to do this inconsistently in retagging vs expose_ptr.
Auto merge of #2373 - rust-lang:test_dependencies, r=RalfJung
Allow ui tests to have dependencies in a reliable way
This completely sidesteps the issue that compiletest-rs has where old artifacts of a dependency cause `multiple available crates of name XXX` errors. At this point I think we've reached feature parity for clippy, too, so I'm going to try publishing a version once this is merged.
Currently we skip this if a stderr diff was printed, but the stderr diff is normalized, so e.g. one cannot learn line numbers from it.
Is there a way to get the diff to only print the parts the differ, like a usual `diff -u`? Currently it always seems to print the full output, so with a long stderr we now get doubly long test results even if the diff is actually rather small.