This message was deleted.
# configuration-cache
s
This message was deleted.
k
Not sure if it makes any difference but my project is a multi-module project, and I have this line in the root project's settings file
m
What version of Gradle do you use? Could you please post a stack trace of the failure? Are there any included builds or buildSrc project involved?
k
thanks for your reply version 8.4 Here is most of the stacktrace
Copy code
* Exception is:
org.gradle.api.InvalidUserCodeException: Cannot change default excludes during the build. They were changed from [**/#*#, **/%*%, **/*~, **/.#*, **/.DS_Store, **/._*, **/.bzr, **/.bzr/**, **/.bzrignore, **/.cvsignore, **/.git, **/.git/**, **/.gitattributes, **/.gitmodules, **/.hg, **/.hg/**, **/.hgignore, **/.hgsub, **/.hgsubstate, **/.hgtags, **/.svn, **/.svn/**, **/CVS, **/CVS/**, **/SCCS, **/SCCS/**, **/vssver.scc] to [**/#*#, **/%*%, **/*~, **/.#*, **/.DS_Store, **/._*, **/.bzr, **/.bzr/**, **/.bzrignore, **/.cvsignore, **/.git, **/.git/**, **/.gitattributes, **/.gitignore, **/.gitmodules, **/.hg, **/.hg/**, **/.hgignore, **/.hgsub, **/.hgsubstate, **/.hgtags, **/.svn, **/.svn/**, **/CVS, **/CVS/**, **/SCCS, **/SCCS/**, **/vssver.scc]. Configure default excludes in the settings script instead.
        at org.gradle.api.tasks.util.internal.PatternSpecFactory.failOnChangedDefaultExcludes(PatternSpecFactory.java:110)
        at org.gradle.api.tasks.util.internal.PatternSpecFactory.getDefaultExcludeSpec(PatternSpecFactory.java:95)
        at org.gradle.api.tasks.util.internal.PatternSpecFactory.createExcludeSpec(PatternSpecFactory.java:80)
        at org.gradle.api.tasks.util.internal.PatternSpecFactory.createSpec(PatternSpecFactory.java:58)
        at org.gradle.api.tasks.util.PatternSet.getAsSpec(PatternSet.java:165)
        at org.gradle.internal.fingerprint.impl.PatternSetSnapshottingFilter.getAsSnapshotPredicate(PatternSetSnapshottingFilter.java:57)
        at org.gradle.internal.vfs.impl.DefaultFileSystemAccess.lambda$read$6(DefaultFileSystemAccess.java:127)
        at org.gradle.internal.vfs.impl.DefaultFileSystemAccess.readSnapshotFromLocation(DefaultFileSystemAccess.java:182)
        at org.gradle.internal.vfs.impl.DefaultFileSystemAccess.read(DefaultFileSystemAccess.java:126)
        at org.gradle.internal.fingerprint.impl.DefaultFileCollectionSnapshotter$SnapshottingVisitor.visitFileTree(DefaultFileCollectionSnapshotter.java:76)
        at org.gradle.api.internal.file.collections.FileTreeAdapter$1.visitFileTree(FileTreeAdapter.java:125)
        at org.gradle.api.internal.file.collections.DirectoryFileTree.visitStructure(DirectoryFileTree.java:106)
        at org.gradle.api.internal.file.collections.FileTreeAdapter.visitContents(FileTreeAdapter.java:121)
        at org.gradle.api.internal.file.AbstractFileCollection.visitStructure(AbstractFileCollection.java:366)
        at org.gradle.api.internal.file.CompositeFileCollection.lambda$visitContents$0(CompositeFileCollection.java:133)
        at org.gradle.api.internal.file.collections.UnpackingVisitor.add(UnpackingVisitor.java:67)
        at org.gradle.api.internal.file.collections.UnpackingVisitor.add(UnpackingVisitor.java:100)
        at org.gradle.api.internal.file.DefaultFileCollectionFactory$ResolvingFileCollection.visitChildren(DefaultFileCollectionFactory.java:285)
        at org.gradle.api.internal.file.CompositeFileCollection.visitContents(CompositeFileCollection.java:133)
        at org.gradle.api.internal.file.AbstractFileCollection.visitStructure(AbstractFileCollection.java:366)
        at org.gradle.internal.fingerprint.impl.DefaultFileCollectionSnapshotter.snapshot(DefaultFileCollectionSnapshotter.java:47)
        at org.gradle.internal.fingerprint.impl.AbstractFileCollectionFingerprinter.fingerprint(AbstractFileCollectionFingerprinter.java:46)
        at org.gradle.configurationcache.fingerprint.ConfigurationCacheFingerprintController$CacheFingerprintCheckerHost.fingerprintOf(ConfigurationCacheFingerprintController.kt:411)
        at org.gradle.configurationcache.fingerprint.ConfigurationCacheFingerprintChecker.check(ConfigurationCacheFingerprintChecker.kt:155)
        at org.gradle.configurationcache.fingerprint.ConfigurationCacheFingerprintChecker.checkBuildScopedFingerprint(ConfigurationCacheFingerprintChecker.kt:73)
        at org.gradle.configurationcache.fingerprint.ConfigurationCacheFingerprintController.checkBuildScopedFingerprint(ConfigurationCacheFingerprintController.kt:280)
        at org.gradle.configurationcache.DefaultConfigurationCache$checkBuildScopedFingerprint$1.invokeSuspend(DefaultConfigurationCache.kt:493)
        at org.gradle.configurationcache.DefaultConfigurationCache$checkBuildScopedFingerprint$1.invoke(DefaultConfigurationCache.kt)
        at org.gradle.configurationcache.DefaultConfigurationCache$checkBuildScopedFingerprint$1.invoke(DefaultConfigurationCache.kt)
        at org.gradle.configurationcache.DefaultConfigurationCache$readFingerprintFile$2$1.invokeSuspend(DefaultConfigurationCache.kt:512)
        at org.gradle.configurationcache.DefaultConfigurationCache$readFingerprintFile$2$1.invoke(DefaultConfigurationCache.kt)
        at org.gradle.configurationcache.DefaultConfigurationCache$readFingerprintFile$2$1.invoke(DefaultConfigurationCache.kt)
        at org.gradle.configurationcache.ConfigurationCacheIO$withReadContextFor$1$1$1$1.invokeSuspend(ConfigurationCacheIO.kt:257)
        at org.gradle.configurationcache.ConfigurationCacheIO$withReadContextFor$1$1$1$1.invoke(ConfigurationCacheIO.kt)
        at org.gradle.configurationcache.ConfigurationCacheIO$withReadContextFor$1$1$1$1.invoke(ConfigurationCacheIO.kt)
        at org.gradle.configurationcache.serialization.RunningKt$runReadOperation$2.invokeSuspend(Running.kt:34)
there is an included build
v
Yeah, that's incompatible with configuration cache afair. Don't know whether there is an open issues already. But just having that line in a minimal build already triggers the error. If there is no issue yet, you should probably report one. Maybe you can work-around it using a
ValueSource
, but I never tried that.
Hm, no, even if you do it within a value source the error happens
k
Ah ok 😞 thanks for looking though! I'll check if there's an open issue.
v
As @Mikhail Lopatkin was unaware of the issue, I guess there is not. 😄
m
We definitely tried to fix the excludes with CC for 8.1 and I recall it working https://github.com/gradle/gradle/issues/13665
v
I just tried with 8.1.1 and it is failing the same though
This is just a mainly empty project with
java-library
plugin and the exclude line from OP in the settings script
m
Oh, now I see; the trick is to run e.g.
compileJava
and not just
help
k
Ah yes, sorry I should have said
v
Yep, or
processTestResources
, or
processResources
, or just
build
It is also interesting, that the error says old is without
**/.gitignore
, new is with
So it seems to me the
defaultExcludeSpecCache
indeed is restored from the configuration cache while
DirectoryScanner.getDefaultExcludes()
is returning the unmodified original value
m
I suspect we assumed that
Copy code
DirectoryScanner.resetDefaultExcludes();
resets excludes to nothing, which it doesn't
so adding excludes works fine, but not removing
👌 1
v
Yeah, no, reset resets to the built-in default
Ah, that's probably also why the value source does not work? The value source is called and removes the default exclude, but then you restore from configuration cache and call the reset I guess.
m
Most likely, yes. And, looking at the stacktrace, we're probably prone to having incorrect excludes when checking cache fingerprint, because it is restored later 😞 I'll take it from here. Thank you for the report and help with the reproducer, and sorry for the feature not working correctly.
k
No problem. Thanks for your prompt responses 🙂 Do you need me to create an issue or will you create one? Just so I can watch the progress on this.
m
👌 1
👍 1
k
Thanks