From 5b0db4d4c2f1423689f08260816c189ebfe8655d Mon Sep 17 00:00:00 2001 From: James Rich <2199651+jamesarich@users.noreply.github.com> Date: Fri, 10 Jul 2026 20:21:11 -0500 Subject: [PATCH] fix(desktop): pin Compose packaging javaHome to the JBR toolchain (#6213) Co-authored-by: Claude Fable 5 --- .github/workflows/reusable-check.yml | 5 ++++- desktopApp/build.gradle.kts | 18 ++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/.github/workflows/reusable-check.yml b/.github/workflows/reusable-check.yml index 296bf74a8..774baa6e3 100644 --- a/.github/workflows/reusable-check.yml +++ b/.github/workflows/reusable-check.yml @@ -546,7 +546,10 @@ jobs: install_jetbrains_jdk: 'true' - name: Build Desktop - run: ./gradlew :desktopApp:createDistributable -Pci=true + # proguardReleaseJars is included because it is otherwise only exercised by the + # release workflow: jlink tolerates a jmods-less JDK (JEP 493) but ProGuard does + # not, so a broken packaging JDK would surface at release time instead of here. + run: ./gradlew :desktopApp:createDistributable :desktopApp:proguardReleaseJars -Pci=true - name: Upload Desktop artifact if: ${{ inputs.upload_artifacts }} diff --git a/desktopApp/build.gradle.kts b/desktopApp/build.gradle.kts index 6cd94f2d4..beef2ddfe 100644 --- a/desktopApp/build.gradle.kts +++ b/desktopApp/build.gradle.kts @@ -109,6 +109,24 @@ compose.desktop { application { mainClass = "org.meshtastic.desktop.MainKt" + // CMP resolves javaHome from the JVM running Gradle, not the Kotlin toolchain. On CI + // that's Temurin 25, which ships without jmods (JEP 493): jlink still works, but the + // ProGuard task derives -libraryjars from $javaHome/jmods and fails with ~857k + // unresolved java.* references. Pin packaging to the JBR SDK toolchain (jmods + // included) so ProGuard sees the platform classes and the bundled runtime is + // deterministically JBR 25 on every machine. + javaHome = + javaToolchains + .launcherFor { + languageVersion.set(JavaLanguageVersion.of(25)) + vendor.set(JvmVendorSpec.JETBRAINS) + } + .get() + .metadata + .installationPath + .asFile + .absolutePath + val desktopJvmArgs = listOf( "-Xmx2G",