You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to add incremental compilation to room and one of our existing tests is failing.
The test asserts that deleting a source element will delete the file that was generated for it. For some reason, Outputs to remove is empty in the kspDirrtySetByOutputs directory. Unfortunately, I've not been able to reproduce this outside AndroidX.
I'm suspecting that this might be some path issues. If you check the kspDirtySetByOutputs log, it has some of the files as absolute paths while others as local paths.
// from kspDirtySetByDeps.log
Removed
src/main/java/room/testapp/Dao1.java:/tmp/junit2413537717527726914/src/main/java/room/testapp/Database1.java:/tmp/junit2413537717527726914/src/main/java/room/testapp/Entity1.java
Dirty
The compilation fails with:
> Task :compileDebugJavaWithJavac FAILED
/tmp/junit2413537717527726914/build/generated/ksp/debug/java/room/testapp/Database1_Impl.java:28: error: cannot find symbol
public final class Database1_Impl extends Database1 {
^
Database1 is deleted in the test but if you check kspSourceToOutputs below, we've set it as a dependency on Database1_Impl.
Can you try with this app?
I wrote a simple shell script to repro it so you should be able to reproduce it by going into the project and then running ./repro.sh ksp-incremental-bug-repro.tar.gz
yigit
changed the title
Incremental compilation "sometimes" do not delete previous outputs
Incremental compilation "sometimes" does not delete previous outputs
Feb 25, 2021
This CL adds incremental compilation for the KSP backend.
We do not respect the `room.incremental` flag since it was added to
initially enable incremental java annotation processing and KSP is a new
backend hence we should always be incremental. (developer can still turn
it off for all of KSP).
The way we collect these files is a bit hacky because it requires us to
wrap a KSFile into a javax.model.Element because the only API available
in JavaPoet receives javax.model.Element. An alternative implementation
could abstract JavaPoet but it would be a more complicated change.
There is a KI in KSP: google/ksp#332
* KSP does not delete previous outputs if originating files are deleted.
That test is disabled for now until there is a new KSP release with the
fix. This does not easily reproduce in a sample app but does reproduce
in our testing setup.
Bug: 176453350
Test: RoomIncrementalAnnotationProcessingTest
RelNote: Added incremental compilation support for KSP.
Change-Id: I031c1f94890ebe2a382c26f7f0745edb790a5a7b
I'm trying to add incremental compilation to room and one of our existing tests is failing.
The test asserts that deleting a source element will delete the file that was generated for it. For some reason, Outputs to remove is empty in the
kspDirrtySetByOutputs
directory. Unfortunately, I've not been able to reproduce this outside AndroidX.I'm suspecting that this might be some path issues. If you check the
kspDirtySetByOutputs
log, it has some of the files as absolute paths while others as local paths.The compilation fails with:
Database1 is deleted in the test but if you check
kspSourceToOutputs
below, we've set it as a dependency onDatabase1_Impl
.Here are the contents of the 4 incremental logs:
kspDirtySet.log
kspDirtySetByDeps
kspDirtySetByOutputs
kspSourceToOutputs
The text was updated successfully, but these errors were encountered: