-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Setting MIRI_BACKTRACE should not affect CTFE #53355
Comments
That seems very hard to differentiate. And I sometimes did actually need the Since you probably just don't want all the noise from CTFE while running miri, you can |
How so? I imagined moving the decision about whether to backtrace into the machine trait. miri would base it in |
the backtrace is generated in the rust/src/librustc/mir/interpret/error.rs Lines 124 to 126 in 81cfaad
|
Oh, dang...
So what would the UI be? We change librustc to look for CTFE_BACKTRACE, and then miri wil check for MIRI_BACKTRACE and set CTFE_BACKTRACE before execution starts? |
yea, that seems a good solution. |
We also need to fix the way backtraces are printed... they should not be printed immediately when the error is converted, but only later when the error is shown to the user. We do still create errors that we never act on, and finding the right backtrace is pretty hard ATM. |
We used to do that. I changed it to the current system when I got rid of the old CTFE error enum. we can probably add an optional field to the EvalError type which stores the backtrace as long as it's not compared, hashed,. .. or interacts with any traits implemented for the type |
Okay... yeah I think we have to change it. Right now, for my debugging, MIRI_BACKTRACE is useless; all it does is produce several thousand lines of backtraces. |
I think I'd like the same for Of course, in a query-based compiler, I don't even know what that means... |
I am working on that (PR is blocked by #53821 (comment)) |
Delayed CTFE backtraces This renames the env var that controls CTFE backtraces from `MIRI_BACKTRACE` to `RUST_CTFE_BACKTRACE` so that we can use `MIRI_BACKTRACE` in the miri tool to only show backtraces of the main miri execution. It also makes `RUST_CTFE_BACKTRACE` only show backtraces that actually get rendered as errors, instead of showing them eagerly when the `Err` happens. The current behavior is near useless in miri because it shows about one gazillion backtraces for errors that we later catch and do not care about. However, @oli-obk likes the current behavior for rustc CTFE work so it is still available via `RUST_CTFE_BACKTRACE=immediate`. NOTE: This is based on top of #53821. Only [the last three commits](oli-obk/rust@sanity_query...RalfJung:ctfe-backtrace) are new. Fixes #53355
MIRI_BACKTRACE should configure miri, but should not have an effect on CTFE that's part of normal rustc operation.
Cc @oli-obk
The text was updated successfully, but these errors were encountered: