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: fieldofapiConfiguration
bean found in fieldorg.jetbrains.kotlin.gradle.plugin.mpp.compilationImpl.DefaultKotlinCompilationConfigurationsContainer
ofdependencyConfigurations
bean found in fieldorg.jetbrains.kotlin.gradle.plugin.mpp.compilationImpl.KotlinCompilationImpl$Params
ofparams
bean found in fieldorg.jetbrains.kotlin.gradle.plugin.mpp.compilationImpl.KotlinCompilationImpl
ofthis$0
bean found in fieldorg.jetbrains.kotlin.gradle.plugin.mpp.compilationImpl.KotlinCompilationImpl$associateWith$2
offorAllActions
bean found in fieldorg.jetbrains.kotlin.gradle.utils.MutableObservableSetImpl
ofallAssociatedCompilationsImpl
bean found in fieldorg.jetbrains.kotlin.gradle.plugin.mpp.compilationImpl.KotlinCompilationImpl
of$$delegate_0
bean found in fieldorg.jetbrains.kotlin.gradle.plugin.mpp.KotlinJvmCompilation
ofmap
bean found in fieldorg.gradle.api.internal.DefaultNamedDomainObjectCollection$UnfilteredIndex
ofindex
bean found in fieldorg.gradle.api.internal.FactoryNamedDomainObjectContainer
ofcompilations
bean found in fieldorg.jetbrains.kotlin.gradle.targets.jvm.KotlinJvmTarget
oftarget
bean found in fieldorg.jetbrains.kotlin.gradle.plugin.mpp.KotlinJvmCompilation
ofunderlying
bean found in fieldorg.jetbrains.kotlin.gradle.utils.MutableObservableSetImpl
ofcompilations
bean found in fieldorg.jetbrains.kotlin.gradle.plugin.sources.DefaultKotlinSourceSet
ofunderlying
bean found in fieldorg.jetbrains.kotlin.gradle.utils.MutableObservableSetImpl
ofdependsOnClosureImpl
bean found in fieldorg.jetbrains.kotlin.gradle.plugin.sources.DefaultKotlinSourceSet
ofvalue
bean found in fieldorg.jetbrains.kotlin.tooling.core.Extras$Entry
ofextras
bean found in fieldorg.jetbrains.kotlin.tooling.core.MutableExtrasImpl
ofextras
bean found in fieldorg.jetbrains.kotlin.gradle.plugin.mpp.compilationImpl.KotlinCompilationImpl
of$$delegate_0
bean found in fieldorg.jetbrains.kotlin.gradle.targets.js.ir.KotlinJsIrCompilation
ofcompilation
bean found in fieldorg.jetbrains.kotlin.gradle.targets.js.npm.resolver.KotlinCompilationNpmResolver
ofbyCompilation
bean found in fieldorg.jetbrains.kotlin.gradle.targets.js.npm.resolver.KotlinProjectNpmResolver
ofprojectResolvers
bean found in fieldorg.jetbrains.kotlin.gradle.targets.js.npm.resolver.KotlinRootNpmResolver
ofresolver
bean found in fieldorg.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtension
ofnodeJs
bean found in fieldorg.jetbrains.kotlin.gradle.targets.js.ir.KotlinBrowserJsIr
ofvalue
bean found in fieldkotlin.InitializedLazyImpl
ofbrowser$delegate
bean found in fieldorg.jetbrains.kotlin.gradle.targets.js.ir.KotlinJsIrTarget
ofthis$0
bean found in fieldorg.jetbrains.kotlin.gradle.targets.js.ir.KotlinJsIrTarget$commonLazy$2$1$1
ofval$action
bean found in fieldorg.gradle.internal.code.DefaultUserCodeApplicationContext$CurrentApplication$1
ofdelegate
bean found in fieldorg.gradle.api.internal.DefaultCollectionCallbackActionDecorator$BuildOperationEmittingAction
ofval$action
bean found in fieldorg.gradle.api.internal.collections.CollectionFilter$1
ofmultipleActions
bean found in fieldorg.gradle.internal.ImmutableActionSet$SetWithManyActions
ofaddActions
bean found in fieldorg.gradle.api.internal.collections.DefaultCollectionEventRegister
ofeventRegister
bean found in fieldorg.gradle.api.internal.DefaultDomainObjectSet
of$$delegate_0
bean found in fieldorg.jetbrains.kotlin.gradle.targets.js.ir.KotlinJsBinaryContainer
ofbinaries
bean found in fieldorg.jetbrains.kotlin.gradle.targets.js.ir.KotlinJsIrCompilation
ofcompilation
bean found in fieldorg.jetbrains.kotlin.gradle.targets.js.ir.Library
of$this_configureEach
bean found in fieldcom.hcl.mainframe.project.gradle.plugins.ProjectModuleExtension$js$3$3$1$2
ofaction
bean found in fieldorg.gradle.api.internal.AbstractTask$TaskActionWrapper
of taskactions
of 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 AMDefaultUnlockedConfiguration
Vampire
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 doLast
Vampire
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.