Very generic issue as I haven't found a reproducer...
# compiler
e
Very generic issue as I haven't found a reproducer yet. Sometimes when I run a test case through the IDE, the compiler can't find certain extension functions and the build fails on
compileTestKotlinJvm
This is completely random. If I disable caching, it works for some time, and then it fails again. Anyone else ever seen this behavior?
c
Have seen it where the IDE ‘loses’ extension functions (not limited to test cases). Last time I dug into it seemed to be related to IntelliJ running Gradle with Java 17 vs running Gradle on CLI with Java 19 - something between there messed up cache, required stopping daemon and deleting the project .gradle directory (deleting .gradle/configuration-cache was not sufficient). Seems to have been better since we switched to using Java 21 for Gradle.
e
The thing is the IDE sees everything, it's the Gradle compilation that fails. It's for sure related to caching, but it's so random I can't understand it
c
yea, sounds like the same issue, can’t recall the specifics hasn’t happened in 2-3 months for us (since switching to Java 21). Happened on Mac, Windows and Windows/WSL environments - equal opportunity bug! We would do this to recover:
Copy code
./gradlew daemon --stop
rm -rf .gradle
…then re-import project into IDE.
e
I will try, thanks! I'm running on Gradle 8.7, do you recommend running it under Java 21?
I'm currently on 17 btw.
c
yea, we had the issue on several Gradle 8.x releases, including 8.7 (on the recently released 8.8 now) - had no issues running Gradle 8.7 on Java 21, its fully supported. Pretty sure the issue is somehow related to Java 17, wasn’t able to pin down specifics due to the intermittent nature and complexities of Gradle caches.
e
Let's see how long it goes without breaking now. Thanks!
👍 1