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

Delayed CTFE backtraces #54487

Merged
merged 3 commits into from
Oct 28, 2018
Merged

Delayed CTFE backtraces #54487

merged 3 commits into from
Oct 28, 2018

Conversation

RalfJung
Copy link
Member

@RalfJung RalfJung commented Sep 22, 2018

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 are new.

Fixes #53355

@rust-highfive
Copy link
Collaborator

r? @petrochenkov

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 22, 2018
@petrochenkov
Copy link
Contributor

r? @oli-obk

@bors

This comment has been minimized.

@RalfJung RalfJung added the S-blocked Status: Marked as blocked ❌ on something else such as an RFC or other implementation work. label Oct 1, 2018
@TimNN TimNN removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 9, 2018
@oli-obk
Copy link
Contributor

oli-obk commented Oct 17, 2018

needs a rebase

@oli-obk oli-obk added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-blocked Status: Marked as blocked ❌ on something else such as an RFC or other implementation work. labels Oct 17, 2018
@oli-obk
Copy link
Contributor

oli-obk commented Oct 17, 2018

oh sorry, nevermind. I was sure the other PR was merged :/

@oli-obk oli-obk added S-blocked Status: Marked as blocked ❌ on something else such as an RFC or other implementation work. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Oct 17, 2018
@bors

This comment has been minimized.

…he backtrace delayed

The env var is now RUST_CTFE_BACKTRACE.  Similar to RUST_BACKTRACE, it usually
only prints a backtrace when the error actually surfaces, not when it happens.
This makes a difference when we catch errors.

As per @oli-obk's request, one can set RUST_CTFE_BACKTRACE=immediate to get the
backtrace shown immediately.
No point in making the user also enable RUST_LOG
@RalfJung
Copy link
Member Author

Rebased.

@oli-obk this is finally ready for review :)

@oli-obk
Copy link
Contributor

oli-obk commented Oct 28, 2018

@bors r+

@bors
Copy link
Contributor

bors commented Oct 28, 2018

📌 Commit 5903fdb has been approved by oli-obk

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-blocked Status: Marked as blocked ❌ on something else such as an RFC or other implementation work. labels Oct 28, 2018
@bors
Copy link
Contributor

bors commented Oct 28, 2018

⌛ Testing commit 5903fdb with merge 96064eb...

bors added a commit that referenced this pull request Oct 28, 2018
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
@bors
Copy link
Contributor

bors commented Oct 28, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: oli-obk
Pushing 96064eb to master...

@bors bors merged commit 5903fdb into rust-lang:master Oct 28, 2018
@RalfJung
Copy link
Member Author

Thanks. :) Locally, the miri test suite now passes with opt level 3!

@RalfJung RalfJung deleted the ctfe-backtrace branch November 9, 2018 15:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants