Conversation
The Gradle plugin compares the KSP the build resolved with the recommendation for the project's Kotlin version and fails with the paired plugin line to declare and where to put it, in the shape of the failure for a missing KSP. The version is read from the constant the applied KSP plugin instance carries, so the check reaches the KSP that actually resolved, the bundled one or one the build declared. A subproject that applies KSP without a version inherits the bundled one from a root classpath carrying st.orm; on Kotlin 2.0 and 2.1 that KSP fails inside the Kotlin Gradle plugin with a linkage error naming neither. In a multi-project build the paired KSP is declared once in the root plugins block with apply false, which beats the bundled preference. Kotlin 2.2 joins the automatic path: the bundled KSP compiles a metamodel on Kotlin 2.2, which the smoke test settles, so the refusal covers Kotlin 2.0 and 2.1 only. The docs, the setup skill, the tutorial variants and the changelog carry the new boundary. Fixes #575
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
Fixes #575
What happened
With
st.ormon a root project's classpath, a subproject that appliesid("com.google.devtools.ksp")without a version inherits the bundled KSP 2.3.10. The plugin only asked whether akspconfiguration exists, never which KSP created it, so on Kotlin 2.0 and 2.1 the build ran a KSP that does not pair with the compiler and failed later inside the Kotlin Gradle plugin with a linkage error that names neither KSP nor Kotlin (KotlinJvmCompilerOptions.getJvmDefault()).What changed
KSP_VERSIONconstant the KSP Gradle plugin carries, through that instance's classloader, so the lookup reaches the KSP that actually resolved) and refuses one that does not pair with the project's Kotlin version. The failure names both versions, the paired plugin line to declare, and the multi-project shape: declare it once in the root plugins block withapply falseand apply it in each subproject without a version. The check runs only when the metamodel processor is on, since that is what runs inside KSP.<kotlin>-<ksp>) pairs with the line its prefix names, a Kotlin-independent KSP (2.3+) with every line whose recommendation is such a build. A newer KSP patch than the bundled one is therefore not refused.KotlinVariantsmaps 2.2 to the bundled 2.3.10; a smoke test compiles a metamodel on Kotlin 2.2.21 with the bundled KSP, which settles the boundary the matrix comment claimed. The mismatch rule then covers Kotlin 2.0 and 2.1.Verified resolution shapes (Kotlin 2.1.21, run against the released 1.14.1 plugin before the change)
st.orm apply falsekspwithout versionst.orm apply false+ksp version "2.1.21-2.0.2" apply falsekspwithout versionst.orm apply falseksp version "2.1.21-2.0.2"Tests
KotlinVariantsTest: the pairing rule and the new 2.2 mapping.KspMismatchFunctionalTest(new, mavenLocal-resolved likeKspAutoApplyFunctionalTest): a declared mismatch in a single project, a subproject inheriting the bundled KSP, the rootapply falseform wiring the processor into the paired KSP, a newer KSP patch on the same line accepted, andmetamodel.set(false)leaving the choice to the build.KspAutoApplyFunctionalTest: Kotlin 2.2.21 gets the bundled KSP applied;KotlinPathFunctionalTestgains the 2.2 row.SmokeCompileTest: a Kotlin 2.2.21 entity compiles and generates its metamodel with the bundled KSP (smoke-gated as the other compiles)../gradlew build -Dstorm.smoke=true: 40 functional tests, 0 failures.Docs
docs/installation.md(boundary, refusal, multi-project shape),docs/getting-started.md,docs/ktor-integration.md,README.md,website/static/skills/storm-setup.md,tutorialTheme.js(kspRequireddropped on the Kotlin 2.2 variant, so the quickstart and REST tutorial snippets lose the KSP line there), andCHANGELOG.md(Unreleased entry, and the upgrade note about subprojects now says what to do on Kotlin 2.0 and 2.1).versioned_docs/is untouched, so the doc change shows at/docs/nextuntil the next release snapshots it.