Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Poor error in ./miri run --dep when using a wrong -Zmiri flag #3976

Open
RalfJung opened this issue Oct 17, 2024 · 3 comments
Open

Poor error in ./miri run --dep when using a wrong -Zmiri flag #3976

RalfJung opened this issue Oct 17, 2024 · 3 comments
Labels
A-dev Area: working on Miri as a developer C-bug Category: This is a bug.

Comments

@RalfJung
Copy link
Member

RalfJung commented Oct 17, 2024

$ ./miri run tests/fail-dep/libc/socketpair-data-race.rs  -Zmiri-foo --dep
The application panicked (crashed).
Message:  called `Result::unwrap()` on an `Err` value: Errored { command: "\"/home/r/src/rust/miri/target/debug/miri\" \"--edition\" \"2021\" \"--sysroot\" \"/home/r/.cache/miri\" \"tests/fail-dep/libc/socketpair-data-race.rs\" \"-Zmiri-foo\" \"--out-dir\" \"/home/r/src/rust/miri/target/miri_ui\" \"--print=cfg\" \"--target\" \"x86_64-unknown-linux-gnu\"", errors: [], stderr: [101, 114, 114, 111, 114, 58, 32, 117, 110, 107, 110, 111, 119, 110, 32, 117, 110, 115, 116, 97, 98, 108, 101, 32, 111, 112, 116, 105, 111, 110, 58, 32, 96, 109, 105, 114, 105, 45, 102, 111, 111, 96, 10, 10], stdout: [] }
Location: tests/ui.rs:340

Showing stderr as its raw ASCII encoding isn't exactly readable. ;)

Cc @oli-obk

@RalfJung RalfJung changed the title Poor error in ./miri run --dep when using a fron -Zmiri flag Poor error in ./miri run --dep when using a wrong -Zmiri flag Nov 1, 2024
@RalfJung RalfJung added C-bug Category: This is a bug. A-dev Area: working on Miri as a developer labels Nov 1, 2024
@RalfJung
Copy link
Member Author

RalfJung commented Nov 9, 2024

This is caused by that unwrap here:

test_config.apply_custom(&mut cmd, &build_manager).unwrap();

However, as far as I can see there is no nice way to report a test_result::Errored -- the fields are private and the Debug impl produces the ugly output above. @oli-obk how is this intended to work? I can't quite figure it out...

@oli-obk
Copy link
Contributor

oli-obk commented Nov 9, 2024

I just need to fix the debug impl.

@RalfJung
Copy link
Member Author

RalfJung commented Nov 9, 2024

Ideally it can use the already existing reporting logic, would be unfortunate to have the same error reported in two different ways.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-dev Area: working on Miri as a developer C-bug Category: This is a bug.
Projects
None yet
Development

No branches or pull requests

2 participants