Skip to content

Commit 96ad23a

Browse files
authored
build: drop macosX64 Kotlin/Native target (#322)
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
1 parent 078ed37 commit 96ad23a

13 files changed

Lines changed: 8 additions & 96 deletions

File tree

.github/workflows/build-native.yml

Lines changed: 0 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ on:
2424
- all
2525
- linuxX64
2626
- macosArm64
27-
- macosX64
2827
- mingwX64
2928
- androidArm64
3029

@@ -153,67 +152,6 @@ jobs:
153152
build/cmake-build/openblas-install/lib/libopenblas.a
154153
retention-days: 90
155154

156-
# ── macOS x86_64 ─────────────────────────────────────────────
157-
build-macosX64:
158-
name: macOS x64
159-
if: >-
160-
github.event_name != 'workflow_dispatch' ||
161-
github.event.inputs.platform == 'all' ||
162-
github.event.inputs.platform == 'macosX64'
163-
runs-on: macos-26-intel
164-
165-
steps:
166-
- name: Checkout
167-
uses: actions/checkout@v6
168-
169-
- name: Install build dependencies
170-
run: brew install gcc cmake
171-
172-
- name: Setup JDK 21
173-
uses: actions/setup-java@v5
174-
with:
175-
distribution: temurin
176-
java-version: '21'
177-
178-
- name: Detect Homebrew GCC
179-
run: |
180-
BREW_GCC_PREFIX=$(brew --prefix gcc)
181-
GCC_VER=$(ls "$BREW_GCC_PREFIX/bin/" | grep -oE '^gcc-[0-9]+$' | sort -t- -k2 -n | tail -1 | cut -d- -f2)
182-
echo "CC=$BREW_GCC_PREFIX/bin/gcc-$GCC_VER" >> "$GITHUB_ENV"
183-
echo "CXX=$BREW_GCC_PREFIX/bin/g++-$GCC_VER" >> "$GITHUB_ENV"
184-
echo "$BREW_GCC_PREFIX/bin" >> "$GITHUB_PATH"
185-
186-
- name: Cache OpenBLAS build
187-
uses: actions/cache@v5
188-
with:
189-
path: build/cmake-build/openblas*
190-
key: openblas-macosX64-${{ hashFiles('multik-openblas/multik_jni/CMakeLists.txt') }}
191-
restore-keys: |
192-
openblas-macosX64-
193-
194-
- name: Configure CMake
195-
run: |
196-
cmake \
197-
-DCMAKE_BUILD_TYPE=Release \
198-
-DCMAKE_C_COMPILER="$CC" \
199-
-DCMAKE_CXX_COMPILER="$CXX" \
200-
-DTARGET_OS=macosX64 \
201-
-S multik-openblas/multik_jni \
202-
-B build/cmake-build
203-
204-
- name: Build native library
205-
run: cmake --build build/cmake-build --target multik_jni-macosX64 -- -j "$(sysctl -n hw.ncpu)"
206-
207-
- name: Upload artifact
208-
uses: actions/upload-artifact@v7
209-
with:
210-
name: native-macosX64
211-
path: |
212-
build/cmake-build/libmultik_jni-*
213-
build/cmake-build/openblas-install/include/
214-
build/cmake-build/openblas-install/lib/libopenblas.a
215-
retention-days: 90
216-
217155
# ── Windows x86_64 (MSYS2 MinGW) ────────────────────────────
218156
build-mingwX64:
219157
name: Windows x64 (MinGW)

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,15 +99,14 @@ Import stable `multik` version into notebook:
9999
| **WasmJS** |||||
100100
| **linuxX64** |||||
101101
| **mingwX64** |||||
102-
| **macosX64** |||||
103102
| **macosArm64** |||||
104103
| **iosArm64** |||||
105104
| **iosX64** |||||
106105
| **iosSimulatorArm64** |||||
107106

108107
> [!IMPORTANT]
109108
> - On Linux distributions with **glibc** older than 2.31, `multik-openblas` doesn't work.
110-
> - `multik-openblas` for desktop native targets (_linuxX64_, _mingwX64_, _macosX64_, _macosArm64_) is experimental and
109+
> - `multik-openblas` for desktop native targets (_linuxX64_, _mingwX64_, _macosArm64_) is experimental and
111110
> unstable.
112111
> - JVM target `multik-openblas` for Android only supports **arm64-v8a** processors.
113112

buildSrc/src/main/kotlin/multik.all-targets-kmp.gradle.kts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ plugins {
77
kotlin {
88
mingwX64()
99
linuxX64()
10-
macosX64()
1110
macosArm64()
1211

1312
iosArm64()

buildSrc/src/main/kotlin/multik.host-native-kmp.gradle.kts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,10 @@ plugins {
1010

1111
kotlin {
1212
macosArm64()
13-
macosX64()
1413
linuxX64()
1514
mingwX64()
1615

1716
val hostTarget = when (HostDetection.currentTarget) {
18-
MultikNativeTarget.MACOS_X64 -> targets.getByName("macosX64")
1917
MultikNativeTarget.MACOS_ARM64 -> targets.getByName("macosArm64")
2018
MultikNativeTarget.LINUX_X64 -> targets.getByName("linuxX64")
2119
MultikNativeTarget.MINGW_X64 -> targets.getByName("mingwX64")
@@ -28,7 +26,7 @@ val hostTargetName = (project.extra["hostNativeTarget"] as KotlinNativeTarget).n
2826
// Targets that need host-gating because of CInterop/CMake JNI (see multik-openblas).
2927
// iOS/JS/WASM are pure Kotlin and follow standard KMP rules — Kotlin disables unsupported
3028
// host compilations itself, and non-desktop klibs should publish normally from the main host.
31-
val gatedTargetNames = listOf("macosArm64", "macosX64", "linuxX64", "mingwX64")
29+
val gatedTargetNames = listOf("macosArm64", "linuxX64", "mingwX64")
3230

3331
// multik.mainHost (Gradle property, default=true):
3432
// true → main host: publishes everything except non-host gated native

buildSrc/src/main/kotlin/org/jetbrains/kotlinx/multik/builds/CmakeDetection.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ object CmakeDetection {
2222

2323
private val commonInstallPaths: List<String> = when {
2424
HostDetection.isMacosArm64 -> listOf("/opt/homebrew/bin/cmake", "/usr/local/bin/cmake")
25-
HostDetection.isMacosX64 -> listOf("/usr/local/bin/cmake", "/opt/homebrew/bin/cmake")
2625
HostDetection.isLinux -> listOf("/usr/bin/cmake", "/usr/local/bin/cmake")
2726
HostDetection.isWindows -> listOf(
2827
"C:\\Program Files\\CMake\\bin\\cmake.exe",

buildSrc/src/main/kotlin/org/jetbrains/kotlinx/multik/builds/HomebrewGccDetection.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,5 +50,5 @@ object HomebrewGccDetection {
5050
if (current != null && current.isDirectory) current.absolutePath else null
5151
}
5252

53-
private val isMacos: Boolean get() = HostDetection.isMacosX64 || HostDetection.isMacosArm64
53+
private val isMacos: Boolean get() = HostDetection.isMacosArm64
5454
}

buildSrc/src/main/kotlin/org/jetbrains/kotlinx/multik/builds/HostDetection.kt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package org.jetbrains.kotlinx.multik.builds
33
import org.gradle.api.GradleException
44

55
enum class MultikNativeTarget(val targetName: String) {
6-
MACOS_X64("macosX64"),
76
MACOS_ARM64("macosArm64"),
87
LINUX_X64("linuxX64"),
98
MINGW_X64("mingwX64"),
@@ -13,21 +12,19 @@ object HostDetection {
1312
val hostOs: String = System.getProperty("os.name")
1413
val hostArch: String = System.getProperty("os.arch")
1514

16-
val isMacosX64: Boolean get() = hostOs == "Mac OS X" && hostArch == "x86_64"
1715
val isMacosArm64: Boolean get() = hostOs == "Mac OS X" && hostArch == "aarch64"
1816
val isLinux: Boolean get() = hostOs == "Linux"
1917
val isWindows: Boolean get() = hostOs.startsWith("Windows")
2018

2119
val currentTarget: MultikNativeTarget
2220
get() = when {
23-
isMacosX64 -> MultikNativeTarget.MACOS_X64
2421
isMacosArm64 -> MultikNativeTarget.MACOS_ARM64
2522
isLinux -> MultikNativeTarget.LINUX_X64
2623
isWindows -> MultikNativeTarget.MINGW_X64
2724
else -> throw GradleException(
2825
"""
2926
Failed to detect platform. Supported platforms:
30-
macosX64, macosArm64, linuxX64, mingwX64
27+
macosArm64, linuxX64, mingwX64
3128
""".trimIndent()
3229
)
3330
}

docs/topics/gettingStarted/multik-on-desktop.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Both can use the same Multik API, with engine choice depending on platform and p
2828
| Target | Engines | Notes |
2929
|-------------------------------------------------------------------|------------------------------------|-------------------------------------------------------------------|
3030
| JVM desktop | DEFAULT, KOTLIN, NATIVE (OpenBLAS) | NATIVE requires `multik-openblas`. |
31-
| Native desktop (`linuxX64`, `mingwX64`, `macosX64`, `macosArm64`) | KOTLIN; NATIVE (OpenBLAS) | OpenBLAS for desktop native targets is experimental and unstable. |
31+
| Native desktop (`linuxX64`, `mingwX64`, `macosArm64`) | KOTLIN; NATIVE (OpenBLAS) | OpenBLAS for desktop native targets is experimental and unstable. |
3232

3333
## Dependencies
3434

docs/topics/gettingStarted/multik-on-different-platforms.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ The following [target presets](https://kotlinlang.org/docs/multiplatform-dsl-ref
3737
|-----------------|-------------------------------------------|
3838
| Kotlin/JVM | `jvm` |
3939
| iOS | `iosArm64`, `iosX64`, `iosSimulatorArm64` |
40-
| macOS | `macosX64`, `macosArm64` |
40+
| macOS | `macosArm64` |
4141
| Linux | `linuxX64` |
4242
| Windows | `mingwX64` |
4343
| JS | `js` |
@@ -56,7 +56,7 @@ Multik separates the API from execution engines:
5656
| JVM | DEFAULT, KOTLIN, NATIVE (OpenBLAS) | NATIVE requires the OpenBLAS artifact. |
5757
| JS | KOTLIN | Browser and Node.js targets. |
5858
| WASM | KOTLIN | Kotlin/WASM targets. |
59-
| Native (desktop) | KOTLIN; NATIVE (OpenBLAS) on selected targets | OpenBLAS for desktop native targets (`linuxX64`, `mingwX64`, `macosX64`, `macosArm64`) is experimental and unstable. |
59+
| Native (desktop) | KOTLIN; NATIVE (OpenBLAS) on selected targets | OpenBLAS for desktop native targets (`linuxX64`, `mingwX64`, `macosArm64`) is experimental and unstable. |
6060
| Native (iOS) | KOTLIN | OpenBLAS is not available. |
6161

6262
For details such as Android ABI limits, see the platform pages below.

multik-default/build.gradle.kts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,9 @@ kotlin {
3434
val desktopTest by creating { dependsOn(commonTest.get()) }
3535

3636
getByName("macosArm64Main").dependsOn(desktopMain)
37-
getByName("macosX64Main").dependsOn(desktopMain)
3837
getByName("linuxX64Main").dependsOn(desktopMain)
3938
getByName("mingwX64Main").dependsOn(desktopMain)
4039
getByName("macosArm64Test").dependsOn(desktopTest)
41-
getByName("macosX64Test").dependsOn(desktopTest)
4240
getByName("linuxX64Test").dependsOn(desktopTest)
4341
getByName("mingwX64Test").dependsOn(desktopTest)
4442
}

0 commit comments

Comments
 (0)