Help, please! Suddenly my gradle kotlin module sto...
# gradle
e
Help, please! Suddenly my gradle kotlin module stopped compiing. It just hangs at the
compileKotlin
task indefinitely. Just yesterday I created the first kotlin module in our large-ish Java application and was very satisfied that the setup was relatively painless. Today, the build just hangs (there are just a couple of Kotlin files so far that should take at most a couple of seconds to compile). When I start gradle with from the command line with verbose option, I see that it is stuck at
Resolve files of kotlinScriptDefExtensions
and every now and then logs some info about aquiring and releasing locks. Using Kotlin 1.9.0 and gradle 8.2.1
Copy code
2023-07-13T12:12:04.565+0200 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker: acquired lock on worker lease
2023-07-13T12:12:04.565+0200 [DEBUG] [org.gradle.internal.resources.AbstractTrackedResourceLock] Execution worker: released lock on worker lease
2023-07-13T12:12:08.604+0200 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
2023-07-13T12:12:08.604+0200 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on daemon addresses registry.
2023-07-13T12:12:08.604+0200 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
2023-07-13T12:12:08.605+0200 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
2023-07-13T12:12:08.605+0200 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on daemon addresses registry.
2023-07-13T12:12:08.605+0200 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
2023-07-13T12:12:18.615+0200 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
2023-07-13T12:12:18.615+0200 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on daemon addresses registry.
2023-07-13T12:12:18.615+0200 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
2023-07-13T12:12:18.616+0200 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire shared lock on daemon addresses registry.
2023-07-13T12:12:18.616+0200 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on daemon addresses registry.
2023-07-13T12:12:18.616+0200 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
<============-> 97% EXECUTING [1m 26s]
> IDLE
> :bcs-id-migration:compileKotlin > Resolve files of :bcs-id-migration:kotlinScriptDefExtensions
solved 1
t
could you check the Kotlin daemon logs in
java.io.tmpdir
? They are named like
kotlin-daemon.$timestamp.log
e
I only found a lot of old kotlin daemon log files. I stopped all daemons, deleted all log files and started the build again. No new log files are written.
I have found that luckily yesterday I commited (but not pushed) my work and just found that simply stashing my changes since then, the build works again. Currently, I am trying to isolate the one change since then, that broke the build.
t
Please grep next time Kotlin daemon logs for
requested state: Alive > actual: LastSession
- you may be affected by https://youtrack.jetbrains.com/issue/KT-55322
e
Nothing gets written to the daemon log at all. (Only when I do
gradle --stop
the log contains the shutdown info.)
This is driving me nuts. I got the build to work by reseting the branch to yesterday's commit. Then I made tiny changes. It broke after updating gradle from 8.1.1 to 8.2.1. Now however, I can't get it to work again even when switching to 8.1.1 again. (I tried stopping all daemons, deleting the project/.gradle directory, even deleting the global .gradle directory)
t
could you share your project?
e
No unfortunately not. It's not public. I also don't see how I could created a reproducible example.
t
hm, wait a second. Are you using Spring in your project?
e
Yes
Currently Spring Boot 2.7.3. I overwrote the Kotlin version to 1.9.0 and it seemed to work
t
and among Gradle plugins - is there Spring dependency management plugin?
e
No, that was causing performance problems for use, so we switched to using gradle platform instead.
t
This plugin may caused such deadlocks. Is it possible to share a build scan (in private as well) with Gradle
tasks
execution? And share you project Gradle structure via https://github.com/android/project-replicator?
e
Sure, I'll try.
If you are really interested, I guess we could also have a remote session, so that you could see the issue live ;-)