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

Spotless 7.0 beta 3 and beta4 break configuration cache in GoogleJavaFormatStep #2318

Open
1 task done
ZacSweers opened this issue Oct 28, 2024 · 4 comments
Open
1 task done
Labels

Comments

@ZacSweers
Copy link
Contributor

If you are submitting a bug, please include the following:

  • summary of problem

Spotless 7.0 beta 3 and beta4 break configuration cache in GoogleJavaFormatStep.

Caused by: org.gradle.api.GradleException: Add a step with [com.google.googlejavaformat:google-java-format:1.24.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)	
	

If you're just submitting a feature request or question, no need for the above.

@davidburstrom
Copy link
Contributor

Is this the same kind of issue as the following stack trace header indicates?

org.gradle.internal.cc.base.exceptions.ConfigurationCacheError: Configuration cache state could not be cached: field `backingList` of `com.diffplug.spotless.ConfigurationCacheHackList` bean found in field `stepsInternalEquality` of task `:spotlessKotlin` of type `com.diffplug.gradle.spotless.SpotlessTaskImpl`: error writing value of type 'java.util.ArrayList'

@ZacSweers
Copy link
Contributor Author

Looks like it

@marcphilipp
Copy link

I'm also seeing the error from #2318 (comment) since updating to Gradle 8.11: https://ge.junit.org/s/yychlvofhspe4/failure#1

marcphilipp added a commit to junit-team/junit5 that referenced this issue Nov 15, 2024
@bddckr
Copy link

bddckr commented Nov 18, 2024

I'm seeing the same with beta 4 and Gradle 8.11.

After commenting out all googleJavaFormat usages for a test, I then get the issue for ktfmt. Once commenting that out, it's gson. So I think it's fair to say this is a general issue, not one specific to the Google Java Format step.

The inner-most cause is what the original post mentions. The second-to-last cause is the config cache issue mentioned above.

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

No branches or pull requests

5 participants