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

Compilation fails on prepareDokkatooParametersJavadoc on gradle 8.1.1 #82

Closed
Nek-12 opened this issue May 29, 2023 · 5 comments · Fixed by #114
Closed

Compilation fails on prepareDokkatooParametersJavadoc on gradle 8.1.1 #82

Nek-12 opened this issue May 29, 2023 · 5 comments · Fixed by #114
Labels
affects:kotlin-native Affects Kotlin/Native projects bug Something isn't working documentation Improvements or additions to documentation

Comments

@Nek-12
Copy link

Nek-12 commented May 29, 2023

Some problems were found with the configuration of task ':project:prepareDokkatooParametersJavadoc' (type 'DokkatooPrepareParametersTask').
  - Gradle detected a problem with the following location: '/project/.gradle/kotlin/kotlinTransformedCInteropMetadataLibraries/org.jetbrains.kotlinx-atomicfu-0.20.2-nativeMain-cinterop/org.jetbrains.kotlinx_atomicfu-cinterop-interop-nfvfsw.klib'.
    
    Reason: Task ':apiresult:prepareDokkatooParametersJavadoc' uses this output of task ':project2:transformIosMainCInteropDependenciesMetadataForIde' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed.
    
    Possible solutions:
      1. Declare task ':project2:transformIosMainCInteropDependenciesMetadataForIde' as an input of ':project:prepareDokkatooParametersJavadoc'.
      2. Declare an explicit dependency on ':project2:transformIosMainCInteropDependenciesMetadataForIde' from ':project:prepareDokkatooParametersJavadoc' using Task#dependsOn.
      3. Declare an explicit dependency on ':project2:transformIosMainCInteropDependenciesMetadataForIde' from ':project:prepareDokkatooParametersJavadoc' using Task#mustRunAfter.
    
    Please refer to https://docs.gradle.org/8.1.1/userguide/validation_problems.html#implicit_dependency for more details about this problem.

gradle.properties includes:

kotlin.mpp.enableCInteropCommonization=true
kotlin.mpp.stability.nowarn=true
org.gradle.unsafe.configuration-cache=true
@Nek-12
Copy link
Author

Nek-12 commented May 29, 2023

I expected that dokkatoo does not suffer from Kotlin/dokka#2977 when I was migrating to it
Disabling C InteropCommonization fixes the issue

@aSemy
Copy link
Contributor

aSemy commented May 29, 2023

Hey, thanks for the report.

By my understanding this is a Kotlin Gradle Plugin issue. KGP is defining a Gradle Task :project2:transformIosMainCInteropDependenciesMetadataForIde but not properly declaring the output files, which leads to Gradle having issues.

I'm reluctant to try putting a workaround in the codebase, but perhaps the workaround you've found could be documented.

As well as disabling commonization, could you try the workaround in the Redwood project and report back?

https://github.com/cashapp/redwood/blob/3be2d1b3947866c5e16008823ff1eacaef627823/build.gradle#L100-L113

@aSemy aSemy added bug Something isn't working affects:kotlin-native Affects Kotlin/Native projects labels May 29, 2023
@Nek-12
Copy link
Author

Nek-12 commented May 29, 2023

Yes, I have tried it, it does not produce consistent results for my purposes (javadocs are produced during compilation as a dependency of publishToMavenLocal). But thanks for your response.

@Nek-12 Nek-12 closed this as not planned Won't fix, can't repro, duplicate, stale May 29, 2023
@Nek-12
Copy link
Author

Nek-12 commented May 29, 2023

I'm not sure if this issue should be open here, but at a second thought, I'll keep it open just in case. Feel free to close this as you see fit

@Nek-12 Nek-12 reopened this May 29, 2023
@aSemy
Copy link
Contributor

aSemy commented Jun 4, 2023

For now I'm happy to leave this open in lieu of writing proper documentation. I think that this problem with be fixed with Kotlin 1.9.0, as the Kotlin Gradle Plugin should be completely compatible with Gradle Config cache.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects:kotlin-native Affects Kotlin/Native projects bug Something isn't working documentation Improvements or additions to documentation
Projects
None yet
2 participants