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

StackOverflowError on kotlin multiplatform module dokkaHtmlMultimodule #2853

Closed
yamilmedina opened this issue Feb 10, 2023 · 4 comments
Closed
Labels

Comments

@yamilmedina
Copy link

yamilmedina commented Feb 10, 2023

Describe the bug
We are working on a Kotlin multiplatform project and been using Dokka for our documentation since the beginning, but now we are having issues as the project grew. Specifically, a StackOverflowError error leading to a failure.

Expected behaviour
We can execute dokkaHtmlMultimodule without OOM exceptions.

Screenshots
If applicable, add screenshots to help explain your problem

To Reproduce
You can have a look into our ghactions execution.
https://github.com/wireapp/kalium/actions/runs/4136039323/jobs/7149323719

Dokka configuration
Configuration of dokka used to reproduce the bug

tasks.withType(AbstractDokkaLeafTask::class.java).configureEach {
        dokkaSourceSets.configureEach {
            file("module.md").takeIf { it.exists() }?.let {
                includes.from(it)
            }
            includes.from(rootProject.file("dokka/moduledoc.md").path)
            samples.from(rootProject.file("samples"))
            includeNonPublic.set(true)
            documentedVisibilities.set(listOf(Visibility.PUBLIC, Visibility.INTERNAL))
       }
 }      

You can have a look, as the project is opensource into: https://github.com/wireapp/kalium/blob/develop/buildSrc/src/main/kotlin/com/wire/kalium/plugins/CommonDokkaConfig.kt

Installation

  • Operating system: macOS 12
  • Build tool: Gradle v7.5.1
  • Dokka version: 1.7.20

Additional context
The specific target failing is always :network:compileCommonMainKotlinMetadata if I run locally 2 things can provide more info:

  • When executed with --stacktrace we get a: java.lang.StackOverflowError underneath.
  • If we run the task to generate docs for a module with fewer dependencies, example just the same :network:dokkaHtmlPartial the documentation succeeds.
  • Also I tried some of the things mentioned here dokkaJavadocJar fires "java.lang.OutOfMemoryError: Metaspace" #1405 without success.

Are you willing to provide a PR?
Yes

@yamilmedina yamilmedina changed the title Stackoverflow on kotlin multiplatform module dokkaHtmlMultimodule StackOverflowError on kotlin multiplatform module dokkaHtmlMultimodule Feb 10, 2023
@yamilmedina
Copy link
Author

Hello, Do you have any pointers on this? I will try to find some time this week to take a look and gather more info.

@IgnatBeresnev
Copy link
Member

IgnatBeresnev commented Mar 27, 2023

Hi! It's quite difficult to say as compileCommonMainKotlinMetadata is from the compiler, not Dokka itself. If you could debug it more and try to narrow it down, it'd be great

Try running it without the configuration first, and if it works - try introducing each configuration property one by one. Maybe it'll be narrowed done to something specific like samples, which should give us more to work with

If running ./gradlew :network:compileCommonMainKotlinMetadata fails, try removing Dokka altogether and running it again. If it fails, then I guess Dokka is not at fault here, the issue might be with KGP or something else. If this is the case, the problem might be with the project configuration

@yamilmedina
Copy link
Author

I'm closing this one as we brought it back, with the help of using:

cacheRoot.set(file("default"))

and setting and explicit classpath dependency

classpath.from(file("location of dependency"))

Thanks anyway for the help and pointers, was useful to gather more debugging insights @IgnatBeresnev

@IgnatBeresnev
Copy link
Member

cacheRoot.set(file("default"))

It's interesting that it helped because this configuration property is not used by Dokka at all, as far as I know 😅

But I'm glad you were able to resolve it

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

No branches or pull requests

2 participants