From 5450f659de41044fe6bbbd5045da84caf950aa68 Mon Sep 17 00:00:00 2001 From: James Rich <2199651+jamesarich@users.noreply.github.com> Date: Tue, 29 Sep 2026 23:47:51 +0000 Subject: [PATCH] build: stop declaring an iosArm64 target nothing builds or ships (#7465) --- .skills/kmp-architecture/SKILL.md | 2 +- .../org/meshtastic/buildlogic/KotlinAndroid.kt | 14 ++++++-------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/.skills/kmp-architecture/SKILL.md b/.skills/kmp-architecture/SKILL.md index 6239b86986..8e80de4109 100644 --- a/.skills/kmp-architecture/SKILL.md +++ b/.skills/kmp-architecture/SKILL.md @@ -55,7 +55,7 @@ Guidelines on managing Kotlin Multiplatform (KMP) source-sets, expected abstract - In `build-logic/convention`, prefer lazy Gradle configuration (`configureEach`, `withPlugin`, provider APIs). Avoid `afterEvaluate` in convention plugins unless there is no viable lazy alternative. ## 8. Onboarding a New Target (Desktop/iOS) -1. Ensure all new logic compiles against the KMP core (`jvm()`, `iosArm64()`, etc.). +1. Ensure all new logic compiles against the KMP core targets (`jvm()`, `iosSimulatorArm64()`). 2. Do not use platform-specific constructs in `commonMain` or you break the iOS/Desktop builds. 3. Test using `kmpSmokeCompile` to verify cross-platform compilation. 4. For desktop wiring, copy the pattern in `desktopApp/src/main/kotlin/org/meshtastic/desktop/di/DesktopKoinModule.kt` and use `NoopStubs.kt` to temporarily mock missing platform implementations. diff --git a/build-logic/convention/src/main/kotlin/org/meshtastic/buildlogic/KotlinAndroid.kt b/build-logic/convention/src/main/kotlin/org/meshtastic/buildlogic/KotlinAndroid.kt index 6fe55e8cc6..5a9ac164a6 100644 --- a/build-logic/convention/src/main/kotlin/org/meshtastic/buildlogic/KotlinAndroid.kt +++ b/build-logic/convention/src/main/kotlin/org/meshtastic/buildlogic/KotlinAndroid.kt @@ -113,13 +113,12 @@ internal fun Project.configureKotlinMultiplatform() { // Standard KMP targets for Meshtastic jvm() - // iOS targets for compile-only validation. Only register on hosts where - // Kotlin/Native can run — KSP attaches to every Kotlin target's compilation - // and crashes at configuration time on unsupported hosts (e.g. linux-aarch64) - // with "Could not create task ':…:kspKotlinIosArm64' > Unknown host target". + // iOS simulator target for compile-only validation; nothing here links a device + // framework, so there is no iosArm64. Only register on hosts where Kotlin/Native + // can run: KSP attaches to every Kotlin target's compilation and crashes at + // configuration time on unsupported hosts (e.g. linux-aarch64) with "Unknown host target". // Supported set: https://kotlinlang.org/docs/native-target-support.html if (supportsKotlinNative()) { - iosArm64() iosSimulatorArm64() } @@ -144,14 +143,13 @@ internal fun Project.configureKotlinMultiplatform() { } // Disable iOS native test link & run tasks. - // iOS targets exist only for compile-time validation; linking test + // The iOS target exists only for compile-time validation; linking test // executables is extremely slow and causes `./gradlew test` to hang. tasks.configureEach { val taskName = name.lowercase() - if (taskName.contains("iosarm64") || taskName.contains("iossimulatorarm64")) { + if (taskName.contains("iossimulatorarm64")) { val isDisabledIosTask = (taskName.startsWith("link") && taskName.contains("test")) || - taskName == "iosarm64test" || taskName == "iossimulatorarm64test" || taskName.endsWith("testbinaries") if (isDisabledIosTask) {