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

Stack overflow when used in conjunction with latest KSP #19

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

trevjonez
Copy link

Looks like the configuration creation gets into a feedback loop with KSP.

I am not sure if this should be fixed here, in KGP, or in KSP yet.

In order to reproduce the issue, you need only attempt to run a sync on the project.

Cause: java.lang.StackOverflowError
	at jdk.internal.reflect.GeneratedConstructorAccessor45.newInstance(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at org.gradle.internal.instantiation.generator.AsmBackedClassGenerator$InvokeConstructorStrategy.newInstance(AsmBackedClassGenerator.java:1913)
	at org.gradle.internal.instantiation.generator.AbstractClassGenerator$GeneratedClassImpl$GeneratedConstructorImpl.newInstance(AbstractClassGenerator.java:506)
	at org.gradle.internal.instantiation.generator.DependencyInjectingInstantiator.doCreate(DependencyInjectingInstantiator.java:64)
	at org.gradle.internal.instantiation.generator.DependencyInjectingInstantiator.newInstance(DependencyInjectingInstantiator.java:55)
	at org.gradle.api.internal.artifacts.configurations.DefaultConfigurationFactory.create(DefaultConfigurationFactory.java:115)
	at org.gradle.api.internal.artifacts.configurations.DefaultConfigurationContainer.newConfiguration(DefaultConfigurationContainer.java:135)
	at org.gradle.api.internal.artifacts.configurations.DefaultConfigurationContainer.doCreate(DefaultConfigurationContainer.java:88)
	at org.gradle.api.internal.artifacts.configurations.DefaultConfigurationContainer.doCreate(DefaultConfigurationContainer.java:52)
	at org.gradle.api.internal.AbstractNamedDomainObjectContainer.create(AbstractNamedDomainObjectContainer.java:78)
	at org.gradle.api.internal.AbstractValidatingNamedDomainObjectContainer.create(AbstractValidatingNamedDomainObjectContainer.java:47)
	at org.gradle.api.internal.AbstractNamedDomainObjectContainer.create(AbstractNamedDomainObjectContainer.java:56)
	at org.gradle.api.internal.AbstractNamedDomainObjectContainer.maybeCreate(AbstractNamedDomainObjectContainer.java:65)
	at org.jetbrains.kotlin.gradle.plugin.sources.KotlinSourceSetFactory.defineSourceSetConfigurations(KotlinSourceSetFactory.kt:43)
	at org.jetbrains.kotlin.gradle.plugin.sources.KotlinSourceSetFactory.setUpSourceSetDefaults(KotlinSourceSetFactory.kt:38)
	at org.jetbrains.kotlin.gradle.plugin.sources.DefaultKotlinSourceSetFactory.setUpSourceSetDefaults(KotlinSourceSetFactory.kt:74)
	at org.jetbrains.kotlin.gradle.plugin.sources.DefaultKotlinSourceSetFactory.setUpSourceSetDefaults(KotlinSourceSetFactory.kt:66)
	at org.jetbrains.kotlin.gradle.plugin.sources.KotlinSourceSetFactory.create(KotlinSourceSetFactory.kt:32)
	at org.jetbrains.kotlin.gradle.plugin.sources.KotlinSourceSetFactory.create(KotlinSourceSetFactory.kt:24)
	at org.gradle.api.internal.FactoryNamedDomainObjectContainer.doCreate(FactoryNamedDomainObjectContainer.java:93)
	at org.gradle.api.internal.AbstractNamedDomainObjectContainer.create(AbstractNamedDomainObjectContainer.java:78)
	at org.gradle.api.internal.AbstractNamedDomainObjectContainer.create(AbstractNamedDomainObjectContainer.java:56)
	at com.google.devtools.ksp.gradle.KspGradleSubplugin.applyToCompilation(KspSubplugin.kt:270)
	at org.jetbrains.kotlin.gradle.plugin.SubpluginEnvironment.addSubpluginOptions(SubpluginEnvironment.kt:50)
	at org.jetbrains.kotlin.gradle.plugin.Kotlin2JvmSourceSetProcessor$doTargetSpecificProcessing$2.invoke(KotlinPlugin.kt:199)
	at org.jetbrains.kotlin.gradle.plugin.Kotlin2JvmSourceSetProcessor$doTargetSpecificProcessing$2.invoke(KotlinPlugin.kt:195)
	at org.jetbrains.kotlin.gradle.plugin.KotlinMultiplatformPluginKt.whenEvaluated(KotlinMultiplatformPlugin.kt:204)
	at org.jetbrains.kotlin.gradle.plugin.Kotlin2JvmSourceSetProcessor.doTargetSpecificProcessing(KotlinPlugin.kt:195)
	at org.jetbrains.kotlin.gradle.plugin.KotlinSourceSetProcessor.run(KotlinPlugin.kt:113)
	at org.jetbrains.kotlin.gradle.plugin.AbstractKotlinPlugin$Companion$configureSourceSetDefaults$1.invoke(KotlinPlugin.kt:570)
	at org.jetbrains.kotlin.gradle.plugin.AbstractKotlinPlugin$Companion$configureSourceSetDefaults$1.invoke(KotlinPlugin.kt:568)
	at org.jetbrains.kotlin.gradle.plugin.KotlinPluginKt$sam$org_gradle_api_Action$0.execute(KotlinPlugin.kt)
	at org.gradle.configuration.internal.DefaultUserCodeApplicationContext$CurrentApplication$1.execute(DefaultUserCodeApplicationContext.java:123)
	at org.gradle.api.internal.DefaultCollectionCallbackActionDecorator$BuildOperationEmittingAction$1.run(DefaultCollectionCallbackActionDecorator.java:110)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:29)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:26)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.run(DefaultBuildOperationRunner.java:47)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:68)
	at org.gradle.api.internal.DefaultCollectionCallbackActionDecorator$BuildOperationEmittingAction.execute(DefaultCollectionCallbackActionDecorator.java:107)
	at org.gradle.internal.ImmutableActionSet$SetWithFewActions.execute(ImmutableActionSet.java:285)
	at org.gradle.api.internal.DefaultDomainObjectCollection.doAdd(DefaultDomainObjectCollection.java:262)
	at org.gradle.api.internal.DefaultNamedDomainObjectCollection.doAdd(DefaultNamedDomainObjectCollection.java:113)
	at org.gradle.api.internal.DefaultDomainObjectCollection.add(DefaultDomainObjectCollection.java:251)
	at org.gradle.api.internal.AbstractNamedDomainObjectContainer.create(AbstractNamedDomainObjectContainer.java:79)
	at org.gradle.api.internal.AbstractNamedDomainObjectContainer.create(AbstractNamedDomainObjectContainer.java:56)
	at org.gradle.api.internal.AbstractNamedDomainObjectContainer.maybeCreate(AbstractNamedDomainObjectContainer.java:65)
	at org.jetbrains.kotlin.gradle.plugin.AbstractKotlinPlugin$Companion$setUpJavaSourceSets$1.invoke(KotlinPlugin.kt:494)
	at org.jetbrains.kotlin.gradle.plugin.AbstractKotlinPlugin$Companion$setUpJavaSourceSets$1.invoke(KotlinPlugin.kt:492)
	at org.jetbrains.kotlin.gradle.plugin.KotlinPluginKt$sam$org_gradle_api_Action$0.execute(KotlinPlugin.kt)
	at org.gradle.configuration.internal.DefaultUserCodeApplicationContext$CurrentApplication$1.execute(DefaultUserCodeApplicationContext.java:123)
	at org.gradle.api.internal.DefaultCollectionCallbackActionDecorator$BuildOperationEmittingAction$1.run(DefaultCollectionCallbackActionDecorator.java:110)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:29)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:26)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.run(DefaultBuildOperationRunner.java:47)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:68)
	at org.gradle.api.internal.DefaultCollectionCallbackActionDecorator$BuildOperationEmittingAction.execute(DefaultCollectionCallbackActionDecorator.java:107)
	at org.gradle.internal.ImmutableActionSet$SetWithFewActions.execute(ImmutableActionSet.java:285)
	at org.gradle.api.internal.DefaultDomainObjectCollection.doAdd(DefaultDomainObjectCollection.java:262)
	at org.gradle.api.internal.DefaultNamedDomainObjectCollection.doAdd(DefaultNamedDomainObjectCollection.java:113)
	at org.gradle.api.internal.DefaultDomainObjectCollection.add(DefaultDomainObjectCollection.java:251)
	at org.gradle.api.internal.AbstractNamedDomainObjectContainer.create(AbstractNamedDomainObjectContainer.java:79)
	at org.gradle.api.internal.AbstractValidatingNamedDomainObjectContainer.create(AbstractValidatingNamedDomainObjectContainer.java:47)
	at org.gradle.api.internal.AbstractNamedDomainObjectContainer.create(AbstractNamedDomainObjectContainer.java:56)
	at org.gradle.api.internal.AbstractNamedDomainObjectContainer.maybeCreate(AbstractNamedDomainObjectContainer.java:65)
	at com.slapin.napt.NaptGradlePlugin$applyNaptToJvmProject$1.invoke(NaptGradlePlugin.kt:24)
	at com.slapin.napt.NaptGradlePlugin$applyNaptToJvmProject$1.invoke(NaptGradlePlugin.kt:22)
	at com.slapin.napt.NaptGradlePlugin.applyNaptToJvmProject$lambda$3(NaptGradlePlugin.kt:22)
	at org.gradle.configuration.internal.DefaultUserCodeApplicationContext$CurrentApplication$1.execute(DefaultUserCodeApplicationContext.java:123)
	at org.gradle.api.internal.DefaultCollectionCallbackActionDecorator$BuildOperationEmittingAction$1.run(DefaultCollectionCallbackActionDecorator.java:110)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:29)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:26)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.run(DefaultBuildOperationRunner.java:47)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:68)
	at org.gradle.api.internal.DefaultCollectionCallbackActionDecorator$BuildOperationEmittingAction.execute(DefaultCollectionCallbackActionDecorator.java:107)
	at org.gradle.internal.ImmutableActionSet$SetWithFewActions.execute(ImmutableActionSet.java:285)
	at org.gradle.api.internal.DefaultDomainObjectCollection.doAdd(DefaultDomainObjectCollection.java:262)
	at org.gradle.api.internal.DefaultNamedDomainObjectCollection.doAdd(DefaultNamedDomainObjectCollection.java:113)
	at org.gradle.api.internal.DefaultDomainObjectCollection.add(DefaultDomainObjectCollection.java:251)
	at org.gradle.api.internal.AbstractNamedDomainObjectContainer.create(AbstractNamedDomainObjectContainer.java:79)
	at org.gradle.api.internal.AbstractNamedDomainObjectContainer.create(AbstractNamedDomainObjectContainer.java:56)
	at com.google.devtools.ksp.gradle.KspGradleSubplugin.applyToCompilation(KspSubplugin.kt:270)
	at org.jetbrains.kotlin.gradle.plugin.SubpluginEnvironment.addSubpluginOptions(SubpluginEnvironment.kt:50)

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

Successfully merging this pull request may close these issues.

1 participant