modules-graph-assert icon indicating copy to clipboard operation
modules-graph-assert copied to clipboard

Creating a dependency cycle with `assertOnAnyBuild` enabled results in an unhelpful error message

Open matejdro opened this issue 1 year ago • 1 comments

When creating a dependency cycle between two modules and assertOnAnyBuild = true, configuration will fail with unhelpful StackOverflowError error message.

Failed to notify build listener.
> java.lang.StackOverflowError (no error message)

* Try:
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.

* Exception is:
org.gradle.internal.event.ListenerNotificationException: Failed to notify build listener.
	...
Caused by: java.lang.StackOverflowError
	at com.jraska.module.graph.DependencyGraph.addConnections(DependencyGraph.kt:84)
	at com.jraska.module.graph.DependencyGraph.addConnections(DependencyGraph.kt:84)
	at com.jraska.module.graph.DependencyGraph.addConnections(DependencyGraph.kt:84)
	at com.jraska.module.graph.DependencyGraph.addConnections(DependencyGraph.kt:84)
	at com.jraska.module.graph.DependencyGraph.addConnections(DependencyGraph.kt:84)
	at com.jraska.module.graph.DependencyGraph.addConnections(DependencyGraph.kt:84)
	at com.jraska.module.graph.DependencyGraph.addConnections(DependencyGraph.kt:84)
	at com.jraska.module.graph.DependencyGraph.addConnections(DependencyGraph.kt:84)
	at com.jraska.module.graph.DependencyGraph.addConnections(DependencyGraph.kt:84)
	at com.jraska.module.graph.DependencyGraph.addConnections(DependencyGraph.kt:84)
	at com.jraska.module.graph.DependencyGraph.addConnections(DependencyGraph.kt:84)
	at com.jraska.module.graph.DependencyGraph.addConnections(DependencyGraph.kt:84)
	at com.jraska.module.graph.DependencyGraph.addConnections(DependencyGraph.kt:84)
	at com.jraska.module.graph.DependencyGraph.addConnections(DependencyGraph.kt:84)
	at com.jraska.module.graph.DependencyGraph.addConnections(DependencyGraph.kt:84)
	at com.jraska.module.graph.DependencyGraph.addConnections(DependencyGraph.kt:84)
	at com.jraska.module.graph.DependencyGraph.addConnections(DependencyGraph.kt:84)
	at com.jraska.module.graph.DependencyGraph.addConnections(DependencyGraph.kt:84)

Without it enabled, gradle will print helpful error message describing exactly which modules are causing the cycle.

matejdro avatar May 09 '24 10:05 matejdro