Add support for Kotlin 2.4.0 - #193
Closed
DevSrSouza wants to merge 11 commits into
Closed
Conversation
Register 2.4.0 (release) in versionSupport.kotlin and switch dev-support to it. SKIE keeps compiling with the 2.2.20 Kotlin compiler (which still supports experimental context receivers). That compiler reads klib metadata only one minor version ahead, so building against the 2.4.0 Kotlin/Native distribution needs -Xskip-metadata-version-check; it is added in BaseKotlinPlugin for every JVM module (main and test) when the primary Kotlin version is >= 2.4.0.
Kotlin 2.4.0 renamed several Kotlin/Native compiler types:
- KonanConfig -> NativeSecondStageCompilationConfig
- KonanConfigKeys -> NativeConfigurationKeys
- PhaseContext -> NativePhaseContext
The shared `main` source set now references SKIE-internal typealiases
(co.touchlab.skie.compat.{KonanConfig,KonanConfigKeys,PhaseContext}) defined
per version range (`..2.3.20` -> old names, `2.4.0..` -> new names). The
debugPrefixMapKey/phaseContextKonanConfig version helpers are bounded to
exactly 2.3.20 and reimplemented for 2.4.0+ against the new types.
Kotlin 2.4.0 removed the dedicated IR value-parameter/receiver/argument accessors (valueParameters, putValueArgument, putTypeArgument, extensionReceiver, extensionReceiverParameter) in favor of unified positional parameters/arguments lists, changed IrMutableAnnotationContainer.annotations to List<IrAnnotation>, and made the GeneratorContext primary constructor private (the public one gained a CompilerConfiguration parameter). The shared `main` source set now uses skie* shims and a skieCreateGeneratorContext helper, implemented per version range, plus a SkieIrAnnotation alias for the annotation element type.
…dulesSupport removal - CompilerConfiguration.report(severity, message, location) was removed; SKIE now reports through the MessageCollector (reportCompilerMessage shim). - The framework OUTPUT key was renamed to KONAN_OUTPUT_PATH (frameworkOutputPathConfigurationKey shim). - CompilerConfigurationKey is final; SkieConfigurationKeys holds key instances instead of subclassing it. - UserVisibleIrModulesSupport was removed with no replacement that maps resolved libraries to dependency coordinates. getExternalDependencies returns an empty set on 2.4.0, so all non-distribution libraries are treated as local and per-module analytics no longer distinguish external libraries. Default libraries are now detected via KotlinLibrary.isFromKotlinNativeDistribution.
# Conflicts: # common-gradle/gradle.properties # dev-support/build.gradle.kts
`generateCIActions` regenerates every versioned smoke-test workflow, which incidentally re-synced the stale smoke-tests-2_3_20-*.yml (its lockfile was shrunk in b88ae64 without regenerating the workflow). That change is unrelated to Kotlin 2.4.0 support, so restore those two files to match main and keep this PR scoped to 2.4.0.
DevSrSouza
force-pushed
the
feature/kotlin-2.4.0
branch
from
June 11, 2026 16:04
db9a6c4 to
1b2af16
Compare
Closed
Collaborator
|
Merged. |
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.
Adds Kotlin 2.4.0 support.
Replaces #191, which dropped external-dependency reporting (it returns an empty set now that
UserVisibleIrModulesSupportwas removed) and quietly changes library classification and default-argument generation. This version restores it by deserializing the dependency graph the Kotlin Gradle plugin still writes to the-Xexternal-dependenciesfile and passes to the native link, so behavior matches 2.3.x.That file is generated by default (the only condition is whether external dependencies exist) and fed to the link task, per the Kotlin 2.4.0 source:
buildCompilerArgsemits-Xexternal-dependencies: https://github.com/JetBrains/kotlin/blob/v2.4.0/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/targets/native/tasks/KotlinNativeTasks.kt#L621-L627writeDependenciesFile, gated only on having no dependencies: https://github.com/JetBrains/kotlin/blob/v2.4.0/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/targets/native/tasks/KotlinNativeTasks.kt#L744-L751Tested locally with Maestro E2E across 10+ full features on iOS, all good.