Skip to content

Prepare Kotlin 2.4.20 support - #202

Draft
carlonzo wants to merge 2 commits into
touchlab:mainfrom
carlonzo:kotlin-2-4-20-beta-support
Draft

Prepare Kotlin 2.4.20 support#202
carlonzo wants to merge 2 commits into
touchlab:mainfrom
carlonzo:kotlin-2-4-20-beta-support

Conversation

@carlonzo

Copy link
Copy Markdown
Contributor

Summary

Preparing SKIE to be ready for Kotlin 2.4.20

Stacked on touchlab/SKIE #201 (Kotlin 2.4.10 patch support)

Changes

  • KotlinLibrary.isFromKotlinNativeDistribution was split into isImplicitlyLoadedFromKotlinNativeDistribution / isExplicitlySpecifiedByUserInCLIArgument. defaultLibraries.kt is updated to use the renamed property; the prior 2.4.0.. shim is capped at the 2.4.0 baseline.

  • CompilerConfiguration.messageCollector is now gated behind the MessageCollectorAccess opt-in marker. KonanConfigCompat.kt's reportCompilerMessage shim opts in explicitly for 2.4.20+.

  • IrSimpleFunction gained a new abstract member companionExtensionClass (companion-extension support). DummyIrSimpleFunction — a short-lived symbol-table placeholder that's never read past its declaration (see FunctionTemplate.declareSymbol) — stubs it the same way as its other members. The 2.1.20.. source set is capped at 2.4.0 and a 2.4.20.. copy adds the new override.

  • CodegenPhaseInterceptor.kt's debug-prefix-map workaround switched from poking NativeGenerationState.context.messageCollector directly (removed in 2.4.20) to the existing cross-version reportCompilerMessage compat shim, which already covers every supported Kotlin version — this is a version-agnostic fix in src/main.

  • Verified locally by compiling :kotlin-compiler:kotlin-compiler-linker-plugin:compileKotlin against 2.0.0, 2.4.0(2.4.10), and 2.4.20[2.4.20-Beta1].

  • The copied libraries.lock/expected-failures for 2.4.20 are not yet validated against the new compiler — that requires the real :acceptance-tests:libraries:test run (~6.7k external KMP libraries) in CI, which isn't feasible to run to completion outside CI. Expect some libraries to need new/updated expected-failure entries once that runs.

  • Since 2.4.20 is still in Beta, this targets [2.4.20-Beta1] per the existing pre-release convention; the compiler-version override can be dropped once the 2.4.20 release ships.

carlonzo added 2 commits July 22, 2026 01:38
Registers 2.4.20[2.4.20-Beta1] in versionSupport.kotlin and switches dev-support
to it, following the same pattern used for previous new-baseline bumps (e.g.
2.3.0-Beta2, 2.4.0).

Kotlin 2.4.20 changes three compiler-internal APIs SKIE depends on:
- `KotlinLibrary.isFromKotlinNativeDistribution` was split into
  `isImplicitlyLoadedFromKotlinNativeDistribution` and
  `isExplicitlySpecifiedByUserInCLIArgument`; defaultLibraries.kt now uses the
  renamed property. The prior 2.4.0.. shim is capped at the 2.4.0 baseline.
- `CompilerConfiguration.messageCollector` is now gated behind the
  `MessageCollectorAccess` opt-in marker; KonanConfigCompat.kt's
  reportCompilerMessage shim opts in explicitly for 2.4.20+.
- `IrSimpleFunction` gained a new abstract member `companionExtensionClass`
  (companion-extension support). DummyIrSimpleFunction — a short-lived
  symbol-table placeholder that is never read past its declaration (see
  FunctionTemplate.declareSymbol) — stubs it the same way as its other
  members. The 2.1.20.. source set is capped at 2.4.0 and a 2.4.20.. copy
  adds the new override.
- CodegenPhaseInterceptor.kt's debug-prefix-map workaround switched from
  poking NativeGenerationState.context.messageCollector directly (removed
  in 2.4.20) to the existing cross-version reportCompilerMessage compat
  shim, which already covers every supported Kotlin version.

Verified by compiling :kotlin-compiler:kotlin-compiler-linker-plugin:compileKotlin
against 2.0.0, 2.4.0(2.4.10), and 2.4.20[2.4.20-Beta1].

Since 2.4.20 is still in Beta, this targets the version as [2.4.20-Beta1] per the
existing pre-release convention; the compiler-version override can be dropped
once the 2.4.20 release ships.

Claude-Session: https://claude.ai/code/session_01NRKECdAMmkWgARLzE2sjUo
Seeds SKIE/acceptance-tests/libraries/src/test/resources/tests/2.4.20 by copying
the 2.4.0 libraries.lock and expected-failures verbatim, following the same
pattern used when 2.4.0 was added (see "Copy library tests lockfile and expected
failures from 2.3.20 for 2.4.0"). The actual libraries.lock/expected-failures
content will need to be validated and updated by the real
:acceptance-tests:libraries:test run against 2.4.20 in CI, since that requires
resolving and compiling ~6.7k external KMP libraries — not something feasible to
run to completion outside CI.

Adds smoke-tests-2_4_20-{github,self-hosted}.yml (generated via the
generateCIActions Gradle task, now that the seeded libraries.lock gives it a
library count to batch) and bumps the default Kotlin version in smoke-tests.yml
/ smoke-tests-manual.yml from 2.4.0 to 2.4.20, matching the exact pattern from
"Add CI workflows for Kotlin 2.4.0".

Claude-Session: https://claude.ai/code/session_01NRKECdAMmkWgARLzE2sjUo
@carlonzo
carlonzo force-pushed the kotlin-2-4-20-beta-support branch from af613c6 to 9fc333c Compare July 21, 2026 21:38
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.

1 participant