fix(desktop): unbreak Windows launch + Pi-installable arm64 .deb (#5233)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: garthvh <1795163+garthvh@users.noreply.github.com>
This commit is contained in:
James Rich
2026-04-23 10:13:27 -05:00
committed by GitHub
parent 2ba5b45077
commit 0e5d1da8d2
3 changed files with 44 additions and 24 deletions

View File

@@ -258,7 +258,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [macos-latest, windows-latest, ubuntu-24.04, ubuntu-24.04-arm]
os: [macos-latest, windows-latest, ubuntu-22.04, ubuntu-22.04-arm]
env:
GRADLE_CACHE_URL: ${{ secrets.GRADLE_CACHE_URL }}
GRADLE_CACHE_USERNAME: ${{ secrets.GRADLE_CACHE_USERNAME }}

View File

@@ -72,22 +72,12 @@ internal fun Project.configureKotlinAndroid(commonExtension: CommonExtension) {
/** Configure Kotlin Multiplatform options */
internal fun Project.configureKotlinMultiplatform() {
// Skiko is an internal CMP implementation detail; third-party KMP libraries
// (e.g. coil3) can carry an older skiko transitive requirement that Gradle
// upgrades to the CMP-bundled version, triggering a "Skiko dependencies'
// versions are incompatible" warning from CMP's compatibility checker.
// Force the version to match CMP so the checker sees a consistent graph.
// Pinned here rather than in the version catalog because this plugin is the
// only consumer — bump together with the compose-multiplatform version.
val skikoVersion = "0.144.5"
configurations.configureEach {
resolutionStrategy.eachDependency {
if (requested.group == "org.jetbrains.skiko") {
useVersion(skikoVersion)
because("Align Skiko with the version bundled by Compose Multiplatform")
}
}
}
// Note: we used to force `org.jetbrains.skiko` to a hard-coded version here to
// align coil3's older skiko requirement with CMP's. As of CMP 1.11.x the
// compose-desktop module publishes `{strictly <version>}` constraints on
// skiko, so Gradle resolves the conflict naturally. A hard-coded force would
// silently downgrade skiko on the next CMP bump and break the renderer —
// so we let CMP own the version.
extensions.configure<KotlinMultiplatformExtension> {
// Standard KMP targets for Meshtastic

View File

@@ -42,13 +42,7 @@
-dontprocesskotlinmetadata
# ---- Entry point ------------------------------------------------------------
-keep class org.meshtastic.desktop.MainKt { *; }
# ---- Ktor Java engine (desktop-only; Android uses OkHttp) -------------------
# io.ktor.client.engine.java ships consumer rules; the shared
# HttpClientEngineFactory ServiceLoader keep in shared-rules.pro covers the
# reflective discovery path.
# (org.meshtastic.desktop.MainKt is covered by the package-wide keep below.)
# ---- Meshtastic desktop host shell ------------------------------------------
@@ -70,6 +64,42 @@
-dontwarn kotlin.concurrent.atomics.**
-dontwarn kotlin.uuid.UuidV7Generator
# ---- Library consumer rules ------------------------------------------------
# The compose-jb gradle plugin auto-injects `default-compose-desktop-rules.pro`
# (bundled inside org.jetbrains.compose:compose-gradle-plugin) into every
# desktop ProGuard run. That file already covers:
# - kotlin.**, kotlinx.coroutines.** (incl. SwingDispatcherFactory ServiceLoader)
# - org.jetbrains.skiko.**, org.jetbrains.skia.**
# - kotlinx.serialization.** (incl. @Serializable companion keeps)
# - kotlinx.datetime.**
# - androidx.compose.runtime SnapshotStateKt + Material3 SliderDefaults
# So we DO NOT re-declare those here. Source of truth:
# https://github.com/JetBrains/compose-multiplatform/blob/master/gradle-plugins/compose/src/main/resources/default-compose-desktop-rules.pro
#
# However, the standalone ProGuard 7.7.0 that compose-jb invokes does NOT
# auto-import library `META-INF/proguard/*.pro` consumer rules from arbitrary
# jars (only R8/Android does). So any consumer-rule pattern outside the bundled
# defaults above must be copied here manually (see Ktor SL block below).
# ---- androidx.sqlite bundled driver (JNI native bridge) ---------------------
# BundledSQLiteDriver loads `libsqliteJni` and the native code calls back into
# JVM-land via methods on `BundledSQLiteDriverKt` (e.g. `nativeThreadSafeMode`)
# and member methods on `BundledSQLiteDriver` itself. Because those JVM symbols
# are referenced only from native code, ProGuard removes them as unused; the
# native loader then crashes with `NoSuchMethodError: ... name or signature does
# not match`. Keep the whole driver package — it's small and entirely needed at
# runtime once the bundled SQLite driver is selected.
-keep class androidx.sqlite.driver.bundled.** { *; }
-keepclassmembers class androidx.sqlite.driver.bundled.** { native <methods>; *; }
# ---- Ktor serialization extension providers (ServiceLoader) -----------------
# io.ktor.serialization.kotlinx-json discovers KotlinxSerializationJsonExtensionProvider
# via META-INF/services/io.ktor.serialization.kotlinx.KotlinxSerializationExtensionProvider.
# Without this keep the desktop HttpClient init throws ServiceConfigurationError
# at first request; on Windows jpackage's launcher swallows the trace and
# surfaces it as "Failed to launch JVM".
-keep class * implements io.ktor.serialization.kotlinx.KotlinxSerializationExtensionProvider { *; }
# ---- Vico 3.2.0-next.1 ColorScale (CMP API drift) ---------------------------
# Vico's new ColorScale* classes (ColorScaleShader, ColorScaleAreaFill,
# ColorScaleLineFill) reference CMP UI graphics members that don't exist in