Skip to content

Conversation

@mkruskal-google
Copy link
Member

Because we build lite and core totally separately, they can't both be depended on without producing conflicts. Our kotlin setup has been doing exactly this for a long time though, in order to share code between kotlin and kotlin-lite. Even with this change, it's invalid to depend on both lite and core, because they contain different builds of our boostrapped protos. However, they now share the internal lite_runtime_only target, which kotlin can reuse to share code.

This prevents lite from getting linked into kotlin, allowing kt_jvm_export to properly strip out all classes from the Java runtime.

Fixes #20566

PiperOrigin-RevId: 734375729

Because we build lite and core totally separately, they can't both be depended on without producing conflicts.  Our kotlin setup has been doing exactly this for a long time though, in order to share code between kotlin and kotlin-lite.  Even *with* this change, it's invalid to depend on both lite and core, because they contain different builds of our boostrapped protos.  However, they now share the internal `lite_runtime_only` target, which kotlin can reuse to share code.

This prevents `lite` from getting linked into kotlin, allowing kt_jvm_export to properly strip out all classes from the Java runtime.

Fixes #20566

PiperOrigin-RevId: 734375729
@mkruskal-google mkruskal-google added kotlin back-port Cherrypick PRs to release branches labels Mar 7, 2025
@mkruskal-google mkruskal-google requested review from a team as code owners March 7, 2025 04:20
@mkruskal-google mkruskal-google requested review from googleberg and removed request for a team March 7, 2025 04:20
@mkruskal-google mkruskal-google merged commit 4747628 into 30.x Mar 7, 2025
208 checks passed
@mkruskal-google mkruskal-google deleted the kotlin-odr-30 branch March 7, 2025 17:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

back-port Cherrypick PRs to release branches kotlin

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants