fix(desktop): unbreak Windows launch + Pi-installable arm64 .deb#5233
Merged
Conversation
The desktop release build was crashing on first launch with two distinct
ProGuard-related faults that the standalone ProGuard 7.7.0 used by
compose-jb hides behind jpackage's terse 'Failed to launch JVM' message:
1. Ktor JSON's ServiceLoader provider
(KotlinxSerializationJsonExtensionProvider) was tree-shaken because
no JVM symbol references it directly — only META-INF/services does.
Add an explicit '-keep class * implements ...' rule.
2. androidx.sqlite's bundled native driver lost its JNI bridge methods
(e.g. BundledSQLiteDriverKt.nativeThreadSafeMode) for the same
reason — only native code calls them. Keep the whole driver package.
While here, audit and slim the rest of desktop/proguard-rules.pro
against JetBrains' bundled default-compose-desktop-rules.pro. The
compose-jb gradle plugin auto-injects that file into every desktop
ProGuard run; it already covers kotlin.**, kotlinx.coroutines.** (incl.
the SwingDispatcherFactory ServiceLoader for Dispatchers.Main),
org.jetbrains.skiko/skia.**, kotlinx.serialization, and kotlinx.datetime.
Drop our redundant copies of those rules and add a comment pointing at
the upstream source of truth.
Also drop a brittle 'org.jetbrains.skiko -> 0.144.5' force in the KMP
convention plugin: CMP 1.11.x publishes '{strictly}' constraints on
skiko, so Gradle handles the conflict naturally. The hard-coded version
would silently downgrade skiko on the next CMP bump and break the
renderer.
Linux .deb: switch the desktop release matrix to ubuntu-22.04 /
ubuntu-22.04-arm so jpackage records the non-t64 dep names
(libasound2, libpng16-16) that exist on Debian 12 / Raspberry Pi OS,
not just on Ubuntu 24.04+.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI
pushed a commit
that referenced
this pull request
Apr 24, 2026
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: garthvh <1795163+garthvh@users.noreply.github.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.
Why
Two production reports against the desktop release artifacts:
Failed to launch JVM— jpackage's launcher is hiding the real exception..debwon't install on Raspberry Pi OS / Debian 12 — apt complains about missinglibasound2t64andlibpng16-16t64.What
ProGuard (unbreaks Windows + reproduced macOS launch crash)
Verified locally that the desktop release was failing in two places, both stripped by ProGuard because the only references are non-JVM (ServiceLoader / JNI):
io.ktor.serialization.kotlinx.KotlinxSerializationJsonExtensionProvider.HttpClient { install(ContentNegotiation) }throwsServiceConfigurationErroron first request.libsqliteJnicalls back intoBundledSQLiteDriverKt.nativeThreadSafeMode(); ProGuard removes it as unused. Room can't open any DB.Added narrowly-scoped
-keeprules for both.Audit + cleanup
Compared our
desktop/proguard-rules.proagainst JetBrains' bundleddefault-compose-desktop-rules.pro, which the compose-jb gradle plugin auto-injects into every desktop ProGuard run. That file already coverskotlin.**,kotlinx.coroutines.**(including theSwingDispatcherFactoryServiceLoader forDispatchers.Main),org.jetbrains.skiko/skia.**,kotlinx.serialization, andkotlinx.datetime. Dropped our redundant copies and added a comment pointing at the upstream file.build-logic skiko force removed
KotlinAndroid.configureKotlinMultiplatformwas hard-codingorg.jetbrains.skikoto0.144.5to silence CMP's incompatibility warning. CMP 1.11.x now publishes{strictly}constraints on skiko, so Gradle resolves the conflict naturally — the manual force is redundant today and would silently downgrade skiko (and break the renderer) on the next CMP bump.Linux .deb runners
Switched the desktop release matrix to
ubuntu-22.04/ubuntu-22.04-armso jpackage records the original Debian dep names (libasound2,libpng16-16) rather than Ubuntu's*t64transitional package names from the time_t64 transition, which don't exist on Debian 12 Bookworm / Pi OS.Verified locally
./gradlew :desktop:packageReleaseDistributionForCurrentOS spotlessApply detekt— green