Skip to content

build: bump R8 to 9.1.31 for Kotlin 2.3 metadata parsing#143

Open
OmarAlJarrah wants to merge 1 commit into
mainfrom
build/toolchain-and-r8-bumps
Open

build: bump R8 to 9.1.31 for Kotlin 2.3 metadata parsing#143
OmarAlJarrah wants to merge 1 commit into
mainfrom
build/toolchain-and-r8-bumps

Conversation

@OmarAlJarrah

Copy link
Copy Markdown
Member

Problem

The test-only sdk-shrink-test module pinned R8 8.9.35. That R8 line's
Kotlin-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/Warning lines reporting that it could not parse the Kotlin 2.3
@Metadata annotations.

The shrunk output stayed correct — @Metadata is retained via the shipped
-keepattributes RuntimeVisibleAnnotations / -keep class kotlin.Metadata
rules, 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 r8 version in gradle/libs.versions.toml from 8.9.35 to
9.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 --lib boot
image in sdk-shrink-test are 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; the
    shrunk consumer printed the SHRINK-SURVIVAL-OK sentinel.
  • ./gradlew :sdk-shrink-test:r8Shrink --rerun-tasks --no-daemon then
    grepping the output for metadata / cannot parse / Kotlin Info/Warning
    lines — none emitted by R8. The shrink run is now quiet, confirming the
    bump resolves the metadata-parse noise.

Closes #112

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
@OmarAlJarrah

Copy link
Copy Markdown
Member Author

Straightforward dependency bump: R8 goes from 8.9.35 to 9.1.31 in gradle/libs.versions.toml, with a comment explaining that the older 8.9.x metadata parser topped out at Kotlin 2.1 and emitted noise now that we compile with 2.3.21. Looks good to merge.

The change is scoped to the single version-catalog entry and only affects the test-only sdk-shrink-test shrink-survival guard; no source, public API, or build logic is touched. The version is a real published R8 release on Google's Maven repo, the catalog edit is well-formed, and the added comment documents the motivation for the next person who looks at this line.

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.

Bump R8 past 8.9.35 so it can parse Kotlin 2.3 class metadata

1 participant