build: bump R8 to 9.1.31 for Kotlin 2.3 metadata parsing#143
build: bump R8 to 9.1.31 for Kotlin 2.3 metadata parsing#143OmarAlJarrah wants to merge 1 commit into
Conversation
The shrink-survival module pinned R8 8.9.35, whose Kotlin-metadata support only covers Kotlin up to 2.1. Since this project compiles with Kotlin 2.3, every R8 shrink run emitted non-fatal Info/Warning lines reporting that it could not parse the 2.3 @metadata annotations. The output stayed correct (the @metadata annotation is retained via the shipped keep-rules and the Jackson kotlin-reflect round-trip passes), but the noise on every run risked masking a genuinely relevant warning. R8 9.1.31 is the current stable release and parses Kotlin 2.3 metadata. It is still Java-11 bytecode, so the JDK-11 launcher and --lib boot image in sdk-shrink-test are unchanged. The shrink run is now quiet. Closes #112
|
Straightforward dependency bump: R8 goes from 8.9.35 to 9.1.31 in The change is scoped to the single version-catalog entry and only affects the test-only |
|
Closing as superseded. The R8 bump to 9.1.31 this PR proposes already landed on main via PR #161 (commit c8e31ae, "build: upgrade Kotlin to 2.4.0 and R8 to 9.1.31"), which bumped R8 to the same version as part of the Kotlin 2.4 upgrade. main now carries r8 = "9.1.31" already, so this branch only conflicts and adds nothing further. |
Problem
The test-only
sdk-shrink-testmodule pinned R88.9.35. That R8 line'sKotlin-metadata support only covers Kotlin up to 2.1, but this project
compiles with Kotlin 2.3. As a result every R8 shrink run emitted non-fatal
Info/Warninglines reporting that it could not parse the Kotlin 2.3@Metadataannotations.The shrunk output stayed correct —
@Metadatais retained via the shipped-keepattributes RuntimeVisibleAnnotations/-keep class kotlin.Metadatarules, and the consumer program's Jackson kotlin-reflect round-trip passes —
but the per-run noise risked masking a genuinely relevant warning.
Change
Bump the
r8version ingradle/libs.versions.tomlfrom8.9.35to9.1.31, the current stable R8 release, which parses Kotlin 2.3 metadata.R8 9.x is still Java-11 bytecode, so the JDK-11 launcher and
--libbootimage in
sdk-shrink-testare unchanged; no build-script edits were needed.Verification
JDK 11 (Microsoft OpenJDK 11.0.28) and network access to Google's Maven repo
were both available, so the shrink pipeline was exercised end to end:
./gradlew :sdk-shrink-test:r8Run --no-daemon— BUILD SUCCESSFUL; theshrunk consumer printed the
SHRINK-SURVIVAL-OKsentinel../gradlew :sdk-shrink-test:r8Shrink --rerun-tasks --no-daemonthengrepping the output for
metadata/cannot parse/ KotlinInfo/Warninglines — none emitted by R8. The shrink run is now quiet, confirming the
bump resolves the metadata-parse noise.
Closes #112