build: update Kotlin to 2.2.21 and Poko to 0.20.2 - #3934
Conversation
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
Warning Review the following alerts detected in dependencies. According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.
|
640e523 to
9b70724
Compare
📸 Snapshot Test621 unchanged
🛸 Powered by Emerge Tools |
9b70724 to
9e311bd
Compare
9e311bd to
c2650cd
Compare
tonidero
left a comment
There was a problem hiding this comment.
Nice!! 🙇 Thank you thank you!
|
|
||
| implementation(platform(libs.compose.bom)) | ||
| implementation(libs.compose.ui) | ||
| implementation(libs.compose.foundation.layout) |
There was a problem hiding this comment.
Hmm I wonder if the need of doing this should be considered a breaking change... I guess it would be mostly fine, as long as folks were mostly able to make it work without it... But I wonder if we should include/expose this from our ui module...
There was a problem hiding this comment.
This is not a breaking change (not anymore than it already was, I mean), it hasn't hit us for the same reasons as: #3916, basically everyone who ships an android nowadays transitively includes compose.foundation.layout anyway.
But we should expose it in the UI module to make it explicit, separate PR incoming.
|
Waiting for #3947 merge (which fixes maestro broken on this branch) |
985d606 to
e9f498e
Compare
| recyclerview = "1.2.1" | ||
| roboelectric = "4.16" | ||
| kotlin = "2.0.21" | ||
| kotlin = "2.2.10" |
There was a problem hiding this comment.
Stdlib bump breaks older consumers
High Severity
Bumping kotlin to 2.2.10 while leaving kotlinLanguage at 1.8 still publishes kotlin-stdlib:2.2.10 (compile scope) via the Kotlin Gradle Plugin. Consumers on Kotlin 2.0.x and below then fail with incompatible metadata errors—the same issue that forced the sdksizetesting bump—so the advertised Kotlin 1.8 minimum is no longer accurate.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit e9f498e. Configure here.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## fix/expose-compose-foundation-layout #3934 +/- ##
========================================================================
+ Coverage 82.68% 82.72% +0.03%
========================================================================
Files 425 425
Lines 17475 17472 -3
Branches 2629 2629
========================================================================
+ Hits 14450 14453 +3
+ Misses 2138 2132 -6
Partials 887 887 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
e9f498e to
0912ec0
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
There are 2 total unresolved issues (including 1 from previous review).
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 0912ec0. Configure here.
| # Can't use alpha04 because it requires higher Kotlin version than we're using | ||
| paparrazzi = "2.0.0-alpha02" | ||
| poko = "0.17.2" | ||
| poko = "0.20.2" |
There was a problem hiding this comment.
Unsupported Kotlin and Poko pairing
Medium Severity
kotlin 2.2.10 is paired with poko 0.20.2, but Poko 0.20.0+ dropped Kotlin 2.2.10 support due to incompatibility and targets 2.2.20+. @Poko types in public modules may hit IR-plugin failures or incorrect generated equals/hashCode/toString. Poko 0.19.3 matches 2.2.10, or Kotlin can move to 2.2.21 with 0.20.2.
Reviewed by Cursor Bugbot for commit 0912ec0. Configure here.
Poko 0.20.0 dropped support for Kotlin 2.2.0 and 2.2.10 due to incompatibility, and 0.20.2 is compiled against 2.2.21, so the two have to move together.
test-apps/sdksizetesting is a standalone Gradle build that consumes the locally published SDK artifacts, and it pinned its own Kotlin at 2.0.21. Once the SDK is built with 2.2.10 it pulls in kotlin-stdlib 2.2.x, whose metadata a 2.0.x compiler cannot read: kotlin-stdlib-2.2.21.jar!/META-INF/kotlin-stdlib.kotlin_module Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 2.2.0, expected version is 2.0.0. That broke the emerge_size_analysis_tests job, which runs publishToMavenLocal and then builds this app. The other standalone builds (examples/MagicWeather, MagicWeatherCompose, CustomEntitlementComputationSample) stay on their older Kotlin versions: they are not built in the PR workflow, and keeping them there is what exercises the SDK's older-Kotlin-consumer compatibility.
0912ec0 to
1382809
Compare
|
Further testing reveals we actually need kotlin 2.3+ for proper AGP + our supporting plugins compatibility, so this intermediate step is uesless |


Part of the AGP 9 upgrade pre-work. Bumps Kotlin 2.0.21 to 2.2.21 and Poko 0.17.2 to 0.20.2.
kotlin-stdlibat the compiler version incompilescope, so consumers on an older Kotlin fail withModule was compiled with an incompatible version of Kotlin. The binary version of its metadata is 2.2.0, expected version is 2.0.0. This effectively raises the minimum Kotlin a consumer needs.kotlinLanguagestays at1.8, but note that only sets our ownlanguageVersion/apiVersion. It does not govern the stdlib we publish, so it does not keep the above caveat away.test-apps/sdksizetestingmoves to the same Kotlin version. It consumes the locally published artifacts, so it is a worked example of the consumer break described above rather than an unrelated tweak.dokka-hide-internalthat existed only because the repo's Kotlin was older than Dokka's analysis Kotlin; they now match.api-testerworkaround this PR used to carry is gone, because fix(paywalls): Expose compose-foundation-layout so PaywallFooter is callable without extra setup #3961 exportscompose-foundation-layoutfrom:ui:revenuecatuiproperly.Checklist
purchases-iosand hybridsAgent description
Motivation
Part of the AGP 9 upgrade, split into small independently-shippable PRs. Poko 0.17.2's IR compiler
plugin crashes under the Kotlin 2.2 compiler (
NoSuchMethodError: irEqeqeq), so the two versionbumps have to land together.
The exact pairing matters. Poko's changelog for 0.20.0 says "Compile with Kotlin 2.2.20. Drop
support for Kotlin 2.2.0 and 2.2.10 due to incompatibility", and 0.20.2 is compiled with 2.2.21.
An earlier revision of this PR paired Kotlin 2.2.10 with Poko 0.20.2, which built and tested green
but is an unsupported combination upstream. Poko is an IR plugin, so the failure modes are a loud
NoSuchMethodErroror silently wrong generatedequals/hashCode/toString, across 111@Pokotypes in published modules. Moving Kotlin to 2.2.21 puts us on the combination Poko actually
targets.
The Kotlin compiler version and the Kotlin language/API level (
kotlinLanguage) areseparate knobs in this build (
ConfigureAndroidLibrary.kt): every library module setslanguageVersion/apiVersionfromkotlinLanguage, not from the compiler version. This PR bumpsonly the compiler and leaves
kotlinLanguage = "1.8".That does not make the change invisible to consumers, and an earlier revision of this
description wrongly claimed it did. The Kotlin Gradle Plugin publishes
kotlin-stdlibat thecompiler version in
compilescope, Gradle resolves the highest version, and an older consumercompiler then cannot read that stdlib's metadata.
sdksizetestinghit exactly this and needed itsown Kotlin bumped to keep consuming the SDK. The practical minimum Kotlin for consumers therefore
moves with this PR, which is being tracked for the release that carries it.
Description
test-apps/sdksizetestingKotlin bumped to match, so it can still read the SDK's metadata.dokka-hide-internalstdlib pin removed.Ordering note
This PR was originally stacked on #3935 (Metalava 0.4.0-alpha03 to 0.5.0), which has since merged.
Metalava was split out because it stands on its own, but the order mattered and both ways were
tested directly. With Metalava still at 0.4.0-alpha03, bumping Kotlin alone produces a small but
real
api*.txtdiff: Metalava cannot parse Kotlin 2.2's metadata format and silently drops thethrowsclause it synthesizes from@Throwson at least one method. The compiled bytecode wasconfirmed unaffected via
javap, but the tracked signature file loses it. With Metalava bumpedfirst, this combination produces zero
api*.txtdiff.Testing
scripts/api-check.shclean with zero signature diff.:purchasesunit tests green,detektAllclean.:purchases,:ui:revenuecatui,:feature:admob,:feature:galaxy) to confirm the IR-plugin crash does not reproduce.:api-testercompiles with no Compose layout dependency of its own, which is the end to endcheck that fix(paywalls): Expose compose-foundation-layout so PaywallFooter is callable without extra setup #3961 underneath this branch does its job.