-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 support for Pipelined builds #18880
Conversation
bede0a0
to
da582f7
Compare
We should probably add tests of incremental compilation with pipelining turned on, just to be sure there are no concurrency issues |
TODO: sbt will write |
We decided I should separate out the Java pickling ability as that is the only change that requires a minor release (changing TASTy Format), this will make the review much more simple to digest - then the rest of the features could come in patch releases (but I hope to still land this before 3.4.0) edit: done in #19074 |
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.
Review of everything except the pipelining commit (but including the Java pickling commit).
#19074 should be merged before this |
713b005
to
e722ae2
Compare
bd85c84
to
08460c4
Compare
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.
What is the status of this PR?
I need to rebase, which I aim to do today |
b32569e
to
ba2cc3f
Compare
I have a couple of usability bits to backport from my outlining branch (e.g. handle duplication of |
ba2cc3f
to
b087eab
Compare
b087eab
to
5ce20cb
Compare
7134df9
to
7e11005
Compare
This PR is feature complete, there is one extra enhancement which is to asynchronously write the TASTy files to the early output - should it be included here? Edit: @sjrd recommends to do that in a follow up PR. |
7e11005
to
2b48e2e
Compare
2b48e2e
to
dcb06b2
Compare
the method was never used, and not well defined, e.g. with branches to search in both tasty files and class files, which could be severely inefficient.
This caches common file extensions, while still being extensible. Also fixes many operations with unexpected behavior (manipulation of file extensions where toLowerCase behaves differently with certain locales.)
For pipelining Zinc needs to know about non-local classes early. e.g. it enables Zinc to disable pipelining if a non-local class contains macros. The changes in this commit are based of changes made originally in Zinc: sbt/zinc@856d416
dcb06b2
to
6e471d1
Compare
I will not make be making any changes to this PR unless review demands it |
- rename '-Yjava-tasty-output' to '-Yearly-tasty-output' because now Scala TASTy will also be written to this destination. - add '-Ypickle-java' alias of '-Yjava-tasty', as expected by Zinc - add '-Ypickle-write' alias of '-Yearly-tasty-output', as expected by Zinc - move ExtractAPI phase to after Pickler, this way we can do it in parallel with generating TASTy bytes. At the end of this phase we write the TASTy to the '-Yearly-tasty-output' destination. Also ensure that ExtractAPI phase runs with '-Yjava-tasty', even if no incremental callback is set (don't extract the API in this case). - test the pipelining with sbt scripted tests, including for inline methods and macros with pipelining - describe semantics with respect to suspensions, introduce -Yno-suspended-units flag for greater control by the user.
6e471d1
to
c19b67e
Compare
This includes support for a single pass pipelined build, compatible with sbt's
ThisBuild/usePipelining
,-Ypickle-java
and-Ypickle-write
flags, expected by Zinc when pipelining is enabled in sbt.-Ypickle-write <directory|jar>
is set, then write tasty from pickler to that output, (building upon First step to pipelining support - enable reading Java symbols from TASTy #19074 support for Java signatures in TASTy files).apiPhaseCompleted
anddependencyPhaseCompleted
callbacks, which will activate early downstream compilationgeneratedNonLocalClass
callbacks early, which enables Zinc to run the incremental algorithm before starting downstream compilation (including checking for macro definitions).generally this can be reviewed commit-by-commit, as they each do an isolated feature.
As well as many tests in the
sbt-test/pipelining
directory, this has also been tested locally onakka/akka-http
,apache/incubator-pekko
,lichess-org/lila
,scalacenter/scaladex
,typelevel/fs2
,typelevel/http4s
,typelevel/cats
,slick/slick
.This PR sets the ground work for an optional 2-pass compile (reusing the
OUTLINEattr
), which should use a faster frontend (skipping rhs when possible) before producing tasty signaturesfixes #19743