Using KSP breaks incremental execution
Nobody has claimed this yet.
- Dominant language
- Kotlin
- Stars
- 4.4k
- Forks
- 627
- Avg merge
- 3d 15m
- Merged PRs (30d)
- 20
Description
I'm working on migrating Moshi from KAPT to KSP on the project that I work.
Reading the build deprecations, I realized that a module disabled the incremental execution because of Wire.
Task :app:kspDebugKotlin
Execution optimizations have been disabled for task ':app:kspDebugKotlin' to ensure correctness due to the following reasons:
- Gradle detected a problem with the following location: '/Users/guilherme.pereira/Projects/WireGradleIssue/app/build/generated/source/wire/debug'. Reason: Task ':app:kspDebugKotlin' uses this output of task ':app:generateDebugProtos' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. Please refer to https://docs.gradle.org/7.3.3/userguide/validation_problems.html#implicit_dependency for more details about this problem.
- Gradle detected a problem with the following location: '/Users/guilherme.pereira/Projects/WireGradleIssue/app/build/generated/source/wire/debug/com/squareup/wire/android/lib/kotlin/SomeText.kt'. Reason: Task ':app:kspDebugKotlin' uses this output of task ':app:generateDebugProtos' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. Please refer to https://docs.gradle.org/7.3.3/userguide/validation_problems.html#implicit_dependency for more details about this problem.
Here's a repro project (Moshi KSP + Wire): https://github.com/guuilp/WireGradleIssue
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked WireGradleIssue reproduction and run the app's generateDebugProtos and kspDebugKotlin tasks. Inspect how the generated Wire source output is consumed and how Gradle reports the missing dependency. Done means the validation warning is resolved and KSP incremental execution is no longer disabled.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- kotlin
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100