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

Update dependency gradle to v8 #823

Merged
merged 2 commits into from
Apr 25, 2023
Merged

Update dependency gradle to v8 #823

merged 2 commits into from
Apr 25, 2023

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Feb 13, 2023

Mend Renovate

This PR contains the following updates:

Package Update Change
gradle (source) major 7.6.1 -> 8.1.1

Release Notes

gradle/gradle

v8.1.1: 8.1.1

This is a patch release for Gradle 8.1. We recommend using 8.1.1 instead of 8.1.

It fixes the following issues:

  • #​24748 MethodTooLargeException when instrumenting a class with thousand of lambdas for configuration cache
  • #​24754 Kotlin DSL precompiled script plugins built with Gradle 8.1 cannot be used with other versions of Gradle
  • #​24788 Gradle 8.1 configure freeCompilerArgs for Kotlin in buildSrc breaks build with unhelpful errors

Read the Release Notes

Upgrade Instructions

Switch your build to use Gradle 8.1.1 by updating your wrapper:

./gradlew wrapper --gradle-version=8.1.1

See the Gradle 8.x upgrade guide to learn about deprecations, breaking changes and other considerations when upgrading to Gradle 8.1.1.

Reporting Problems

If you find a problem with this release, please file a bug on GitHub Issues adhering to our issue guidelines.
If you're not sure you're encountering a bug, please use the forum.

v8.0.2: 8.0.2

The Gradle team is excited to announce Gradle 8.0.2.

This is the second patch release for Gradle 8.0. We recommend using 8.0.2 instead of 8.0.

It fixes the following issues:

  • #​23698 Gradle 8 RC2 runs out of metaspace
  • #​23962 Java/Scala build with no explicit toolchain: build fails with Gradle 8.0.1 / Scala 2.13
  • #​23990 Gradle 8.0.+ silently dropped support for custom compilers in JavaCompile
  • #​24031 InstrumentingTransformer generates different class files in Gradle 8 and 7.6 which leads to Remote Build-Cache misses
  • #​24109 Extending an already resolved configuration no longer works correctly
  • #​24122 Update configuration cache state for some plugins
  • #​24129 includeBuild in PluginManagementSpec deincubated in Gradle 8, docs still say it's incubating

Issues fixed in the first patch release:

  • #​21551 Document integration of Scala plugin with toolchains and problems with target flag
  • #​23888 --no-rebuild suddenly gone without new deprecation cycle and without the reason for its undeprecation being void
  • #​23905 Gradle 8.0 fails Scala build with isBlank not found in String class error

Read the Release Notes

Upgrade Instructions

Switch your build to use Gradle 8.0.2 by updating your wrapper:

./gradlew wrapper --gradle-version=8.0.2

See the Gradle 7.x upgrade guide to learn about deprecations, breaking changes and other considerations when upgrading to Gradle 8.0.2.

Reporting Problems

If you find a problem with this release, please file a bug on GitHub Issues adhering to our issue guidelines.
If you're not sure you're encountering a bug, please use the forum.

v8.0.1: 8.0.1

This is a patch release for 8.0. We recommend using 8.0.1 instead of 8.0.

It fixes the following issues:

  • #​21551 - Document integration of Scala plugin with toolchains and problems with target flag
  • #​23888 - --no-rebuild suddenly gone without new deprecation cycle and without the reason for its undeprecation being void
  • #​23905 - Gradle 8.0 fails Scala build with isBlank not found in String class error

Read the Release Notes

Upgrade Instructions

Switch your build to use Gradle 8.0.1 by updating your wrapper:

./gradlew wrapper --gradle-version=8.0.1

See the Gradle 7.x upgrade guide to learn about deprecations, breaking changes and other considerations when upgrading to Gradle 8.0.1.

Reporting Problems

If you find a problem with this release, please file a bug on GitHub Issues adhering to our issue guidelines.
If you're not sure you're encountering a bug, please use the forum.


Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Mend Renovate. View repository job log here.

@renovate renovate bot force-pushed the renovate/gradle-8.x branch 2 times, most recently from 9f6059b to 383963a Compare February 24, 2023 18:48
@renovate renovate bot force-pushed the renovate/gradle-8.x branch 3 times, most recently from e171ab7 to 9add354 Compare March 22, 2023 18:32
@dellisd dellisd enabled auto-merge (squash) March 22, 2023 19:20
@dellisd dellisd disabled auto-merge March 22, 2023 19:20
@dellisd dellisd enabled auto-merge (squash) March 22, 2023 19:20
@dellisd
Copy link
Collaborator

dellisd commented Mar 27, 2023

The transform[SourceSet]CInteropDependenciesMetadataForIde tasks that dokka is implicitly depending on come from the Kotlin gradle plugin, but the specific files that it's unhappy about seem to be the ones created by cklib in Zipline. Not sure what to do off the top of my head (other than adding possibly dozens of explicit task dependency declarations which is very non-ideal here).

@JakeWharton
Copy link
Collaborator

cklib in Zipline? We also use cklib, but I don't see how it could have anything to do with tasks from another project. Or are you saying it's tasks in this project which result from the usage of Zipline and those are the problematic ones?

@dellisd
Copy link
Collaborator

dellisd commented Mar 27, 2023

This is the error:

- 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.

It seems to take issue with the cinterop klibs that are pulled in from the zipline dependency.

@JakeWharton
Copy link
Collaborator

I can pare down a reproducer when I'm off parental leave. Not sure we have much choice here as we can't stay on an old version forever. I guess we'll wait as long as we can.

@colinrtwhite
Copy link
Member

colinrtwhite commented Apr 18, 2023

I think this'll be unblocked by #889 as we remove the dependency on cklib.

@JakeWharton
Copy link
Collaborator

JakeWharton commented Apr 18, 2023

Still broken with Dokka task dependencies. Maybe time to try Dokkatoo instead?

@colinrtwhite
Copy link
Member

Yeah it does seem like Dokkatoo is a good idea. The Dokka Gradle plugin has been a consistent issue. IIRC the Gradle plugin is also planning to use Dokka through Dokkatoo.

@colinrtwhite
Copy link
Member

@chrisbanes Want to migrate us over to Dokkatoo in a separate PR? Hopefully that'll unblock this one.

@chrisbanes
Copy link
Contributor

chrisbanes commented Apr 24, 2023

Spent a hour or 2 this afternoon digging into this more. If I turn off kotlin.mpp.enableCInteropCommonization then everything starts working again, so it looks to me like the Dokka (or maybe KMP plugin) is doing some interesting things.

Dokkatoo is a bit of a dead-end right now as it doesn't seem to be finding all of the source sets (see adamko-dev/dokkatoo#57). My guess is that the issue which is blocking us from upgrading Gradle (some hardcoded task inputs?), is exactly the thing which enables Dokka to properly document KMP projects. I'll create an issue on the Dokka tracker and see what they say.

@aSemy
Copy link

aSemy commented Apr 25, 2023

- 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.

I'm inclined to believe this is caused by improper configuration in the Kotlin Gradle Plugin. The transformXYZCInteropDependenciesMetadataForIde task is dumping files into a directory, and some other task is using those same files.

This is not an easy problem to fix (or at least, not an easy problem to figure out how to fix - KGP is complicated!). The task is breaking project-isolation and not sharing files using Configurations.

So, as a workaround, the task can be manually disabled

// build.gradle.kts

tasks.matching {
  "CInteropMetadataDependencyTransformationTask" in (it::class.qualifiedName ?: "")
}.configureEach {
  enabled = false
}

Perhaps there's a clever way of disabling the task when the documentation is being generated?

// build.gradle.kts

tasks.matching {
  "CInteropMetadataDependencyTransformationTask" in (it::class.qualifiedName ?: "")
}.configureEach {
  // disable the IDE task when generating documentation
  enabled = gradle.taskGraph.allTasks.none {
    it is org.jetbrains.dokka.gradle.AbstractDokkaTask
  }
}

@chrisbanes
Copy link
Contributor

Thanks for the pointers @aSemy! I totally forgot about gradle.taskGraph.

I think this should go green. Dokka builds fine locally for me with this.

@dellisd dellisd merged commit 4daf151 into trunk Apr 25, 2023
@dellisd dellisd deleted the renovate/gradle-8.x branch April 25, 2023 15:59
@cashapp cashapp deleted a comment from renovate bot Apr 25, 2023
@JakeWharton
Copy link
Collaborator

Sweet! Thanks for all the help too, @aSemy.

@aSemy
Copy link

aSemy commented Apr 25, 2023

Happy to help!

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.

5 participants