build: pin explicit per-variant macOS deployment targets - #203
Merged
Conversation
The MLX build and NIF link set no deployment target, so MLX's objects inherited the build host's OS (CMake "build for host") while the NIF linked at the SDK-major .0 — producing `ld` version-mismatch warnings and a shipped floor that drifts with the runner OS. An aot build done on a macOS-26 host silently linked the macOS-26 libSystem `_Float16` helpers (`__fmaxf16`/`__fminf16`) as hard imports, so it would fail to dyld-load on the older macOS the aot variant is meant to support. Pin an explicit per-variant floor (aot 14.0; jit 26.2, since its NAX kernels and JACCL are gated on macOS SDK >= 26.2) and thread it through both the MLX CMake build (CMAKE_OSX_DEPLOYMENT_TARGET) and the NIF compile/link (MACOSX_DEPLOYMENT_TARGET) from one source of truth in mix.exs. The floor is folded into the MLX cache dir name so a change can't reuse a stale build. scripts/verify-nif-floor.sh asserts the built NIF's LC_BUILD_VERSION and that a sub-26 floor imports no macOS-26 symbols; CI and the release workflow run it per variant. Closes #202.
Owner
Author
|
@codex review |
|
Codex Review: Didn't find any major issues. 🎉 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #202.
Problem
Neither the MLX build (
scripts/build-mlx.sh) nor the NIF link (mix.exs) sets a macOS deployment target, so:CMAKE_OSX_DEPLOYMENT_TARGETis unset), while the NIF links at the SDK-major.0→ theld: … built for newer 'macOS' version (26.4) than being linked (26.0)warnings._Float16helpers__fmaxf16/__fminf16as hard (non-weak) imports — it would fail todyld-load on the older macOS the aot variant is supposed to support. The aot artifact is portable today only because it happens to build onmacos-14.Change
Pin an explicit, per-variant floor and thread it through both halves of the build from one source of truth (
macos_deployment_target/0inmix.exs):-DCMAKE_OSX_DEPLOYMENT_TARGET(build-mlx.sh, new 5th arg).MACOSX_DEPLOYMENT_TARGET(make_env/0; clang honours it for both).Floors: aot = 14.0 (the older-macOS path; MLX's own floor), jit = 26.2 (its NAX kernels + JACCL are gated on macOS SDK ≥ 26.2). The floor is folded into the MLX cache-dir name so changing it can't reuse a stale build.
scripts/verify-nif-floor.shasserts the built NIF'sLC_BUILD_VERSIONmatches the pinned floor and that a sub-26 floor imports no macOS-26_Float16symbols. Wired intoci.yml(per variant) andrelease-nif.yml(guards the shipped artifact before packaging).Verification (on a macOS 26.5 host)
Before → after for the aot build, same host:
__fmaxf16/__fminf16LC_BUILD_VERSIONldmismatch warningsscripts/verify-nif-floor.sh … 14.0passes; correctly rejects a wrong floor (26.2).mix precommitgreen — 737 tests / 40 doctests / 79 properties, 0 failures.mix test --only conformancegreen — 52 tests, 0 failures.Notes
ci.yml/release-nif.yml(NAX includesMetalPerformancePrimitives.h, first shipped in the 26.2 SDK).macos-14/macos-26) and assert each floor — the definitive runtime check the codebase already had, now with a declared, verified minimum.