https://kotlinlang.org logo
#gradle
Title
# gradle
m

mbonnin

12/05/2023, 5:03 PM
I get hit by
compileKotin
using implicit output of
sign
over
/Users/mbonnin/git/apollo-kotlin/libraries/apollo-mockserver/build/classes/kotlin/iosArm64/main/klib/apollo-mockserver.klib.asc
:
Copy code
Reason: Task ':apollo-mockserver:compileTestKotlinIosArm64' uses this output of task ':apollo-mockserver:signIosArm64Publication' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed.
Where should I file the issue? (or is there one already?) • Should KGP only add
.klib
files as input to
compileKotlin
? • Or should
Sign
use a separate directory for its output?
v

Vampire

12/05/2023, 5:08 PM
The latter. Tasks should never have overlapping outputs. So writing files to the output directory of another task or changing output files of other tasks in-place is very bad. It disturbs up-to-checkes, it disturbs caching, it can also lead to corrupt cache entries with wrong files or files that do not really belong to the task and so on, and could also cause tasks to behave differently as those additional files might be there or might be absent or even might be there but stale as from a previous run, which is why this check now exists that slaps you in the face. 🙂
1
👍 1
m

mbonnin

12/05/2023, 5:12 PM
random thoughts: Gradle should provide a default output dir for tasks
isolated from the other ones and in a unique namespace
Anyways, I'm almost sure I saw a Gradle issue about this, I'll dig
Ha found it, "overlapping" was the keyword I was missing
👌 1