-
Notifications
You must be signed in to change notification settings - Fork 32
Set compiler phase runsBefore
to tailcalls
#191
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
Conversation
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.
Not intimately familiar with the compiler phases, but this looks good and the patch diffs suggest nothing of value was lost.
Can't test right now as it seems publishLocal
no longer works and publishLocalSigned
doesn't produce ivy metadata (filed #193)
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.
Testing with Akka, this seems to introduce could not optimize @tailrec annotated method
compiler errors when running sbt -Dakka.genjavadoc.enabled=true unidoc
.
Interesting... I can take a look. Which branch of akka did you use? |
I checked with Akka master (bc590af56f39cff358d7a67d28f01e98f05741a8). I did a |
The problem is that adding the javadoc plugin shuffles around the compiler's own phases... Without the plugin:
With the plugin,
We really have to clean up the phases list in the compiler, the ordering should not be left to the algorithm. Currently we have
that's why So this PR works for 2.12.10 (tested locally) and 2.13.1 (tested in community build). These two versions include the changes to the phase assembly algorithm that causes breakages without this PR. So it seems we really need to have two versions here, one for 2.10, 2.11, 2.12.0-2.12.9, 2.13.0, and the other one for 2.12.10+, 2.13.1+. |
explicitouter and specialize both were defining val runsRightAfter = Some("tailcalls") So it was up to the algorithm to define the phase ordering. This can cause subtle issues, as seen in lightbend/genjavadoc#191.
explicitouter and specialize both were defining val runsRightAfter = Some("tailcalls") So it was up to the algorithm to define the phase ordering. This can cause subtle issues, as seen in lightbend/genjavadoc#191.
797c1d4
to
3bf4533
Compare
`runsAfter` is set to `fields`. However, in reality the phase assembly algorithm used in 2.12.8 and before, also 2.13.0, places the `GenJavadoc` phase right after `specialize`, which is valid, but probably not intended. With some changes in the phase assembly algorithm in 2.13.1, the `GenJavadoc` phase was now placed right after `fields`, which caused tests to fail.
3bf4533
to
aa2e3e3
Compare
aa2e3e3
to
a782143
Compare
@raboof please take another look? And if you have time, it would be great to try if it works with akka, with both 2.12.9 and 2.12.10, maybe also 2.13.0 and 2.13.1-bin-3987e83 from https://scala-ci.typesafe.com/artifactory/scala-integration, this is our 2.13.1 RC. |
The community build for 2.13.1-bin-3987e83 is also running (https://scala-ci.typesafe.com/job/scala-2.13.x-integrate-community-build/2610) and testing the latest revision of this PR (a782143). |
Seemed to work for Akka with 2.12.9 and 2.13.0, so let's merge |
Thank you! |
runsAfter
is set tofields
. However, in reality the phaseassembly algorithm used in 2.12.9 and before, also 2.13.0, places the
GenJavadoc
phase right afterspecialize
, which is valid, but probablynot intended.
With some changes in the phase assembly algorithm in 2.13.1, the
GenJavadoc
phase was now placed right afterfields
, which causedtests to fail.