square/anvil

Anvil making downstream gradle kotlin compilation task not cacheable

valeraz opened this issue · 4 comments

While examining our gradle build scans, I noticed this error message on our compileInternalDebugKotlin task:

Overlapping outputs: Gradle does not know how file 'build/anvil/src-gen-internalDebug/anvil' was created (output property '$1'). Task output caching requires exclusive access to output paths to guarantee correctness (i.e. multiple tasks are not allowed to produce output in the same location).

Which makes the task not cacheable.

Is this a duplicate of #693 ?

I don't think it's a duplicate of that, this seems a different issue related to anvil's attempts at working around IC issues by setting up source set dependencies

I think that error message is misleading. Before 2.5.0-beta01, Anvil didn't actually declare that directory as an output. So Gradle wouldn't be tracking it at all.

Was it being added via a convention plugin?

I think this issue is probably out of date. We did have some convention stuff going on but I've lost track of what we did between the manual workarounds posted here and switching to the upstreamed stuff in 2.5.0 betas