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

report compilation progress via xsbti.compile.CompileProgress #13082

Closed
unkarjedy opened this issue Jul 15, 2021 · 5 comments · Fixed by #18739
Closed

report compilation progress via xsbti.compile.CompileProgress #13082

unkarjedy opened this issue Jul 15, 2021 · 5 comments · Fixed by #18739
Assignees

Comments

@unkarjedy
Copy link
Contributor

unkarjedy commented Jul 15, 2021

Scala 2 compiler reported compilation progress via xsbti.compile.CompileProgress.
It called both startUnit and advance methods.
This interface is used in IntelliJ Scala Plugin to report compilation progress, both with text and with Compilation Charts

Unfortunately, Scala 3 doesn't use the interface at all.

from https://gitter.im/lampepfl/dotty?at=5ee79bbf7c64f31f11614996

Artyom Semyonov June 15 2020 18:55
Hi all!
I use xsbti.compile.CompileProgress.advance method to show the compilation progress in Scala.
But it seems this method isn't invoking by Dotty compiler.
How can I get the compilation progress information for Dotty?

Guillaume Martres June 15 2020 18:56
well, someone should add calls to advance in dotty

Guillaume Martres June 15 2020 19:03
hmm, CompileProgress is not part of the regular sbt callback interface but a separate thing, so this is going to require some plumbing in dotty

the entry point is https://github.com/lampepfl/dotty/blob/6ab0e6353e575cf2da4ed1c008479694a2671be3/sbt-bridge/src/xsbt/CachedCompilerImpl.java#L57
we pass the AnalysisCallback to dotty via "setSbtCallback(callback)"
so essentially we need another similar method to pass CompileProgress
and then call it when needed, we can just follow the behavior of scalac which appears to be "once per compilation unit per phase completed"

PRs welcome.

related https://youtrack.jetbrains.com/issue/SCL-18400

@unkarjedy
Copy link
Contributor Author

I will prepare a PR to report phases with startUnit method soon.

@odersky
Copy link
Contributor

odersky commented Jul 15, 2021

@unkarjedy Thanks! Assigning to you then.

unkarjedy added a commit to unkarjedy/dotty that referenced this issue Jul 15, 2021
unkarjedy added a commit to unkarjedy/dotty that referenced this issue Jul 16, 2021
@tgodzik
Copy link
Contributor

tgodzik commented Sep 22, 2023

Did you ever get anywhere @unkarjedy ? Do you need help from someone in the compiler?

@bishabosha
Copy link
Member

I will investigate the requirements, can report back by 29th

@bishabosha
Copy link
Member

bishabosha commented Oct 2, 2023

So I have been working on this, callbacks and testing in place, the only tricky part now is adding the calls to track progress

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants