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

Miri does not support target x86_64-unknown-uefi #2740

Closed
jyn514 opened this issue Dec 27, 2022 · 6 comments · Fixed by #2741
Closed

Miri does not support target x86_64-unknown-uefi #2740

jyn514 opened this issue Dec 27, 2022 · 6 comments · Fixed by #2741

Comments

@jyn514
Copy link
Member

jyn514 commented Dec 27, 2022

I am not quite sure what's going on here, but @oli-obk thinks it's a bug in miri itself, unrelated to cargo or the standard library.

$ env MIRI_NO_STD=1 cargo miri test --target=x86_64-unknown-uefi
fatal error: file "/home/jyn/.local/lib/cargo/target/miri/x86_64-unknown-uefi/debug/deps/example-d7b0fa77a56c0a56.efi" not found or `cargo-miri` invoked incorrectly; please only invoke this binary through `cargo miri`
error: test failed, to rerun pass `--lib`

Caused by:
  process didn't exit successfully: `/home/jyn/.local/lib/rustup/toolchains/nightly-x86_64-unknown-linux-gnu/bin/cargo-miri runner /home/jyn/.local/lib/cargo/target/miri/x86_64-unknown-uefi/debug/deps/example-d7b0fa77a56c0a56.efi --quiet` (exit status: 1)
@jyn514
Copy link
Member Author

jyn514 commented Dec 27, 2022

@bjorn3
Copy link
Member

bjorn3 commented Dec 27, 2022

This will need to be extended to include elf I think:

// For Windows and WASM, do the same thing again with `.exe`/`.wasm` appended to the filename.
// (Need to do this here as cargo moves that "binary" to a different place before running it.)
info.store(&out_filename("", ".exe"));
info.store(&out_filename("", ".wasm"));

@RalfJung
Copy link
Member

Yeah Miri simply does not support this target currently.

Is there a way cargo-miri can figure out the binary file name extension for a target, without us having to maintain a list of all of them?

@RalfJung RalfJung changed the title Miri fails to generate files that end in .efi Miri does not support target x86_64-unknown-uefi Dec 27, 2022
@jyn514
Copy link
Member Author

jyn514 commented Dec 27, 2022

I am confused why miri needs to know the extension in the first place? Does cargo not pass the output file name to you?

@bjorn3
Copy link
Member

bjorn3 commented Dec 27, 2022

Is there a way cargo-miri can figure out the binary file name extension for a target, without us having to maintain a list of all of them?

echo | rustc --print file-names --crate-type bin --target ... --crate-name ____ - is what cargo uses.

@RalfJung
Copy link
Member

Does cargo not pass the output file name to you?

Nope.

echo | rustc --print file-names --crate-type bin --target ... --crate-name ____ - is what cargo uses.

Ah, that should work for Miri as well then.

@bors bors closed this as completed in 9f316ae Dec 27, 2022
RalfJung pushed a commit to RalfJung/rust that referenced this issue Dec 28, 2022
cargo-miri: use rustc to determine the output filename

This should fix rust-lang/miri#2740 and fix rust-lang/miri#1867: we no longer need to hard-code the file name logic in cargo-miri.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants