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

Indicate compilation progress in a form useful to end users #22227

Closed
mahkoh opened this issue Feb 12, 2015 · 11 comments
Closed

Indicate compilation progress in a form useful to end users #22227

mahkoh opened this issue Feb 12, 2015 · 11 comments
Labels
A-frontend Area: Compiler frontend (errors, parsing and HIR) E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

Comments

@mahkoh
Copy link
Contributor

mahkoh commented Feb 12, 2015

See https://github.com/mahkoh/rest_easy. This is an essential plugin that limits the pain caused by compile times.

For 1.0.

@nagisa
Copy link
Member

nagisa commented Feb 12, 2015

Ehh, this only relevant to very big monolithic crates, no?

@mahkoh
Copy link
Contributor Author

mahkoh commented Feb 12, 2015

I have a 3000 lines crate that takes 37 seconds to compile with trans starting after 10 seconds.

@mahkoh
Copy link
Contributor Author

mahkoh commented Feb 12, 2015

Note: Without optimization.

@kmcallister kmcallister added A-frontend Area: Compiler frontend (errors, parsing and HIR) E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. labels Feb 13, 2015
@kmcallister
Copy link
Contributor

Seems fine as an unstable UI flag like -Z time-passes. You could even do a user-level summary of time-passes, with a few phases e.g. parsing, expansion, resolve, checking, trans, opt, codegen, linking.

I would not count on anything like this getting into stable Rust 1.0.0. I don't think we should stabilize stuff like this until we have a more cohesive story for UI configuration (see #21406).

@sanxiyn
Copy link
Member

sanxiyn commented Feb 13, 2015

I think we should have --progress option. This could show phases, and for long phases like type checking, this could even show the name of the function being checked.

@kmcallister
Copy link
Contributor

+1. We can use control codes to update parts of the terminal without spewing output.

I will think about how to integrate this with --color and the drawing characters.

@kmcallister kmcallister changed the title Add something like rest_easy to rustc & cargo Indicate compilation progress in a form useful to end users Feb 13, 2015
@kmcallister
Copy link
Contributor

I'm imagining that rustc in whiz-bang fancy terminal mode would display progress on a single line, updated at each stage:

[/] Parsing
[-] Expanding macros
[\] Resolving names
[|] Checking types
[/] Checking lifetimes
[-] Checking
[+] All checks passed; generating LLVM
[+] All checks passed; optimizing
[+] All checks passed; generating machine code
[+] All checks passed; linking
[+] Compilation successful (in 0m 18s)
your-prompt$

And just that last "success" message will remain in your terminal buffer.

The spinner has a constant speed in wall-clock terms. Long-running parts of rustc will call sess.update_spinner() now and then to keep it going.

After we pass the "rest easy" point, the spinner turns into a calming + and the first part of the message turns green.

@kmcallister
Copy link
Contributor

For some phases it would be possible to do actual progress bars, but I don't think the results would be very satisfying.

I'd rather have Cargo or another tool generate a whole-project progress bar based on empirical measurements of how long crates took to build last time.

@mahkoh mahkoh closed this as completed Apr 11, 2015
@kmcallister kmcallister reopened this Apr 11, 2015
@kmcallister
Copy link
Contributor

Fuck you @mahkoh, I put in the effort to turn your shitty ticket into a real, good idea, and now you are closing it out of pure spite.

@mahkoh
Copy link
Contributor Author

mahkoh commented Apr 11, 2015

Yep, it took me one year to realize how shitty this whole project is. Imagine that effort!

@mahkoh mahkoh closed this as completed Apr 11, 2015
@kmcallister kmcallister reopened this Apr 11, 2015
@kmcallister
Copy link
Contributor

Closing this in favor of #24335. Thanks for the pointless make-work.

@rust-lang rust-lang locked and limited conversation to collaborators Apr 11, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-frontend Area: Compiler frontend (errors, parsing and HIR) E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
Projects
None yet
Development

No branches or pull requests

4 participants