Skip to content

Build skiko with kotlin 2.2.20#1179

Open
Schahen wants to merge 19 commits intomasterfrom
sh/kotlin_2.2.20
Open

Build skiko with kotlin 2.2.20#1179
Schahen wants to merge 19 commits intomasterfrom
sh/kotlin_2.2.20

Conversation

@Schahen
Copy link
Contributor

@Schahen Schahen commented Mar 3, 2026

This is backport of #1173 to Kotlin 2.2.20

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Backports upstream Skiko Kotlin/WASM/JS build changes (from #1173) to work with Kotlin 2.2.20, including updated web/wasm interop glue and Gradle/KGP configuration.

Changes:

  • Updates build tooling and dependencies for Kotlin 2.2.20 (and related Gradle/KGP API adjustments).
  • Refactors Web/WASM interop to rely on standard kotlinx.browser/org.w3c types, adds a Promise await() helper, and revises ArrayBuffer copying utilities.
  • Updates the import-generator plugin to process a new @WebImport annotation and emit both @JsName and @WasmImport.

Reviewed changes

Copilot reviewed 59 out of 65 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
skiko/src/webTest/kotlin/org/jetbrains/skiko/tests/TestUtils.web.kt Adds TestReturnType for web tests.
skiko/src/webTest/kotlin/org/jetbrains/skia/webext/WebExtTest.kt Switches to Int8Array and simplifies buffer-copy test code.
skiko/src/webMain/resources/pre-skiko-test.mjs Exposes test wasm exports on window for test execution.
skiko/src/webMain/resources/pre-setup.mjs Exports loadedWasm for module-based access; initializes awaitSkiko.
skiko/src/webMain/kotlin/org/jetbrains/skiko/wasm/Wrapper.kt Moves to standard DOM types and adds awaitSkiko expect.
skiko/src/webMain/kotlin/org/jetbrains/skiko/w3c/W3CSubset.kt Removes custom W3C subset declarations.
skiko/src/webMain/kotlin/org/jetbrains/skiko/await.web.kt Adds coroutine-friendly Promise.await() for web/wasm interop.
skiko/src/webMain/kotlin/org/jetbrains/skiko/SystemTheme.web.kt Adds web actual for currentSystemTheme.
skiko/src/webMain/kotlin/org/jetbrains/skiko/SkiaLayer.web.kt Switches to kotlinx.browser.window + org.w3c.dom canvas.
skiko/src/webMain/kotlin/org/jetbrains/skiko/Resources.web.kt Implements loadBytesFromPath() in webMain using fetch + typed arrays.
skiko/src/webMain/kotlin/org/jetbrains/skiko/OsArch.web.kt Inlines navigator platform lookup via JS snippet.
skiko/src/webMain/kotlin/org/jetbrains/skiko/CanvasRenderer.kt Switches to standard DOM canvas and kotlinx.browser.window.
skiko/src/webMain/kotlin/org/jetbrains/skiko/Actuals.web.kt Adds WebImport annotation for JS/WASM symbol imports.
skiko/src/webMain/kotlin/org/jetbrains/skia/webext/BitmapExt.kt Switches pixels buffer type to org.khronos.webgl.ArrayBuffer.
skiko/src/webMain/kotlin/org/jetbrains/skia/webext/ArrayBuffer.web.kt New JS-based buffer copy utilities backed by wasm memory buffer.
skiko/src/webMain/kotlin/org/jetbrains/skia/webext/ArrayBuffer.kt Removes older expect/actual-based ArrayBuffer abstraction.
skiko/src/webMain/kotlin/org/jetbrains/skia/impl/Stats.web.kt Adds web actual no-op Stats implementation.
skiko/src/webMain/kotlin/org/jetbrains/skia/impl/RefCnt.web.kt Adds web actual RefCnt backed by generated externals.
skiko/src/webMain/kotlin/org/jetbrains/skia/impl/Native.web.kt Adds web actual Native/interop primitives and memory helpers.
skiko/src/webMain/kotlin/org/jetbrains/skia/impl/Managed.web.kt Adds web actual Managed lifecycle + finalizer bridge.
skiko/src/webMain/kotlin/org/jetbrains/skia/impl/Library.web.kt Adds web actual Library.staticLoad() stub.
skiko/src/webMain/kotlin/org/jetbrains/skia/Actuals.web.kt Switches to kotlinx.browser.window; simplifies language detection.
skiko/src/wasmJsTest/kotlin/org/jetbrains/skiko/tests/TestUtils.wasm.kt Awaits awaitSkiko before running wasm tests.
skiko/src/wasmJsMain/kotlin/org/jetbrains/skiko/wasm/WrapperExternal.kt Updates awaitSkiko actual type to Promise<JsAny>.
skiko/src/wasmJsMain/kotlin/org/jetbrains/skiko/wasm/Wrapper.kt Switches to standard DOM canvas type.
skiko/src/wasmJsMain/kotlin/org/jetbrains/skiko/Resources.wasmJs.kt Removes older wasm resource loading implementation.
skiko/src/wasmJsMain/kotlin/org/jetbrains/skiko/Resources.wasm.kt Implements Int8Array.asByteArray() for wasm via copy.
skiko/src/wasmJsMain/kotlin/org/jetbrains/skiko/Actuals.wasm.kt Removes wasm-specific navigator info implementation.
skiko/src/wasmJsMain/kotlin/org/jetbrains/skia/webext/ArrayBuffer.wasmJs.kt Removes wasmJs ArrayBuffer expect/actual plumbing.
skiko/src/wasmJsMain/kotlin/org/jetbrains/skia/Actuals.wasm.kt Rebinds ExternalSymbolName to WebImport.
skiko/src/nativeMain/kotlin/org/jetbrains/skiko/Resources.native.kt Fixes fread argument type (1u) for Kotlin 2.2+.
skiko/src/jsTest/kotlin/org/jetbrains/skiko/tests/TestUtils.js.kt Removes redundant TestReturnType alias (moved elsewhere).
skiko/src/jsMain/kotlin/org/jetbrains/skiko/wasm/WrapperExternal.kt Aligns JS module exports shape for awaitSkiko.
skiko/src/jsMain/kotlin/org/jetbrains/skiko/wasm/Wrapper.kt Switches to standard DOM canvas type.
skiko/src/jsMain/kotlin/org/jetbrains/skiko/Resources.js.kt Provides JS actual Int8Array.asByteArray() conversion.
skiko/src/jsMain/kotlin/org/jetbrains/skiko/Actuals.js.kt Removes now-centralized navigator info logic.
skiko/src/jsMain/kotlin/org/jetbrains/skia/webext/ArrayBuffer.js.kt Removes JS ArrayBuffer expect/actual plumbing.
skiko/src/jsMain/kotlin/org/jetbrains/skia/Actuals.js.kt Rebinds ExternalSymbolName to WebImport.
skiko/src/iosTest/kotlin/org/jetbrains/skiko/Utils.kt Fixes fread argument type (1u).
skiko/src/darwinMain/kotlin/org/jetbrains/skiko/Dispatchers.kt Fixes dispatch QoS arg type (0u).
skiko/src/commonTest/kotlin/org/jetbrains/skiko/util/testSamples.kt Removes redundant .toInt() calls in pixel samples.
skiko/src/commonTest/kotlin/org/jetbrains/skiko/tests/TestHelpers.kt Removes old suppression annotations tied to previous compiler behavior.
skiko/src/commonTest/kotlin/org/jetbrains/skia/CanvasTest.kt Simplifies literal .toInt() usage in expected images.
skiko/import-generator/src/jvmMain/kotlin/org/jetbrains/skiko/ImportGeneratorTransformer.kt Switches to @WebImport and emits both @JsName + @WasmImport.
skiko/import-generator/src/jvmMain/kotlin/org/jetbrains/skiko/ImportGeneratorRegistrar.kt Adds a registrar-level pluginId field.
skiko/import-generator/src/jvmMain/kotlin/org/jetbrains/skiko/ImportGeneratorExtension.kt Adjusts JS reexport module output (awaitSkiko export shape).
skiko/buildSrc/src/main/kotlin/tasks/configuration/WasmTasksConfiguration.kt Refactors wasm import file paths via wasmImport() helper.
skiko/buildSrc/src/main/kotlin/tasks/configuration/NativeTasksConfiguration.kt Updates to newer Gradle/KGP APIs (compilerOptions, provider-based tasks).
skiko/buildSrc/src/main/kotlin/sourceHierarchy.kt Adds webMainSourceSet helper.
skiko/buildSrc/src/main/kotlin/imports.kt Replaces fixed wasm import paths with wasmImport(name).
skiko/buildSrc/gradle.properties Bumps buildSrc Kotlin to 2.2.20.
skiko/build.gradle.kts Sets Kotlin language/api version to 2.2; updates KGP DSL usage and web deps.
samples/SkiaWebSample/src/webMain/kotlin/org/jetbrains/skiko/sample/js/App.web.kt Simplifies DOM element lookup usage.
samples/SkiaWebSample/src/wasmJsMain/kotlin/org/jetbrains/skiko/sample/js/App.wasm.kt Uses document.getElementById directly.
samples/SkiaWebSample/src/jsMain/kotlin/org/jetbrains/skiko/sample/js/App.js.kt Uses document.getElementById directly.
samples/SkiaWebSample/settings.gradle.kts Adds kotlinx-browser to the sample catalog.
samples/SkiaWebSample/gradle.properties Bumps sample Kotlin/skiko versions.
samples/SkiaWebSample/build.gradle.kts Restructures source sets and adds browser dependency.
samples/SkiaMultiplatformSample/src/awtMain/kotlin/org/jetbrains/skiko/sample/AwtClocks.kt Removes cursor-changing behavior on mouse move.
samples/SkiaMultiplatformSample/gradle.properties Bumps sample Kotlin/skiko versions.
samples/SkiaMultiplatformSample/build.gradle.kts Updates compilerOptions usage for newer KGP APIs.
samples/SkiaAwtSample/src/main/kotlin/SkiaAwtSample/ClocksAwt.kt Removes some paragraph font rendering settings.
samples/SkiaAwtSample/gradle.properties Adds commented skiko.version override placeholder.
samples/SkiaAwtSample/build.gradle.kts Bumps Kotlin plugin version and updates compilerOptions API usage.
dependencies.toml Bumps Kotlin to 2.2.20; adds kotlinx-browser; bumps AGP.
Comments suppressed due to low confidence (2)

skiko/src/webMain/kotlin/org/jetbrains/skiko/Actuals.web.kt:5

  • HTMLElement is imported but not used in this file. Please remove the unused import to keep the source clean.
    skiko/src/webMain/kotlin/org/jetbrains/skiko/Actuals.web.kt:19
  • WebImport's parameter has inconsistent spacing (name : String). Please align it with the project Kotlin style (e.g. name: String) for consistency.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@MatkovIvan MatkovIvan requested review from eymar and igordmn March 12, 2026 21:35
-Pskiko.native.enabled=true \
-Pskiko.awt.enabled=false \
:skiko:publishLinuxArm64PublicationToMavenLocal \
:skiko:publishLinuxX64PublicationToMavenLocal
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JFYI
Kotlin/Native fails inside linux-compat with missing symbols like GLIBC_2.29

This means that we cannot support it anymore of Kotlin/Native, we still support AL2/RHEL8 for JVM/AWT build

@MatkovIvan
Copy link
Member

image_name: linux-compat
command: |
./gradlew --no-daemon --stacktrace \
-Pskiko.native.enabled=true \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
-Pskiko.native.enabled=true \

Because we don't check native here, we shouldn't enable it.

@@ -62,13 +62,27 @@ jobs:
name: 'Setup Prerequisites'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see that Compose fails with the new Skiko.

Let's figure it out first before merging this PR

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.

4 participants