Closed Komdosh closed 4 months ago
Thank you for reporting! For the time being, can you use a previous version of Gradle? Does that solve your issue?
I tried using Gradle 7.6, and it started working only after I disabled the configuration cache (there was a different property name for it in Gradle 8.7, so I forgot to update it after downgrading).
Disabling the configuration cache actually resolved the issue. It seems notCompatibleWithConfigurationCache
wasn't working as expected with org.gradle.configuration-cache.problems=warn
in Gradle (or possibly earlier versions).
In Gradle 8.7, disabling configuration cache in task and setting org.gradle.configuration-cache.problems=disabled
in gradle.properties
resolves the issue.
val generateGrammarSource by
tasks.registering(AntlrKotlinTask::class) {
notCompatibleWithConfigurationCache("generateGrammarSource not compatible with ConfigurationCache")
....
}}
So the problem is in configuration cache.
P.S. Warnings are still here but it builds anyway
35 problems were found storing the configuration cache, 11 of which seem unique.
- Task `:common:expression:generateGrammarSource` of type `com.strumenta.antlrkotlin.gradle.AntlrKotlinTask`: cannot serialize object of type 'java.io.PrintStream', a subtype of 'java.io.OutputStream', as these are not supported with the configuration cache. Only 'System.out' or 'System.err' can be used there.
See https://docs.gradle.org/8.7/userguide/configuration_cache.html#config_cache:requirements:disallowed_types
- Task `:common:expression:generateGrammarSource` of type `com.strumenta.antlrkotlin.gradle.AntlrKotlinTask`: cannot serialize object of type 'jdk.internal.loader.ClassLoaders$AppClassLoader', a subtype of 'java.lang.ClassLoader', as these are not supported with the configuration cache.
See https://docs.gradle.org/8.7/userguide/configuration_cache.html#config_cache:requirements:disallowed_types
- Task `:common:expression:generateGrammarSource` of type `com.strumenta.antlrkotlin.gradle.AntlrKotlinTask`: cannot serialize object of type 'org.gradle.internal.concurrent.DefaultExecutorFactory$TrackedScheduledManagedExecutor', a subtype of 'java.util.concurrent.Executor', as these are not supported with the configuration cache.
See https://docs.gradle.org/8.7/userguide/configuration_cache.html#config_cache:requirements:disallowed_types
- Task `:common:expression:generateGrammarSource` of type `com.strumenta.antlrkotlin.gradle.AntlrKotlinTask`: cannot serialize object of type 'org.gradle.internal.event.DefaultListenerManager$EventBroadcast$ListenerDispatch', a subtype of 'org.gradle.internal.event.AbstractBroadcastDispatch', as these are not supported with the configuration cache.
See https://docs.gradle.org/8.7/userguide/configuration_cache.html#config_cache:requirements:disallowed_types
- Task `:common:expression:generateGrammarSource` of type `com.strumenta.antlrkotlin.gradle.AntlrKotlinTask`: cannot serialize object of type 'org.gradle.internal.event.ListenerBroadcast', a subtype of 'org.gradle.internal.event.ListenerBroadcast', as these are not supported with the configuration cache.
See https://docs.gradle.org/8.7/userguide/configuration_cache.html#config_cache:requirements:disallowed_types
- Task `:common:expression:generateGrammarSource` of type `com.strumenta.antlrkotlin.gradle.AntlrKotlinTask`: error writing value of type '[Ljava.util.WeakHashMap$Entry;'
- Task `:common:expression:generateGrammarSource` of type `com.strumenta.antlrkotlin.gradle.AntlrKotlinTask`: error writing value of type 'java.lang.ref.ReferenceQueue'
- Task `:common:expression:generateGrammarSource` of type `com.strumenta.antlrkotlin.gradle.AntlrKotlinTask`: error writing value of type 'java.text.SimpleDateFormat'
- Task `:common:expression:generateGrammarSource` of type `com.strumenta.antlrkotlin.gradle.AntlrKotlinTask`: error writing value of type 'java.util.concurrent.ConcurrentSkipListMap'
- Task `:common:expression:generateGrammarSource` of type `com.strumenta.antlrkotlin.gradle.AntlrKotlinTask`: error writing value of type 'java.util.concurrent.locks.ReentrantLock'
- Task `:common:expression:generateGrammarSource` of type `com.strumenta.antlrkotlin.gradle.AntlrKotlinTask`: error writing value of type 'java.util.logging.LogManager$RootLogger'
AntlrKotlinTask
is marked as cachable, but down the line we're using something that hasn't been thought to be cache-compatible. I think that's the gist of it.
I'll have a look if we can do something about it on our side.
I can't even get to a point where I can repro.
30 problems were found storing the configuration cache, 12 of which seem unique.
- Task `:faproto:compileProductionLibraryKotlinJs` of type `org.jetbrains.kotlin.gradle.targets.js.ir.KotlinJsIrLink`: cannot serialize object of type 'org.gradle.api.internal.artifacts.configurations.DefaultConfigurationContainer', a subtype of 'org.gradle.api.artifacts.ConfigurationContainer', as these are not supported with the configuration cache.
See https://docs.gradle.org/8.7/userguide/configuration_cache.html#config_cache:requirements:disallowed_types
- Task `:faproto:compileProductionLibraryKotlinJs` of type `org.jetbrains.kotlin.gradle.targets.js.ir.KotlinJsIrLink`: cannot serialize object of type 'org.gradle.api.internal.artifacts.configurations.DefaultUnlockedConfiguration', a subtype of 'org.gradle.api.artifacts.Configuration', as these are not supported with the configuration cache.
See https://docs.gradle.org/8.7/userguide/configuration_cache.html#config_cache:requirements:disallowed_types
- Task `:faproto:compileProductionLibraryKotlinJs` of type `org.jetbrains.kotlin.gradle.targets.js.ir.KotlinJsIrLink`: cannot serialize object of type 'org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler', a subtype of 'org.gradle.api.artifacts.dsl.DependencyHandler', as these are not supported with the configuration cache.
See https://docs.gradle.org/8.7/userguide/configuration_cache.html#config_cache:requirements:disallowed_types
- Task `:faproto:compileProductionLibraryKotlinJs` of type `org.jetbrains.kotlin.gradle.targets.js.ir.KotlinJsIrLink`: cannot serialize object of type 'org.gradle.api.internal.file.DefaultSourceDirectorySet', a subtype of 'org.gradle.api.file.SourceDirectorySet', as these are not supported with the configuration cache.
See https://docs.gradle.org/8.7/userguide/configuration_cache.html#config_cache:requirements:disallowed_types
- Task `:faproto:compileProductionLibraryKotlinJs` of type `org.jetbrains.kotlin.gradle.targets.js.ir.KotlinJsIrLink`: cannot serialize object of type 'org.gradle.api.internal.project.DefaultProject', a subtype of 'org.gradle.api.Project', as these are not supported with the configuration cache.
See https://docs.gradle.org/8.7/userguide/configuration_cache.html#config_cache:requirements:disallowed_types
- Task `:faproto:compileProductionLibraryKotlinJs` of type `org.jetbrains.kotlin.gradle.targets.js.ir.KotlinJsIrLink`: cannot serialize object of type 'org.jetbrains.kotlin.gradle.targets.js.npm.PublicPackageJsonTask', a subtype of 'org.gradle.api.Task', as these are not supported with the configuration cache.
See https://docs.gradle.org/8.7/userguide/configuration_cache.html#config_cache:requirements:task_access
- Task `:faproto:compileProductionLibraryKotlinJs` of type `org.jetbrains.kotlin.gradle.targets.js.ir.KotlinJsIrLink`: cannot serialize object of type 'org.jetbrains.kotlin.gradle.targets.js.npm.tasks.KotlinPackageJsonTask', a subtype of 'org.gradle.api.Task', as these are not supported with the configuration cache.
See https://docs.gradle.org/8.7/userguide/configuration_cache.html#config_cache:requirements:task_access
- Task `:faproto:compileProductionLibraryKotlinJs` of type `org.jetbrains.kotlin.gradle.targets.js.ir.KotlinJsIrLink`: cannot serialize object of type 'org.jetbrains.kotlin.gradle.targets.js.yarn.YarnLockCopyTask', a subtype of 'org.gradle.api.Task', as these are not supported with the configuration cache.
See https://docs.gradle.org/8.7/userguide/configuration_cache.html#config_cache:requirements:task_access
- Task `:faproto:compileProductionLibraryKotlinJs` of type `org.jetbrains.kotlin.gradle.targets.js.ir.KotlinJsIrLink`: cannot serialize object of type 'org.jetbrains.kotlin.gradle.targets.js.yarn.YarnLockStoreTask', a subtype of 'org.gradle.api.Task', as these are not supported with the configuration cache.
See https://docs.gradle.org/8.7/userguide/configuration_cache.html#config_cache:requirements:task_access
- Task `:faproto:compileProductionLibraryKotlinJs` of type `org.jetbrains.kotlin.gradle.targets.js.ir.KotlinJsIrLink`: cannot serialize object of type 'org.jetbrains.kotlin.gradle.targets.jvm.tasks.KotlinJvmRun', a subtype of 'org.gradle.api.Task', as these are not supported with the configuration cache.
See https://docs.gradle.org/8.7/userguide/configuration_cache.html#config_cache:requirements:task_access
- Task `:faproto:compileProductionLibraryKotlinJs` of type `org.jetbrains.kotlin.gradle.targets.js.ir.KotlinJsIrLink`: cannot serialize object of type 'org.jetbrains.kotlin.gradle.targets.jvm.tasks.KotlinJvmTest', a subtype of 'org.gradle.api.Task', as these are not supported with the configuration cache.
See https://docs.gradle.org/8.7/userguide/configuration_cache.html#config_cache:requirements:task_access
- Task `:faproto:compileProductionLibraryKotlinJs` of type `org.jetbrains.kotlin.gradle.targets.js.ir.KotlinJsIrLink`: cannot serialize object of type 'org.jetbrains.kotlin.gradle.tasks.Kotlin2JsCompile', a subtype of 'org.gradle.api.Task', as these are not supported with the configuration cache.
See https://docs.gradle.org/8.7/userguide/configuration_cache.html#config_cache:requirements:task_access
@lppedd
I can't even get to a point where I can repro.
Check this example:
Thanks! Fixed. Will open a PR soon.
I tried to run the Gradle task
AntlrKotlinTask
, but it failed.I'm using gradle 8.7 with kotlin dsl and Java 21. I have applied plugin and add dependency. Kotlin multiplatform (JVM + JS).
Configuration cache - turn on. When cache turn off - task is always "UP-TO-DATE"
Gradle Error:
I've tried to open all necessary java modules.
There is another error:
Gradle: configuration cache report in attachment (Github not allow to attach html, so please, change file type to html to view report). If you need any details, please let me know.
configuration-cache-report.log