-
Notifications
You must be signed in to change notification settings - Fork 4.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Configuation Cache breaks class reloading in IntelliJ #29087
Comments
This issue needs a decision from the team responsible for that area. They have been informed. Response time may vary. Hey, @gradle/bt-configuration team, This issue points at some strange things inside Gradle. Can you look and see if you can pinpoint the problem on IJ or Gradle? |
The issue is in the backlog of the relevant team and is prioritized by them. So the trigger is the Idea-injected build service, that's why we only see the failure when running "Compile and reload". However, Gradle is doing weird things:
In the end build successfully stores the CC state, so the next run (which is the CC hit) succeeds, because there's no model reset. This is the stack trace of the first failure.
So there are several items to be done on the Gradle side:
For the Idea's use case, adding The smallest reproducer is this import org.gradle.api.services.BuildService
import org.gradle.api.services.BuildServiceParameters
abstract class MyService implements BuildService<BuildServiceParameters.None>, AutoCloseable {
@Override
void close() {
throw new RuntimeException("HaHa")
}
}
gradle.sharedServices.registerIfAbsent("myServices", MyService) {}.get() Calling There is not so much to be done to work around this issue from the build user perspective. One option is to get rid of the build logic being compiled as part of the main build - this includes |
Current Behavior
With the configuration cache enabled, reloading classes while debugging a Java app in Jetbrains IntelliJ fails with errors like:
"Can only transition State of build ':project-name' to state BuildFinishHooks from states [Configure, TaskSchedule, ReadyToRun] however it is currently in state ReadyToReset"
Expected Behavior
Class reloading in IntelliJ should work independently of an enabled or disabled configuraton cache.
Context (optional)
I would like to raise awareness of this issue, but I'm not entirely sure if this is an IntelliJ or a Gradle issue. That's why I originally filed an issue at Jetbrains: https://youtrack.jetbrains.com/issue/IDEA-353229/Compile-and-Reload-fails-with-Gradle
Steps to Reproduce
A minimal sample project can be found at https://github.com/gesellix/IDEA-353229 with a demo video included in that repository at https://github.com/gesellix/IDEA-353229/blob/main/IDEA-353229.mp4
Gradle version
8.7
Build scan URL (optional)
No response
Your Environment (optional)
No response
The text was updated successfully, but these errors were encountered: