Implements and tests build cache for ScalaCompile and ScalaDoc#1958
Implements and tests build cache for ScalaCompile and ScalaDoc#1958dbrewster wants to merge 2 commits into
Conversation
Issue: gradle#1956 Provides an implementation for ScalaCompile and ScalaDoc that makes them cacheable. Also added tests from ScalaCompile and DID NOT add tests for ScalaDoc as I didn't see tests for the Groovy or Java versions of these
|
There is one test breaking that I believe I can't do anything about 'org.gradle.AbstractCachedCompileIntegrationTest#compilation is cached if the build executed from a different directory' I think the scala compiler is detecting the different directory and rebuilding anyway. I don't know if I can change that in the current implementation. Please advise. |
|
@lptr assigned to you to prioritize with your team. |
|
Hey @dbrewster, Thanks for the PR. We're not going to get to this for the next release because we're trying to wrap up other things, but it's on our radar to review. WRT the test failure, if the Scala compiler is running, it's Gradle that decides to run it. So it's probably an issue with an absolute path being used as a We would try tracking this down by reviewing the existing inputs/annotations on the task and enabling Thanks again! We'll let you know when we're ready to merge this. |
|
Sounds good. I will track down the test failure and have this ready Is there a doc on release timelines somewhere? |
|
It's not a fixed schedule, but we try to release every 6 weeks (this is week 5). We're a bit behind right now, so I suspect the final release won't be out for 2-3 more weeks. If all goes well, I would expect the next-next release to be early July. We have our conference at the end of June, so it's likely we'll have another long release period because of it. |
|
@dbrewster release schedule is loosely defined here: https://github.com/gradle/gradle/milestones |
big-guy
left a comment
There was a problem hiding this comment.
@dbrewster I've taken a quick look at the failures. I think the fix is straightforward.
By default, the SourceTask considers absolute paths to any source files (this is just the historical default). For GroovyCompile and JavaCompile, we change that path sensitivity to NAME_ONLY: https://github.com/gradle/gradle/blob/master/subprojects/language-java/src/main/java/org/gradle/api/tasks/compile/JavaCompile.java#L84-L91
We need to do the same for AbstractScalaCompile, but we should use RELATIVE instead of NAME_ONLY. We may be able to use NAME_ONLY with the Scala compiler too, but this will be good enough until we can look at what the Scala compiler requires/guarantees WRT source file name handling.
Can you also add a Scala equivalent of GroovyCompileRelocationIntegrationTest?
We should have coverage for Groovydoc/Scaladoc, but you don't need to add that for now.
This still won't make the coming release, but I know there's a lot of interest in moving this forward, so hopefully we get can this into a nightly soon.
Thanks again!
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ |
There was a problem hiding this comment.
Can you remove this duplicate header?
There was a problem hiding this comment.
@big-guy I'm working on adding the relocation test for scala but am stuck on the zincClasspath setting for the task:
task compile(type: ScalaCompile) {
sourceCompatibility = JavaVersion.current()
targetCompatibility = JavaVersion.current()
destinationDir = file("build/classes")
source "src/main/scala"
classpath = files()
scalaClasspath = files('$classpath')
zincClasspath = ?????
}
What do I put there? I'm assuming that you intended to define a new task specific to this so you can control where and how things are getting compiled but I can't figure out how to get a legal setting for that class path.
|
@big-guy I pushed my code with a broken test due to the question above. I need help figuring out how to either set the scalaClasspath/zincClasspath or redo the build file in the test to accomplish the controls on caching. Sorry for being a noob at gradle... |
fails for me on your branch with |
|
@big-guy I don't know where we left this PR; however, I'm on vacation the next two weeks. What do we still need to do to get this merged into the next release (after 4) |
|
There are still a few issues open:
Do you know how to address these problems? It would be very valuable to us if you can provide some further insights into the questions above. |
|
@dbrewster I started working on making Scala compile Cacheable. I based my work on your branch. See #2399. I will close this PR in favor of my PR. If you have any more insights into Scala compilation or ScalaDoc, please comment on the new PR. |
Issue: #1956
Provides an implementation for ScalaCompile and ScalaDoc that makes
them cacheable.
Also added tests from ScalaCompile and DID NOT add tests for ScalaDoc
as I didn't see tests for the Groovy or Java versions of these
Context
https://groups.google.com/d/msg/gradle-dev/-2hVXXDiQEU/mIbgR0FRAgAJ
Contributor Checklist
internalpackage) or updates to > 20 files<subproject>/src/integTest) to verify changes from a user perspective<subproject>/src/test) to verify logic./gradlew quickCheck <impacted-subproject>:checkGradle Core Team Checklist
@sinceand@Incubatingannotations for all public APIs