-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Add RUSTC_PROGRESS env var to show the current queries and their arguments #113888
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @bjorn3 (or someone else) soon. Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (
|
These commits modify the If this was unintentional then you should revert the changes before this PR is merged. |
This comment has been minimized.
This comment has been minimized.
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
⌛ Trying commit 8f467472de80fdebc0f2cc982ee4a15c8e0498dd with merge 25870bf3850ad5c029b807587de948c07a16612c... |
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (25870bf3850ad5c029b807587de948c07a16612c): comparison URL. Overall result: ❌ regressions - ACTION NEEDEDBenchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf. Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @bors rollup=never Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 648.618s -> 666.964s (2.83%) |
@rustbot author The regressions will need to be fixed first. I do like the overall idea, but maybe it should be limited to queries that don't finish instantly and have some debouncing and a depth limit to prevent scrolling (which presumably messes up rendering). Also for queries that iterate over items maybe it could be an actual progress bar rather than a spinner. |
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
⌛ Trying commit 39e340c85fd764c56e287febf4f4e044e6fb92dc with merge bbcb061f5a43bcae315f546c35dd15c7f6db9b02... |
I am fixing this upstream: console-rs/indicatif#563
yea, I'm working on this now.
IMO what we should do is allow any part of rustc to add such progress bars, and have them automatically appear in the right spot (below the query that does the iteration, and above the queries that are called during the iteration) |
The try build seems to leave some artifacts behind:
|
yea, this is fixed in the latest version (not using the |
@rustbot ready |
This comment has been minimized.
This comment has been minimized.
Great! Currently building it locally to play around with it a bit. Just a random thought I came up with: Could this reuse the self-profile infrastructure? So every time a start self-profile event is emitted a spinner is added and every time an end event is emitted a spinner is removed. Or is there a mismatch between the semantics of self-profile and this progress thing? |
@@ -1506,6 +1511,8 @@ pub fn build_session( | |||
let asm_arch = | |||
if target_cfg.allow_asm { InlineAsmArch::from_str(&target_cfg.arch).ok() } else { None }; | |||
|
|||
let progress_bars = std::env::var_os("RUSTC_PROGRESS").map(|_| Session::init_progress_bars()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe check if the value is not 0
to allow disabling it using RUSTC_PROGRESS=0
?
Tried it on cranelift-codegen and almost all of the time it only shows |
probably because it finishes in under 100ms 😆 so it never gets rendered |
I never tested it with cargo. There may be collisions with cargo's own output |
It doesn't seem to show up at all with cargo, so I had to manually run the command that cargo would run. It also seems to have some issues when diagnostics get printed. |
Maybe a snapshot of the current queries every 100ms would be more useful? Or showing repeated invocations of the same query if they add up to more than 100ms (so eg the typeck query will show up even if every every individual function gets typechecked in 99ms) |
yes, I'm refactoring some stuff to get rid of the issue around diagnostics and other rustc output: #114054 |
that's what happens
That's a different territory that I want to do later. Basically accumulate |
Why does it not show any queries besides |
👍 |
Ah I missed something here. You should not really see anything for hello world, as it's too fast. Longer builds should show a nice stack where stuff spins. If the spinner isn't running at all, something is very wrong. I am seeing it work locally for a test with a long running const evaluation. Maybe your build is really fast in rustc and just takes a long time in codegen? |
According to |
☔ The latest upstream changes (presumably #114565) made this pull request unmergeable. Please resolve the merge conflicts. |
Switching to waiting on author for a rebase and (I think) to address Qs in the latest comments. Feel free to request a review with @rustbot author |
Third-party dependency whitelist may have been modified! You must ensure that any new dependencies have compatible licenses before merging. |
Licenses of all these dependencies seem good to me. |
☔ The latest upstream changes (presumably #120454) made this pull request unmergeable. Please resolve the merge conflicts. |
I haven't found the motivation to work on this in 6 months, gonna accept I won't be finding it again any time soon |
This should make debugging hangs much simpler, as you know in which query it's happening.
If compilation progresses, but slowly, this can also be used to actually follow that progress. Most of the time it's too fast and the displayed progress spinners disappear and get replaced by new ones.
The spinners look like the ones from the first example in https://crates.io/crates/indicatif
r? @bjorn3
cc @cjgillot