-
Notifications
You must be signed in to change notification settings - Fork 272
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
kspCaches don't work together with Gradle build cache #2042
Comments
I am able to reproduce this in a test case. I will attempt a fix. @ting-yuan Would it be OK to mark the kspCaches as local state as a fix? |
I can confirm that marking the directory as local state does indeed work. @oehme Have you noticed any issues with marking it as local state? |
I assume that deleting them would make the next build non-incremental? That would be the main downside. I've noticed no other issues. The alternative would be mark the caches as an output, so they get restored together with the classes they belong to. Then the next build could work incrementally again. For that to work, the caches need to be portable across machines (no absolute paths etc.). I didn't try it, because I didn't know what those caches contain exactly. |
Without this change, the task's caches will be in an incorrect state and the next incremental run can lead to compile errors. Now the caches have been marked as local state and Gradle will remove them when the task is restored from the build cache. This fixes google#2042
Thanks! |
Without this change, the task's caches will be in an incorrect state and the next incremental run can lead to compile errors. Now the caches have been marked as local state and Gradle will remove them when the task is restored from the build cache. This fixes #2042 (cherry picked from commit 3f31c10)
Without this change, the task's caches will be in an incorrect state and the next incremental run can lead to compile errors. Now the caches have been marked as local state and Gradle will remove them when the task is restored from the build cache. This fixes #2042 (cherry picked from commit 3f31c10)
The ksp task has a
kspCaches
directory which contains backups of generated classes. The following sequence of events will lead to stale outputs files and compile errors:The only fix at that point is to do a clean build to get rid of the caches.
Workaround: I've marked the kspCaches directory for each ksp task as localState in our build, so Gradle deletes it on a cache hit.
Tested with 1.9.25-1.0.20
The text was updated successfully, but these errors were encountered: