Edoardo Luppi
05/15/2024, 9:42 AMmbonnin
05/15/2024, 9:44 AMEdoardo Luppi
05/15/2024, 9:45 AMmbonnin
05/15/2024, 9:45 AMAdam S
05/15/2024, 10:48 AMkotlin("jvm") + CC worked in earlier versions?Edoardo Luppi
05/15/2024, 10:50 AMmbonnin
05/15/2024, 11:05 AMmbonnin
05/15/2024, 11:06 AMEdoardo Luppi
05/15/2024, 11:09 AMEdoardo Luppi
05/15/2024, 11:12 AM* What went wrong:
Configuration cache state could not be cached: fieldofapiConfigurationbean found in fieldorg.jetbrains.kotlin.gradle.plugin.mpp.compilationImpl.DefaultKotlinCompilationConfigurationsContainerofdependencyConfigurationsbean found in fieldorg.jetbrains.kotlin.gradle.plugin.mpp.compilationImpl.KotlinCompilationImpl$Paramsofparamsbean found in fieldorg.jetbrains.kotlin.gradle.plugin.mpp.compilationImpl.KotlinCompilationImplofthis$0bean found in fieldorg.jetbrains.kotlin.gradle.plugin.mpp.compilationImpl.KotlinCompilationImpl$associateWith$2offorAllActionsbean found in fieldorg.jetbrains.kotlin.gradle.utils.MutableObservableSetImplofallAssociatedCompilationsImplbean found in fieldorg.jetbrains.kotlin.gradle.plugin.mpp.compilationImpl.KotlinCompilationImplof$$delegate_0bean found in fieldorg.jetbrains.kotlin.gradle.plugin.mpp.KotlinJvmCompilationofmapbean found in fieldorg.gradle.api.internal.DefaultNamedDomainObjectCollection$UnfilteredIndexofindexbean found in fieldorg.gradle.api.internal.FactoryNamedDomainObjectContainerofcompilationsbean found in fieldorg.jetbrains.kotlin.gradle.targets.jvm.KotlinJvmTargetoftargetbean found in fieldorg.jetbrains.kotlin.gradle.plugin.mpp.KotlinJvmCompilationofunderlyingbean found in fieldorg.jetbrains.kotlin.gradle.utils.MutableObservableSetImplofcompilationsbean found in fieldorg.jetbrains.kotlin.gradle.plugin.sources.DefaultKotlinSourceSetofunderlyingbean found in fieldorg.jetbrains.kotlin.gradle.utils.MutableObservableSetImplofdependsOnClosureImplbean found in fieldorg.jetbrains.kotlin.gradle.plugin.sources.DefaultKotlinSourceSetofvaluebean found in fieldorg.jetbrains.kotlin.tooling.core.Extras$Entryofextrasbean found in fieldorg.jetbrains.kotlin.tooling.core.MutableExtrasImplofextrasbean found in fieldorg.jetbrains.kotlin.gradle.plugin.mpp.compilationImpl.KotlinCompilationImplof$$delegate_0bean found in fieldorg.jetbrains.kotlin.gradle.targets.js.ir.KotlinJsIrCompilationofcompilationbean found in fieldorg.jetbrains.kotlin.gradle.targets.js.npm.resolver.KotlinCompilationNpmResolverofbyCompilationbean found in fieldorg.jetbrains.kotlin.gradle.targets.js.npm.resolver.KotlinProjectNpmResolverofprojectResolversbean found in fieldorg.jetbrains.kotlin.gradle.targets.js.npm.resolver.KotlinRootNpmResolverofresolverbean found in fieldorg.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtensionofnodeJsbean found in fieldorg.jetbrains.kotlin.gradle.targets.js.ir.KotlinBrowserJsIrofvaluebean found in fieldkotlin.InitializedLazyImplofbrowser$delegatebean found in fieldorg.jetbrains.kotlin.gradle.targets.js.ir.KotlinJsIrTargetofthis$0bean found in fieldorg.jetbrains.kotlin.gradle.targets.js.ir.KotlinJsIrTarget$commonLazy$2$1$1ofval$actionbean found in fieldorg.gradle.internal.code.DefaultUserCodeApplicationContext$CurrentApplication$1ofdelegatebean found in fieldorg.gradle.api.internal.DefaultCollectionCallbackActionDecorator$BuildOperationEmittingActionofval$actionbean found in fieldorg.gradle.api.internal.collections.CollectionFilter$1ofmultipleActionsbean found in fieldorg.gradle.internal.ImmutableActionSet$SetWithManyActionsofaddActionsbean found in fieldorg.gradle.api.internal.collections.DefaultCollectionEventRegisterofeventRegisterbean found in fieldorg.gradle.api.internal.DefaultDomainObjectSetof$$delegate_0bean found in fieldorg.jetbrains.kotlin.gradle.targets.js.ir.KotlinJsBinaryContainerofbinariesbean found in fieldorg.jetbrains.kotlin.gradle.targets.js.ir.KotlinJsIrCompilationofcompilationbean found in fieldorg.jetbrains.kotlin.gradle.targets.js.ir.Libraryof$this_configureEachbean found in fieldcom.hcl.mainframe.project.gradle.plugins.ProjectModuleExtension$js$3$3$1$2ofactionbean found in fieldorg.gradle.api.internal.AbstractTask$TaskActionWrapperof taskactionsof type `org.jetbrains.kotlin.gradle.targets.js.ir.KotlinJsIrLink`: error writing value of type 'org.gradle.api.internal.artifacts.configurations.DefaultUnlockedConfiguration':faproto:compileProductionLibraryKotlinJs
> Resolving dependency configuration 'jvmTestCompilationApi' is not allowed as it is defined as 'canBeResolved=false'.
Instead, a resolvable ('canBeResolved=true') dependency configuration that extends 'jvmTestCompilationApi' should be resolved.
Edoardo Luppi
05/15/2024, 11:17 AMDefaultUnlockedConfigurationVampire
05/15/2024, 11:19 AMcom.hcl.mainframe.project.gradle.plugins.ProjectModuleExtension you do a doLast or doFirst on the compileProductionLibraryKotlinJs task within which you use the apiConfiguration configurationVampire
05/15/2024, 11:20 AMapiConfiguration but you use compilation that then through a long chain has apiConfiguration as a property which just happens to be the first CC-incompatible field foundEdoardo Luppi
05/15/2024, 11:21 AMdoLast
binaries.withType<JsIrBinary>().configureEach {
linkTask.configure {
// Some other code
doLast {
// If we are generating TypeScript declarations, we also want to be
// able to extend the TypeScript types from the TypeScript world.
// By default, types are marked "unique", so we need to get rid of
// those unique symbols
if (generateTs) {
val typesFileName = "${project.name}.d.ts"
val typesFile = destinationDirectory.file(typesFileName).get()
updateTypeScriptTypes(typesFile.asFile)
}
}
}
}Edoardo Luppi
05/15/2024, 11:22 AMVampire
05/15/2024, 11:24 AMproject at execution time which you do.Vampire
05/15/2024, 11:24 AMval projectName = project.name before the doLast and only using projectName in the doLastVampire
05/15/2024, 11:25 AMupdateTypeScriptTypes or the destinationDirectory.
Hard to say for me from that snippet.Edoardo Luppi
05/15/2024, 11:27 AMproject property in my plugins.
So even if I fix it there, it might pop up in other places.
I've removed the doLast as a test and now I get
> Invocation of 'Task.project' by task ':types-linkedom:compileProductionLibraryKotlinJs' at execution time is unsupported.
> Invocation of 'Task.project' by task ':parsers:compileProductionLibraryKotlinJs' at execution time is unsupported.
> Invocation of 'Task.project' by task ':zproto:compileProductionLibraryKotlinJs' at execution time is unsupported.
As you had predicted!Vampire
05/15/2024, 11:27 AMDamn, I'm not sure how you manage to understand it,I formatted it. 🙂 Easier would have been to just look at the CC report where you have it already nicely formatted as tree. But just formatting your error a bit yields
Configuration cache state could not be cached:
field `apiConfiguration` of `org.jetbrains.kotlin.gradle.plugin.mpp.compilationImpl.DefaultKotlinCompilationConfigurationsContainer` bean
found in field `dependencyConfigurations` of `org.jetbrains.kotlin.gradle.plugin.mpp.compilationImpl.KotlinCompilationImpl$Params` bean
found in field `params` of `org.jetbrains.kotlin.gradle.plugin.mpp.compilationImpl.KotlinCompilationImpl` bean
found in field `this$0` of `org.jetbrains.kotlin.gradle.plugin.mpp.compilationImpl.KotlinCompilationImpl$associateWith$2` bean
found in field `forAllActions` of `org.jetbrains.kotlin.gradle.utils.MutableObservableSetImpl` bean
found in field `allAssociatedCompilationsImpl` of `org.jetbrains.kotlin.gradle.plugin.mpp.compilationImpl.KotlinCompilationImpl` bean
found in field `$$delegate_0` of `org.jetbrains.kotlin.gradle.plugin.mpp.KotlinJvmCompilation` bean
found in field `map` of `org.gradle.api.internal.DefaultNamedDomainObjectCollection$UnfilteredIndex` bean
found in field `index` of `org.gradle.api.internal.FactoryNamedDomainObjectContainer` bean
found in field `compilations` of `org.jetbrains.kotlin.gradle.targets.jvm.KotlinJvmTarget` bean
found in field `target` of `org.jetbrains.kotlin.gradle.plugin.mpp.KotlinJvmCompilation` bean
found in field `underlying` of `org.jetbrains.kotlin.gradle.utils.MutableObservableSetImpl` bean
found in field `compilations` of `org.jetbrains.kotlin.gradle.plugin.sources.DefaultKotlinSourceSet` bean
found in field `underlying` of `org.jetbrains.kotlin.gradle.utils.MutableObservableSetImpl` bean
found in field `dependsOnClosureImpl` of `org.jetbrains.kotlin.gradle.plugin.sources.DefaultKotlinSourceSet` bean
found in field `value` of `org.jetbrains.kotlin.tooling.core.Extras$Entry` bean found in
field `extras` of `org.jetbrains.kotlin.tooling.core.MutableExtrasImpl` bean found in
field `extras` of `org.jetbrains.kotlin.gradle.plugin.mpp.compilationImpl.KotlinCompilationImpl` bean
found in field `$$delegate_0` of `org.jetbrains.kotlin.gradle.targets.js.ir.KotlinJsIrCompilation` bean
found in field `compilation` of `org.jetbrains.kotlin.gradle.targets.js.npm.resolver.KotlinCompilationNpmResolver` bean
found in field `byCompilation` of `org.jetbrains.kotlin.gradle.targets.js.npm.resolver.KotlinProjectNpmResolver` bean
found in field `projectResolvers` of `org.jetbrains.kotlin.gradle.targets.js.npm.resolver.KotlinRootNpmResolver` bean
found in field `resolver` of `org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtension` bean
found in field `nodeJs` of `org.jetbrains.kotlin.gradle.targets.js.ir.KotlinBrowserJsIr` bean
found in field `value` of `kotlin.InitializedLazyImpl` bean
found in field `browser$delegate` of `org.jetbrains.kotlin.gradle.targets.js.ir.KotlinJsIrTarget` bean
found in field `this$0` of `org.jetbrains.kotlin.gradle.targets.js.ir.KotlinJsIrTarget$commonLazy$2$1$1` bean
found in field `val$action` of `org.gradle.internal.code.DefaultUserCodeApplicationContext$CurrentApplication$1` bean
found in field `delegate` of `org.gradle.api.internal.DefaultCollectionCallbackActionDecorator$BuildOperationEmittingAction` bean
found in field `val$action` of `org.gradle.api.internal.collections.CollectionFilter$1` bean
found in field `multipleActions` of `org.gradle.internal.ImmutableActionSet$SetWithManyActions` bean
found in field `addActions` of `org.gradle.api.internal.collections.DefaultCollectionEventRegister` bean
found in field `eventRegister` of `org.gradle.api.internal.DefaultDomainObjectSet` bean
found in field `$$delegate_0` of `org.jetbrains.kotlin.gradle.targets.js.ir.KotlinJsBinaryContainer` bean
found in field `binaries` of `org.jetbrains.kotlin.gradle.targets.js.ir.KotlinJsIrCompilation` bean
found in field `compilation` of `org.jetbrains.kotlin.gradle.targets.js.ir.Library` bean
found in field `$this_configureEach` of `com.hcl.mainframe.project.gradle.plugins.ProjectModuleExtension$js$3$3$1$2` bean
found in field `action` of `org.gradle.api.internal.AbstractTask$TaskActionWrapper` bean
found in field `actions` of task `:faproto:compileProductionLibraryKotlinJs` of type `org.jetbrains.kotlin.gradle.targets.js.ir.KotlinJsIrLink`: error writing value of type 'org.gradle.api.internal.artifacts.configurations.DefaultUnlockedConfiguration'
> Resolving dependency configuration 'jvmTestCompilationApi' is not allowed as it is defined as 'canBeResolved=false'.
Instead, a resolvable ('canBeResolved=true') dependency configuration that extends 'jvmTestCompilationApi' should be resolved.
Where you see in the bottom lines that the problem stems from an action that you add in the configureEach of said extensionVampire
05/15/2024, 11:30 AMdoLast but you refer to compilation outside the doLast within the configureEach, which then makes the compilation being a "field" of the "class" that represents the configureEach closure and within the doLast you refer to something else defined in configureEach.
Due to that to store the doLast action it tries to serialize the instance of the configureEach closure to access the field which then tries to serialize the compilation too and that is which then fails in the end.Vampire
05/15/2024, 11:31 AMVampire
05/15/2024, 11:32 AMEdoardo Luppi
05/15/2024, 11:35 AMEdoardo Luppi
05/15/2024, 12:01 PMVampire
05/15/2024, 12:15 PM--stacktrace or --scan or CC report file should hopefully help.