Conversation
|
The Miri subtree was changed cc @rust-lang/miri |
|
This is kind-of a nit, but the naming of the flag implies to me that we generate a binary that calls back |
This comment has been minimized.
This comment has been minimized.
I like those names. I don't have much of a preference which of the two to use. |
| } | ||
| } | ||
| config.program.args.push("-Zui-testing".into()); | ||
| config.program.args.push("-Zjit-mode".into()); |
There was a problem hiding this comment.
The code for ./miri run in miri-script/src/commands.rs likely also needs to set this new flag.
|
This seems MCP-worthy. Also, how do you imagine this to work from cargo? Cargo currently treats output from rustc and the program very different: rustc produces JSON output that is fully consumed by cargo, cached, and then rendered to the terminal. The program just gets direct access to the terminal. |
Cargo currently does forward all lines output on stdout which don't start with a |
I assume you mean That said, last time I checked (which was many years ago), it did so in a buffered way, making it unsuitable for Miri (we need to be able to emit partial lines). Also, it's not acceptable for output from the program Miri interprets to be swallowed just because it looks like JSON. |
This comment has been minimized.
This comment has been minimized.
This flag tells the codegen backend to immediately execute the code it builds. This is exactly what miri needs as it is unable to produce real executables. Adding a builtin flag would allow cargo to add native support for this without miri needing to do a bunch of hacks in its cargo wrapper. Furthermore cg_clif also has a jit mode that benefits from it.
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
If cargo gets native support for -Zjit-mode, this should allow simplifying cargo-miri a fair bit.
|
The job Click to see the possible cause of the failure (guessed by this bot) |
| cmd.args(args); | ||
| } | ||
|
|
||
| cmd.arg("-Zjit-mode"); |
There was a problem hiding this comment.
If this is something Miri will always want to set, cargo-miri is not a great place as it does not cover ./miri run and ./miri test.
The usual way we add flags we always want is here; does that not work?
This flag tells the codegen backend to immediately execute the code it builds. This is exactly what miri needs as it is unable to produce real executables. Adding a builtin flag would allow cargo to add native support for this without miri needing to do a bunch of hacks in its cargo wrapper. Furthermore cg_clif also has a jit mode that benefits from it.