Google Java Format step is not compatible with configuration cache
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 32/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Stale
- Domain
- build-system
Research direction
Start with the stack-trace entry points in GoogleJavaFormatStep.java, JarState.java, GradleProvisioner.java, and FormatterStepSerializationRoundtrip.java. Reproduce the failure using configuration cache, predeclare, and google-java-format 1.26.0, then verify that the reported exception no longer occurs while the predeclared formatter remains usable.
Written by the indexing model from the issue text.
Description
When running spotless with CC enabled and using predeclare, we still see this error reported:
Caused by: org.gradle.api.GradleException: Add a step with [com.google.googlejavaformat:google-java-format:1.26.0] into the `spotlessPredeclare` block in the root project.
at com.diffplug.gradle.spotless.GradleProvisioner$DedupingProvisioner.lambda$new$0(GradleProvisioner.java:99)
at com.diffplug.spotless.JarState.provisionWithTransitives(JarState.java:109)
at com.diffplug.spotless.JarState.from(JarState.java:98)
at com.diffplug.spotless.JarState.from(JarState.java:93)
at com.diffplug.spotless.java.GoogleJavaFormatStep.lambda$createInternally$1(GoogleJavaFormatStep.java:106)
at com.diffplug.spotless.JarState$Promised.get(JarState.java:53)
at com.diffplug.spotless.java.GoogleJavaFormatStep.equalityState(GoogleJavaFormatStep.java:152)
at com.diffplug.spotless.FormatterStepSerializationRoundtrip.stateSupplier(FormatterStepSerializationRoundtrip.java:57)
at com.diffplug.spotless.ThrowingEx.get(ThrowingEx.java:67)
at com.diffplug.spotless.FormatterStepSerializationRoundtrip$HackClone.writeObject(FormatterStepSerializationRoundtrip.java:113)
We are configuring GJF's formatter in our predeclare block and you can find our configuration logic here: https://github.com/slackhq/foundry/blob/5d970a56341e0cd703ab20c344f0df3a55a6c826/platforms/gradle/foundry-gradle-plugin/src/main/kotlin/foundry/gradle/FoundryBasePlugin.kt#L185-L200
- Dominant language
- Java
- Stars
- 5.7k
- Forks
- 560
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 43
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from diffplug/spotless
-
Difficulty 5/5 Over a week Newbie friendliness 15/100
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
-
Difficulty 3/5 1-2 days Newbie friendliness 66/100
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
-
Difficulty 4/5 3-5 days Newbie friendliness 52/100
All issues in diffplug/spotless
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
infinispan/infinispan#18150 ·
-
area/frontend
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
opensearch-project/k-NN#3597 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100