google / ksp

Kotlin Symbol Processing API
https://github.com/google/ksp
Apache License 2.0
2.86k stars 269 forks source link

When I run task kspKotlin it locks some libraries after task complete #428

Open amir1376 opened 3 years ago

amir1376 commented 3 years ago

When I run gradle task gradlew kspKotlin, after task completes it still locks some libraries that are in my processing module implementation(project(":annotations")) now when I want to execute gradlew cleangradle throws an IOException

    Failed to delete some children. This might happen because a process has files open or has its working dir
ectory set in the target directory.
    - D:\dev\projects\jvm\Savable\annotations\build\libs\annotations-1.0-SNAPSHOT.jar
    - D:\dev\projects\jvm\Savable\annotations\build\libs

until I release lock with third party application

ting-yuan commented 3 years ago

Thanks for reporting the issue! Could you share the project so that we can reproduce?

amir1376 commented 3 years ago

of course
DemoProject.zip

just run gradlew kspKotlin
after that gradlew clean

ting-yuan commented 3 years ago

It seems that neither processing nor app depends on annotations. In my attempt to reproduce, gradlew kspKotlin doesn't even build anntations. Therefore the anntations-1.0-SNAPSHOT.jar isn't generated and nothing is locked.

My random guess is that the files might be held open by Gradle, KotlinCompileDaemon or even the IDE:

  1. Is the IDE open during the build?
  2. Can you try a newer Gradle version?
  3. Would killing KotlinCompileDaemon or Gradle daemon make the issue away?