Slackbot
02/03/2023, 6:48 AMAnze Sodja
02/03/2023, 10:30 AM--debug logs. And from that create a reproducer.
For example we had a fix in 7.6 that if class was referenced as type parameter in methods/fields/class declarations, e.g.:
class A implements Super<SomeClass>
and you deleted SomeClass , then there was no error (at least in 7.5). So if you class is referenced as type parameter 7.5 wont’ do anything, while 7.6 will recompile A.Denis Buzmakov
02/03/2023, 11:09 AMInput property 'classpath' file /modulebuild/tmp/kotlin-classes/debug/com/example/SomeKtClass.class has changed.
and then I see invocation to compiler. After that - the list of recompiled classes and seems like just the whole module was recompiled.
Also I see this line before compiling java classes:
2023-02-02T20:54:20.967+0800 [INFO] [org.gradle.api.internal.tasks.compile.incremental.recomp.CurrentCompilationAccess] Created classpath snapshot for incremental compilation in 0.088 secs.
2023-02-02T20:54:20.997+0800 [DEBUG] [org.gradle.internal.file.impl.DefaultDeleter] Deleting /Users/user/project/module/build/tmp/compileDebugJavaWithJavac/compileTransaction/stash-dir
Does it mean something or I should ignore it?Anze Sodja
02/03/2023, 11:45 AMAnze Sodja
02/03/2023, 11:46 AMDenis Buzmakov
02/03/2023, 11:46 AMDenis Buzmakov
02/03/2023, 11:48 AMDenis Buzmakov
02/03/2023, 11:49 AMAnze Sodja
02/03/2023, 11:52 AM./gradlew install -Pgradle_installPath=<path where to install>
and then you can run it with:
<path where to install>/bin/gradleAnze Sodja
02/03/2023, 11:54 AMDenis Buzmakov
02/03/2023, 1:09 PMincrementalAfterFailure is also not helping me.Anze Sodja
02/03/2023, 1:48 PMDenis Buzmakov
02/03/2023, 2:19 PMTestClass.kt (the file that I'm changing) -> TestClassFactory.kt (creates TestClass) -> ApplicationComponent.java - big interface that have references to huge amount of classes across the project.
This cycle: https://github.com/gradle/gradle/blob/master/subprojects/language-java/src/main/java/org/gradle/api/internal/tasks/compile/incremental/deps/ClassSetAnalysis.java#L119 collects not only those three classes, but also all the classes that exists in ApplicationComponent and so one. The final amount of classes is 2192, just like in logs.
To confirm that I removed reference on TestClassFactory from ApplicationComponent
and then java compilation does nothing, as with 7.5 version.
And seems like it was introduced by this change: https://github.com/gradle/gradle/commit/aa3807e513490867e6f2859ad2423a415513b74f.
Now I'm going to check how does it work on 7.5 version.Anze Sodja
02/03/2023, 3:03 PMAnze Sodja
02/03/2023, 3:05 PMAnze Sodja
02/06/2023, 11:06 AMDenis Buzmakov
02/07/2023, 9:54 AMClassSetAnalysisData.getChangedClassesSince in this line: https://github.com/gradle/gradle/blob/master/subprojects/language-java/src/main/ja[…]ternal/tasks/compile/incremental/deps/ClassSetAnalysisData.java in other.classHashes in Gradle 7.5 changes class is not present and then it decided that nothing has changed and that's all. But in Gradle 7.6 changed class is present and then, as I said before, gradle recompiles a lot of classes.
I'm still don't know well how does it work and why, so I will try to dig deeper and I will definitely write here if I will find out something new.Denis Buzmakov
03/06/2023, 1:18 PMIncremental compilation of 1 classes completed
But on 7.6 version I got this:
Incremental compilation of 11 classes completed
As I can understand, it's correct behavior.
I have removed all Optional usings in Component class, but for now I still have the diff of recompiled classes with the same change: 347 vs ~2200. I will also try to find any other cause, but it will be harder 😞. But maybe it doesn't make sense anymore because other classes have also recompiled in the same way and it's correct behavior for now.Anze Sodja
03/06/2023, 3:17 PMApplicationComponent {
Optional<T> getComponent(Class<T> clazz)
}Anze Sodja
03/06/2023, 3:23 PMDenis Buzmakov
03/07/2023, 5:55 AMDenis Buzmakov
03/07/2023, 6:22 AMAnze Sodja
03/07/2023, 2:12 PM