-
Notifications
You must be signed in to change notification settings - Fork 386
Unable to run individual binaries with cargo-miri when multiple binaries exist #1173
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
Comments
I think this is a duplicate of #739 -- could you check? Your analysis is correct, the current cargo wrapper is a pretty bad hack. We'd have to re-implement the binary (and test) selection that cargo is doing ourselves, which seems silly, so I was hoping to find some other approach for this -- but it's not been a high priority. A work-around is to use the Also note #1136, which changes the way we interact with cargo and might or might not make this easier to fix. |
Hi @RalfJung
You're right. Sorry I missed this one.
I'll give this one a go, thanks. I'll close this as a duplicate. |
Unfortunately this is a bit brittle because of limitations of the cargo-miri binary [1]. To mitigate this, we create a temp directory and rsync over the src files to compile a separate gcmalloc target with miri flags. We then copy over the tests one at a time in order to run them under Miri. [1]: rust-lang/miri#1173
Unfortunately this is a bit brittle because of limitations of the cargo-miri binary [1]. To mitigate this, we create a temp directory and rsync over the src files to compile a separate gcmalloc target with miri flags. We then copy over the tests one at a time in order to run them under Miri. [1]: rust-lang/miri#1173
Consider a cargo project with multiple binaries inside
src/bin/
:Invoking
cargo miri run
runs each binary through miri, one after the other. I'm not sure whether this is behaviour is intentional, sincecargo run
would complain about the ambiguity of which target to run.Unfortunately, however, should
a
cause miri to error, miri will exit. This meansb
is never run.What's more, specifying a single target to run via the
--bin
argument, causes miri to error:I'm assuming this is because
miri run
is really just a wrapper around a customrustc
driver which starts the miri interpreter. If this is true, how can I tell miri to only run a specified binary? And how can I ensure thatb
runs regardless of the result ofa
?Thanks for the help!
Miri Version
The text was updated successfully, but these errors were encountered: