Skip to content
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

fix: remaining configuration cache issues #1245

Merged
merged 2 commits into from
Dec 3, 2024

Conversation

lukasgraef
Copy link
Contributor

resolves #1096

@KengoTODA KengoTODA changed the title Fix remaining configuration cache issues fix: remaining configuration cache issues Sep 8, 2024
KengoTODA

This comment was marked as resolved.

hazendaz
hazendaz previously approved these changes Sep 9, 2024
@lukasgraef
Copy link
Contributor Author

In Gradle 7.6.3, testcases that perform two consecutive Builds using gradle's testkit, somehow fail if both builds are using config-cache. Deactivating the config-cache for one of these consecutive runs, resolves the problem.
Therefore, I added the "--no-configuration-cache" flag to the first gradle testkit build in three testcases.

This issue is not present in the gradle 8.1 and "current" testcases.

@hazendaz
Copy link
Member

using gradle's testkit, somehow fail if both builds are using con

I'm updating the build from gradle 7.6.3 to 7.6.4. Can you recheck that condition after you see master updated here?

@lukasgraef
Copy link
Contributor Author

@hazendaz
I tried it out locally with 7.6.4, but still no luck :(
The weird thing is that the failure is caused by a ClassNotFoundException that happens only on the second consecutive run with config-cache on:

Caused by: java.lang.ClassNotFoundException: com.github.spotbugs.snom.SpotBugsTask$$Lambda$689/0x0000000801225728
	at org.gradle.configurationcache.serialization.DefaultReadContext.readClass(Contexts.kt:285)
	at org.gradle.configurationcache.serialization.codecs.BeanCodec.decode(BeanCodec.kt:44)
	at org.gradle.configurationcache.serialization.CombinatorsKt$reentrant$1$decodeLoop$1.invokeSuspend(Combinators.kt:165)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)

@lukasgraef lukasgraef requested a review from hazendaz September 18, 2024 09:52
@mlopatkin
Copy link

@hazendaz I tried it out locally with 7.6.4, but still no luck :( The weird thing is that the failure is caused by a ClassNotFoundException that happens only on the second consecutive run with config-cache on:

This means that the configuration cache cannot restore a lambda stored somewhere in the task state. You need to make the lambda (likely this one) serializable. As of 8.0, Gradle does that for you automatically, so you should only see this failure on 7.x.

You only see the failure on the second run because this issue only manifests upon loading from the cache. Starting with 8.0 or 8.1 Gradle loads the cached state even on the first run that saved the state, so there is no strict need to run the builds in tests twice.

@lukasgraef
Copy link
Contributor Author

lukasgraef commented Dec 1, 2024

@mlopatkin
Thanks a lot for the explanations! You were right, the lambda you linked broke the config-cache on Gradle 7.

@hazendaz
Now all issues should be resolved, can you start another build?

@hazendaz hazendaz merged commit e8ba804 into spotbugs:master Dec 3, 2024
8 checks passed
Copy link

🎉 This PR is included in version 6.0.27 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Configuration Cache compatibilities
4 participants