Incremental compilation after failure issues when all classes are not removed #21644
Labels
a:feature
A new functionality
in:java-plugins
java-library, java, java-base, java-platform, java-test-fixtures
Milestone
We got some reports from GE and also internally that after added incremental compilation after failure feature there are issues with Groovy incremental compilation. It would be good if we add an option to opt-out of this feature just in case. Or maybe even to opt-in for Groovy.
The report was, that when a super class is changed, then sometimes exception like is thrown:
Note: original class name is censored since this is not public repo. Check a build scan https://e.grdev.net/s/omiun4on2i5jy to see the actual class name.
After some investigation we figured, that output directory contains wrong classes. It should contain these:
But it contained these:
We suspect, that we don't clean all
.class
files that will be produced by theAppTest.groovy
file before compilation. And since we don't delete some classes Groovy has them at compile time on the classpath, and that is why it creates new extraspock_feature_5_5
classes.While I wasn't able to reproduce the original issue, I was able to reproduce that we don't clean all the classes for
AppTest.groovy
.A simpler test case that shows that we don't clean all classes is:
If/when we change A, classes B and C will be recompiled since we will pass B.java to a compiler (B.class is a dependency of A.class, so we pass B.java to the compiler). But we won't delete origin C.class. So C.class will be on the classpath at the compile time.
The text was updated successfully, but these errors were encountered: