-
Notifications
You must be signed in to change notification settings - Fork 2k
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
[KSP] Incremental symbol processing not working (or working poorly) #4549
Comments
Hmm, yes, it should support incremental processing. In KSP the incremantal processing is determined by the mode of each output (isolating/aggregating). For the LazyClassKey proguard files, this is setup here. If you're seeing an issue specifically with the We're a little back logged right now, so if you could provide a minimal repro example that could help get this rolling. |
Actually, nm. @Chang-Eric pointed out that we were forgetting the originating element for the resource file (https://github.com/google/dagger/blob/dagger-2.54/java/dagger/internal/codegen/processingstep/LazyClassKeyProcessingStep.java#L114). I'll send out a fix for that soon. |
* Fixes the name of the proguard file to contain an underscore between the package and simple names (e.g. `test.FooModule` was `testFooModule_LazyClassKeys.pro` and is now `test_FooModule_LazyClassKeys.pro`). * Fixes incremental processing by adding the originating element to the `writeResource` call (#4549). * Fixes bug where `StringBuilder` was declared outside module for-loop, which could lead to duplicate entries across proguard rules for different modules. * Fixed `ClassName#toString()` usage to `ClassName#canonicalName()`, since `toString()` is ambiguous and will silently break things when we migrate to `XClassName`. * Added test coverage for the proguard file name and contents. Fixes #4549 RELNOTES=Fixes #4549: Fixes incremental processing for LazyClassKey proguard files by adding the originating element to the `writeResource` call. PiperOrigin-RevId: 709861817
Thanks @bcorso for fixing it promptly, however I do get compilation error on the latest HEAD-SNAPSHOT.
Update: |
Thanks @mar3kk for trying it out and verifying the fix! We'll get the 2.54.1 release out next week, though it might be later in the week due to the holidays. |
@mar3kk just to confirm (since I noticed you only said "it compiled"), did you verify if it fixed the incremental processing issues you were seeing? |
Yes, I didn't verify the fix back then when I posted the message. I gave it a try and I think the issue reported here got fixed. I no longer see that many files contributing to the generated proguard rules. Thanks! However I still see a hundreds of files marked dirty in the |
Does dagger/hilt KSP actually support incremental symbol processing? It seems changing any java or kotlin file in our project, even one that seemingly shouldn't contribute to the output, causes the ksp to re-run completely.
Analyzing the KSP log files
kspDirtySet.log
andkspSourceToOutputs.log
turns out most of the times the files considered dirty are only used to produce some proguard rules. There are a lot of entries ending_HiltModules_KeyModule_LazyClassKeys.pro
. Feels like something that could be skipped when minification is disabled.The text was updated successfully, but these errors were encountered: