build: drop macosX64 Kotlin/Native target#322
Conversation
Apple has wound down Intel Macs; macosX64 is considered obsolete. Remove the target from every module, CI, docs, and helper utilities so the build matrix reflects what is actually supported. - Strip macosX64() from multik.all-targets-kmp and multik.host-native-kmp (target decl, when-branch, gatedTargetNames) - Remove MACOS_X64/isMacosX64 from HostDetection, CmakeDetection, HomebrewGccDetection - Drop the macosX64 CMake branch and the libmultik_jni-macosX64.dylib JAR inclusion from multik-openblas - Simplify the macos branch in JvmLoader to lib/macosArm64/ - Remove macosX64Main/macosX64Test wiring from multik-default - Delete the build-macosX64 CI job and workflow_dispatch option - Update README and Writerside docs
There was a problem hiding this comment.
Pull request overview
Drops the macosX64 Kotlin/Native target across the build, packaging, CI, and documentation to align the supported matrix with Apple Silicon–only macOS native support.
Changes:
- Remove
macosX64targets/source-sets from KMP Gradle configuration and host-gating helpers. - Stop building/packaging
macosX64OpenBLAS JNI artifacts (CMake + JAR resources) and remove the dedicated CI job. - Update docs/README to reflect the reduced native macOS target set.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
multik-openblas/src/jvmMain/kotlin/org/jetbrains/kotlinx/multik/openblas/Loader.kt |
Simplifies macOS JNI resource path selection to Arm64-only. |
multik-openblas/multik_jni/CMakeLists.txt |
Removes macOS x86_64 OpenBLAS/JNI build configuration. |
multik-openblas/build.gradle.kts |
Stops bundling the macOS x86_64 JNI dylib into the JVM JAR. |
multik-default/build.gradle.kts |
Removes macOS x86_64 source-set wiring from desktop shared source sets. |
docs/topics/gettingStarted/multik-on-different-platforms.md |
Updates supported target list and OpenBLAS notes to remove macosX64. |
docs/topics/gettingStarted/multik-on-desktop.md |
Updates native desktop target list to remove macosX64. |
buildSrc/src/main/kotlin/org/jetbrains/kotlinx/multik/builds/HostDetection.kt |
Drops macOS x86_64 from host detection and supported-platform messaging. |
buildSrc/src/main/kotlin/org/jetbrains/kotlinx/multik/builds/HomebrewGccDetection.kt |
Limits Homebrew GCC detection to macOS Arm64 hosts. |
buildSrc/src/main/kotlin/org/jetbrains/kotlinx/multik/builds/CmakeDetection.kt |
Removes macOS x86_64-specific CMake common install paths. |
buildSrc/src/main/kotlin/multik.host-native-kmp.gradle.kts |
Removes macosX64() target and host-target mapping/gating references. |
buildSrc/src/main/kotlin/multik.all-targets-kmp.gradle.kts |
Removes macosX64() from the “all targets” convention. |
README.md |
Removes macosX64 from the platform support matrix and OpenBLAS note. |
.github/workflows/build-native.yml |
Removes the macOS x86_64 build job and workflow_dispatch option. |
| private val prefixPath = when (os) { | ||
| "android" -> "lib/arm64-v8a/" | ||
| "linux" -> "lib/linuxX64/" | ||
| "macos" -> { | ||
| if (arch == "Arm64") | ||
| "lib/macosArm64/" | ||
| else | ||
| "lib/macosX64/" | ||
| } | ||
|
|
||
| "macos" -> "lib/macosArm64/" | ||
| else -> "lib/mingwX64/" |
There was a problem hiding this comment.
prefixPath is hardcoded to lib/macosArm64/ for all macOS hosts, but nativeNameLib still includes the computed arch suffix (e.g. ...-macosX64). On an x86_64 macOS JVM this will look for an X64 library under the Arm64 resource directory, then fall back to System.loadLibrary(...) and ultimately fail with a generic "Unknown error". Consider explicitly rejecting arch == "X64" on macOS with a clear error (or keep a per-arch prefix mapping) so failures are deterministic and actionable.
|
|
||
| val isMacosX64: Boolean get() = hostOs == "Mac OS X" && hostArch == "x86_64" | ||
| val isMacosArm64: Boolean get() = hostOs == "Mac OS X" && hostArch == "aarch64" | ||
| val isLinux: Boolean get() = hostOs == "Linux" |
There was a problem hiding this comment.
isMacosArm64 only matches os.arch == "aarch64", but some JDKs/Gradle distributions report Apple Silicon as arm64. In that case currentTarget will throw even on supported macOS Arm64 hosts. Consider normalizing hostArch.lowercase() and accepting both "aarch64" and "arm64" (mirroring the runtime arch mapping in multik-openblas’s Loader.kt).
| if (current != null && current.isDirectory) current.absolutePath else null | ||
| } | ||
|
|
||
| private val isMacos: Boolean get() = HostDetection.isMacosX64 || HostDetection.isMacosArm64 | ||
| private val isMacos: Boolean get() = HostDetection.isMacosArm64 | ||
| } |
There was a problem hiding this comment.
isMacos now delegates to HostDetection.isMacosArm64, so on macOS x86_64 all detection properties will return null even though the platform is still macOS. The KDoc at the top of this file currently says values are null on "non-macOS platforms"; please update it to reflect the new behavior (e.g., non-macOS or unsupported macOS architectures).
Summary
macosX64Kotlin/Native target from every module, CI, docs, and host-detection helpers. Apple has wound down Intel Macs and the target is obsolete — this aligns the build matrix with what we actually support.macos-26-intelCI job (build-macosX64inbuild-native.yml) along with itsworkflow_dispatchoption.Loader.ktmacOS branch tolib/macosArm64/and stripsMACOS_X64/isMacosX64from the buildSrc host-detection helpers.HomebrewGccDetection.isMacosnow just delegates toisMacosArm64.Breaking: downstream consumers depending on the
*-macosx64classifier artifacts will no longer receive new publications. Multik is alpha-stability (JetBrains incubator), so no@Deprecatedstaging was used.Test plan
./gradlew projects— configuration succeeds across all modules./gradlew :multik-core:compileKotlinJvm :multik-kotlin:compileKotlinJvm :multik-default:compileKotlinJvm— green./gradlew :multik-core:compileKotlinMacosArm64 :multik-kotlin:compileKotlinMacosArm64 :multik-default:compileKotlinMacosArm64— greengrep -r "macosX64\|MACOS_X64\|isMacosX64" .returns no hits./gradlew :multik-openblas:tasks --all | grep -i macosshows onlymacosArm64tasksBuild & Teston Ubuntu passesBuild Native Libraries(manualworkflow_dispatch) no longer listsmacosX64and still builds the remaining platforms