Pin kotlinx-io and kotlinx-serialization to their last Kotlin 2.2 releases - #272
Open
jcopenhop wants to merge 1 commit into
Open
Pin kotlinx-io and kotlinx-serialization to their last Kotlin 2.2 releases#272jcopenhop wants to merge 1 commit into
jcopenhop wants to merge 1 commit into
Conversation
kotlinx-io 0.9.x and kotlinx-serialization 1.10.x+ are compiled at language version 2.3, so their metadata cannot be read by consumers still on Kotlin 2.1 (e.g. the Detekt Gradle Plugin's report-merge task). sarif4k's own classes already target language version 2.2, but these api-exposed transitive deps re-introduced the 2.3 metadata, breaking those consumers. Pin the last Kotlin 2.2-built releases so the full published API surface stays at metadata version 2.2: - kotlinx-io-core 0.9.0 -> 0.8.2 - kotlinx-serialization-json 1.11.0 -> 1.9.0 - kotlinx-serialization-json-io 1.11.0 -> 1.9.0 Add Renovate packageRules (allowedVersions) so these are not automatically bumped back past the Kotlin 2.2 line and silently reintroduce the incompatibility. Verified: JVM tests pass, public ABI unchanged, and the Detekt Gradle Plugin (Kotlin 2.1 gradle-plugin-api) compiles and tests green against a locally published build with metadata version checking enabled. Refs: detekt/detekt#9330 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
sarif4k 0.7.0 can't be consumed by projects still building with Kotlin 2.1.
The most concrete case is detekt itself: its Gradle plugin performs SARIF
report merging via sarif4k, but the Detekt Gradle Plugin is compiled against
kotlin-gradle-plugin-api2.1.0 (its supported floor). Kotlin 2.1 refusesto read dependency metadata compiled at language version 2.3, so the plugin
fails to compile against sarif4k 0.7.0. This currently blocks detekt from
upgrading — see detekt/detekt#9330 and detekt/detekt#9247.
Root cause
sarif4k's own classes are already emitted at metadata version 2.2 (the build
pins
languageVersion/apiVersion/coreLibrariesVersionto 2.2), so they'refine. The blocker is the api-exposed transitive dependencies, which were
compiled at language version 2.3:
kotlinx-io-core0.9.xkotlinx-serialization-json/-json-io1.10.x+Because these are on the public API surface, consumers must read their metadata
too — and Kotlin 2.1 can't.
Fix
Hold these dependencies at their last Kotlin 2.2-built releases, so the entire
published API surface stays at metadata version 2.2 (readable by Kotlin 2.1):
kotlinx-io-corekotlinx-serialization-jsonkotlinx-serialization-json-ioAlso adds Renovate
packageRules(allowedVersions) so these aren'tauto-bumped back past the 2.2 line and silently reintroduce the incompatibility.
Verification
./gradlew clean jvmTest checkKotlinAbi— green; public ABI unchanged(no
api/*.apiregeneration needed), streaming serializer unaffected by theolder kotlinx-io.
@Metadata(mv=[2,2,0]).org.gradle.kotlin.dsl.skipMetadataVersionCheck=false(metadata checking on)::detekt-gradle-plugin:compileKotlinand:testboth pass, resolvingsarif4k 0.7.0-SNAPSHOT → kotlinx-io 0.8.2 / serialization 1.9.0.