Commit Graph

6828 Commits

Author SHA1 Message Date
bors
5aef34c016 Auto merge of #2464 - RalfJung:atomic-must-be-mutable, r=RalfJung
Atomics must be mutable

Fixes https://github.com/rust-lang/miri/issues/2463
Needs https://github.com/rust-lang/rust/pull/100181
2022-08-09 18:00:31 +00:00
Ralf Jung
a1f5a75c80 rustup 2022-08-09 13:59:43 -04:00
Ralf Jung
43d3963672 more detailed error message 2022-08-09 13:59:34 -04:00
Ralf Jung
927ab19cfc make some operations private to the data race detector / atomic intrinsic file 2022-08-09 13:59:34 -04:00
Ralf Jung
cd2edbfd09 ensure atomics happen on mutable allocations, and fix futex test 2022-08-09 13:59:34 -04:00
Ralf Jung
d630671a33 move atomic access alginment check to helper function and inside atomic access lib 2022-08-09 13:59:34 -04:00
bors
df3c141762 Auto merge of #2477 - RalfJung:show-error, r=RalfJung
don't make it quite so easy to get Miri to panic

Panicking on incorrect `-Zmiri` flags is a bit embarrassing, so let's finally fix that.
2022-08-08 15:37:01 +00:00
Ralf Jung
b99d7bc77f avoid intermediate allocations in show_error macro 2022-08-08 11:35:54 -04:00
Ralf Jung
1164815750 make cargo-miri show_error a bit nicer to use 2022-08-08 11:32:49 -04:00
Ralf Jung
12e3f75fd4 don't make it qutie so easy to get Miri to panic 2022-08-08 11:32:31 -04:00
bors
654e15b51c Auto merge of #2471 - RalfJung:term, r=RalfJung
stop excluding TERM env var on Unix

Effectively reverts https://github.com/rust-lang/miri/pull/2018.
Needs https://github.com/rust-lang/rust/pull/100206 to not be terribly slow.
Fixes https://github.com/rust-lang/miri/issues/2292.
2022-08-08 00:38:17 +00:00
Ralf Jung
5ead47e623 rustup 2022-08-07 20:36:57 -04:00
bors
94b6aaf267 Auto merge of #2476 - RalfJung:target-dir, r=RalfJung
clarifying comments for target-dir handling

I thought we could simplify this logic, but alas, `cargo metadata --target-dir` is not a thing (even though the effective target-dir *does* affect the metadata).
2022-08-07 15:54:32 +00:00
Ralf Jung
0f1ce43502 clarifying comments for target-dir handling 2022-08-07 11:53:25 -04:00
bors
5b22aa7873 Auto merge of #2475 - RalfJung:rustc-lints, r=RalfJung
enable rustc lints

Given how many rustc APIs we are using, this is probably a good idea.
Seems like we are lint-clean right now. :)
2022-08-07 14:17:21 +00:00
Ralf Jung
b36b5e38b7 fix rustc lints in Miri 2022-08-07 10:17:02 -04:00
Ralf Jung
366d11b2d8 enable rustc lints
(but not in cargo-miri and ui_test)
2022-08-07 09:45:42 -04:00
bors
a522442521 Auto merge of #2474 - RalfJung:cargo-metadata-args, r=RalfJung
also forward --manifest-path to 'cargo metadata'

and then I went on to refactor the argument flag splitting thing a bit, and, uh, that snowballed...
2022-08-07 02:49:33 +00:00
Ralf Jung
04744a2935 fix CI benchmark checks 2022-08-06 22:47:29 -04:00
Ralf Jung
08e7d94562 avoid some string copies... 2022-08-06 21:31:40 -04:00
Ralf Jung
465538245a reuse arg flag parse logic in rustdoc handling 2022-08-06 19:42:32 -04:00
Ralf Jung
e12df0f404 also forward --manifest-path to 'cargo metadata' 2022-08-06 19:42:32 -04:00
bors
aa53f3f77f Auto merge of #2472 - RalfJung:backtrace, r=RalfJung
fix RUSTC_BACKTRACE always being set

I kept wondering why Miri programs, whenever isolation is disabled, behave as if RUSTC_BACKTRACE was set. Finally I realized it's because some early rustc setup code sets that env var, and that is then propagated to the interpreted program.

So fix that by taking a copy of the environment before any rustc setup, and use that copy as the basis for what is provided to the interpreted program.
2022-08-06 19:30:50 +00:00
Ralf Jung
141d5a6396 avoid panic/panic folder 2022-08-06 15:30:00 -04:00
Ralf Jung
d2ba40e9e1 make tests pass again 2022-08-06 15:29:43 -04:00
Ralf Jung
76d99c37c9 fix RUSTC_BACKTRACE always being set 2022-08-06 15:21:08 -04:00
bors
f0cd09814b Auto merge of #2470 - RalfJung:macos-env, r=RalfJung
support current_exe and home_dir on macOS

also fix write_os_str length logic
2022-08-06 18:38:37 +00:00
Ralf Jung
79d147edb7 make home_dir work on macOS 2022-08-06 14:38:17 -04:00
Ralf Jung
437d241412 move tests covering the env:: module into their own directory 2022-08-06 14:37:46 -04:00
Ralf Jung
f8449c2c78 stop excluding TERM env var on Unix 2022-08-06 14:31:26 -04:00
Ralf Jung
61be3bae40 support current_exe on macOS, and fix write_os_str length logic 2022-08-06 12:40:34 -04:00
bors
f633537f3e Auto merge of #2469 - RalfJung:math, r=RalfJung
implement some missing float functions

With this we support the entire float API surface of the standard library. :)

Also fixes https://github.com/rust-lang/miri/issues/2468 by using host floats to implement FMA.
2022-08-06 15:01:44 +00:00
Ralf Jung
b1316eca92 support and test some more math functions 2022-08-06 11:01:19 -04:00
Ralf Jung
5a4ac1ebf0 work around apfloat bug in FMA by using host floats instead 2022-08-06 11:01:19 -04:00
bors
d6b750e48d Auto merge of #2467 - RalfJung:home, r=RalfJung
add support for env::home_dir

and a bit of cleanup
2022-08-06 13:04:19 +00:00
Ralf Jung
889c073aa6 really, clippy?!? 2022-08-06 09:03:33 -04:00
Ralf Jung
d61e55a1d4 add support for env::home_dir
and a bit of cleanup
2022-08-06 08:29:00 -04:00
bors
42087647d6 Auto merge of #2466 - RalfJung:longsleep, r=RalfJung
fix an ICE in nanosleep()
2022-08-06 00:52:42 +00:00
Ralf Jung
d7875ea530 fix an ICE in nanosleep() 2022-08-05 20:44:54 -04:00
bors
74c5f1b468 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.
2022-08-06 00:19:08 +00:00
Ralf Jung
6d14a5e2a7 avoid strerror_r failure on unknown errnum 2022-08-05 20:18:37 -04:00
bors
1a87926a31 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
```
2022-08-03 15:56:13 +00:00
Ralf Jung
e1e1f42f39 make errno table syntactically more similar to rustc library code 2022-08-03 11:51:39 -04:00
Christian Legnitto
9154f8b22c 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
```
2022-08-03 11:23:15 -04:00
bors
730a799bf4 Auto merge of #2459 - RalfJung:cargo-miri-split, r=RalfJung
split cargo-miri into multiple files

also greatly extend the 'who calls who' comment
2022-08-03 15:02:34 +00:00
Ralf Jung
29e9a8aa1a split cargo-miri into multiple files
also greatly extend the 'who calls who' comment
2022-08-02 22:01:03 -04:00
bors
c24c638884 Auto merge of #2346 - LegNeato:mkstemp, r=RalfJung
Add `mkstemp` shim for unix
2022-08-03 01:59:38 +00:00
Christian Legnitto
b29e7b8e4e Add mkstemp shim for unix
Co-authored-by: Ralf Jung <post@ralfj.de>
2022-08-02 19:56:05 -04:00
bors
9f4612a29e Auto merge of #2457 - RalfJung:realpath, r=RalfJung
Add shim for realpath on unix

Salvaged from https://github.com/rust-lang/miri/pull/2294 by `@LegNeato`
2022-08-02 23:00:32 +00:00
bors
25df001714 Auto merge of #2458 - RalfJung:less-space, r=RalfJung
avoid double-space in test logging
2022-08-02 22:31:51 +00:00