bors [Sat, 6 Aug 2022 00:19:08 +0000 (00:19 +0000)]
Auto merge of #2465 - RalfJung:strerror_r, r=RalfJung
avoid strerror_r failure on unknown errnum
This is an informative function anyway, so as fallback just return a string with the raw errnum. Avoids panics / interpreter aborts in std on unknown errnum in from_raw_os_error.
bors [Wed, 3 Aug 2022 15:56:13 +0000 (15:56 +0000)]
Auto merge of #2460 - LegNeato:sysconf, r=RalfJung
Add additional raw error mappings for the nightly `io_error_more` feature
Some crates are using nightly and failing when mapping these errors,
for example <https://miri.saethlin.dev/?crate=remove_dir_all&version=0.7.0>:
```
error: unsupported operation: io error NotADirectory cannot be translated into a raw os error
--> /root/.rustup/toolchains/miri/lib/rustlib/src/rust/library/std/src/sys/unix/fs.rs:1203:19
```
Add additional raw error mappings for the nightly `io_error_more` feature
Some crates are using nightly and failing when mapping these errors,
for example <https://miri.saethlin.dev/?crate=remove_dir_all&version=0.7.0>:
```
error: unsupported operation: io error NotADirectory cannot be translated into a raw os error
--> /root/.rustup/toolchains/miri/lib/rustlib/src/rust/library/std/src/sys/unix/fs.rs:1203:19
```
Auto merge of #2450 - avrong:cargo-metadata, r=oli-obk
Use cargo_metadata in cargo-miri
Closes #2393
Added `cargo_metadata` to `cargo-miri` and changed metadata from manual parsing to `cargo_metadata` invocations. Thus, removed local `Metadata` struct too.
Ben Kimock [Sat, 23 Jul 2022 17:59:08 +0000 (13:59 -0400)]
Use real exec on cfg(unix) targets
When cargo-miri is executed as a cargo test runner or rustdoc runtool,
external tools expect what they launch as the runner/runtool to be the
process actually running the test. But in the implementation, we launch
the Miri interpreter as a subprocess using std::process::Command. This
tends to confuse other tools (like nextest) and users (like the author).
What we really want is to call POSIX exec so that the cargo-miri process
becomes the interpreter.
So this implements just that; we call execve via a cfg(unix) extension
trait. Windows has no such mechanism, but it also doesn't have POSIX
signals, which is the primary tripping hazard this change fixes.
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)