Skip to content

Implicit task dependency when using Gradle 8 + KMP custom cinterop #2977

@chrisbanes

Description

@chrisbanes

Describe the bug
You can see the issue here: cashapp/redwood#823. We're trying to upgrade from Gradle 7.6 -> 8.x and see implicit task dependency issues:

- Gradle detected a problem with the following location: '/Users/runner/work/redwood/redwood/.gradle/kotlin/kotlinTransformedCInteropMetadataLibraries/app.cash.zipline-zipline-0.9.17-nativeMain-cinterop/app.cash.zipline_zipline-cinterop-quickjs-wkj8jQ.klib'.
    
    Reason: Task ':redwood-treehouse:dokkaHtmlPartial' uses this output of task ':redwood-protocol-widget: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 ':redwood-protocol-widget:transformIosMainCInteropDependenciesMetadataForIde' as an input of ':redwood-treehouse:dokkaHtmlPartial'.
      2. Declare an explicit dependency on ':redwood-protocol-widget:transformIosMainCInteropDependenciesMetadataForIde' from ':redwood-treehouse:dokkaHtmlPartial' using Task#dependsOn.
      3. Declare an explicit dependency on ':redwood-protocol-widget:transformIosMainCInteropDependenciesMetadataForIde' from ':redwood-treehouse:dokkaHtmlPartial' using Task#mustRunAfter.

To Reproduce

git clone https://github.com/cashapp/redwood.git -b renovate/gradle-8.x
cd redwood
./gradlew dokkaHtmlMultiModule

If we remove kotlin.mpp.enableCInteropCommonization=true from gradle.properties, dokkaHtmlMultiModule then builds successfully

Dokka configuration
https://github.com/cashapp/redwood/blob/trunk/build.gradle#L119

Installation

  • Operating system: Linux and MacOS
  • Build tool: Gradle v8.0.2
  • Dokka version: 1.8.10

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions