Skip to content

build: drop macosX64 Kotlin/Native target#322

Merged
devcrocod merged 1 commit intodevelopfrom
deprecation/drop-macosx64-target
Apr 21, 2026
Merged

build: drop macosX64 Kotlin/Native target#322
devcrocod merged 1 commit intodevelopfrom
deprecation/drop-macosx64-target

Conversation

@devcrocod
Copy link
Copy Markdown
Collaborator

Summary

  • Drops the macosX64 Kotlin/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.
  • Removes the dedicated macos-26-intel CI job (build-macosX64 in build-native.yml) along with its workflow_dispatch option.
  • Simplifies the JVM Loader.kt macOS branch to lib/macosArm64/ and strips MACOS_X64 / isMacosX64 from the buildSrc host-detection helpers. HomebrewGccDetection.isMacos now just delegates to isMacosArm64.

Breaking: downstream consumers depending on the *-macosx64 classifier artifacts will no longer receive new publications. Multik is alpha-stability (JetBrains incubator), so no @Deprecated staging 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 — green
  • grep -r "macosX64\|MACOS_X64\|isMacosX64" . returns no hits
  • ./gradlew :multik-openblas:tasks --all | grep -i macos shows only macosArm64 tasks
  • CI: Build & Test on Ubuntu passes
  • CI: Build Native Libraries (manual workflow_dispatch) no longer lists macosX64 and still builds the remaining platforms

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
Copilot AI review requested due to automatic review settings April 21, 2026 22:50
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 macosX64 targets/source-sets from KMP Gradle configuration and host-gating helpers.
  • Stop building/packaging macosX64 OpenBLAS 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.

Comment on lines 53 to 57
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/"
Copy link

Copilot AI Apr 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Comment on lines 14 to 16

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"
Copy link

Copilot AI Apr 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Copilot uses AI. Check for mistakes.
Comment on lines 50 to 54
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
}
Copy link

Copilot AI Apr 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Copilot uses AI. Check for mistakes.
@devcrocod devcrocod merged commit 96ad23a into develop Apr 21, 2026
10 checks passed
@devcrocod devcrocod deleted the deprecation/drop-macosx64-target branch April 21, 2026 23:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants