feat: Add macOS 15 support for M4 Mac compatibility (#38)
* feat: add macOS 15 support for M4 Mac compatibility - Add macos-15 CI builds for Python 3.9-3.13 - Update MACOSX_DEPLOYMENT_TARGET from 11.0/13.3 to 14.0 for broader compatibility - Addresses issue #34 with Mac M4 wheel compatibility 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> * fix: ensure wheels are compatible with older macOS versions - Set MACOSX_DEPLOYMENT_TARGET=11.0 for HNSW backend (broad compatibility) - Set MACOSX_DEPLOYMENT_TARGET=13.0 for DiskANN backend (required for LAPACK) - Add --require-target-macos-version to delocate-wheel commands - This fixes CI failures on macos-13 runners while maintaining M4 Mac support Fixes the issue where wheels built on macos-14 runners were incorrectly tagged as macosx_14_0, preventing installation on macos-13 runners. * fix: use macOS 13.3 for DiskANN backend as required by LAPACK DiskANN requires macOS 13.3+ for sgesdd_ LAPACK function, so we must use 13.3 as the deployment target, not 13.0. * fix: match deployment target with runner OS for library compatibility The issue is that Homebrew libraries on macOS 14 runners are built for macOS 14 and cannot be downgraded. We must use different deployment targets based on the runner OS: - macOS 13 runners: Can build for macOS 11.0 (HNSW) and 13.3 (DiskANN) - macOS 14 runners: Must build for macOS 14.0 (due to system libraries) This ensures delocate-wheel succeeds by matching the deployment target with the actual minimum version required by bundled libraries. * fix: add macOS 15 support to deployment target configuration The issue extends to macOS 15 runners where Homebrew libraries are built for macOS 15. We must handle all runner versions explicitly: - macOS 13 runners: Can build for macOS 11.0 (HNSW) and 13.3 (DiskANN) - macOS 14 runners: Must build for macOS 14.0 (system libraries) - macOS 15 runners: Must build for macOS 15.0 (system libraries) This ensures wheels are properly tagged for their actual minimum supported macOS version, matching the bundled libraries. * fix: correct macOS deployment targets based on Homebrew library requirements The key insight is that Homebrew libraries on each macOS version are compiled for that specific version: - macOS 13: Libraries require macOS 13.0 minimum - macOS 14: Libraries require macOS 14.0 minimum - macOS 15: Libraries require macOS 15.0 minimum We cannot build wheels for older macOS versions than what the bundled Homebrew libraries require. This means: - macOS 13 runners: Build for macOS 13.0+ (HNSW) and 13.3+ (DiskANN) - macOS 14 runners: Build for macOS 14.0+ - macOS 15 runners: Build for macOS 15.0+ This ensures delocate-wheel succeeds by matching deployment targets with the actual minimum versions required by system libraries. * fix: restore macOS 15 build matrix and correct test path - Add back macOS 15 configurations for Python 3.9-3.13 - Fix pytest path from test/ to tests/ (correct directory name) The macOS 15 support was accidentally missing from the matrix, and pytest was looking for the wrong directory name. --------- Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
51
.github/workflows/build-reusable.yml
vendored
51
.github/workflows/build-reusable.yml
vendored
@@ -64,6 +64,16 @@ jobs:
|
||||
python: '3.12'
|
||||
- os: macos-14
|
||||
python: '3.13'
|
||||
- os: macos-15
|
||||
python: '3.9'
|
||||
- os: macos-15
|
||||
python: '3.10'
|
||||
- os: macos-15
|
||||
python: '3.11'
|
||||
- os: macos-15
|
||||
python: '3.12'
|
||||
- os: macos-15
|
||||
python: '3.13'
|
||||
- os: macos-13
|
||||
python: '3.9'
|
||||
- os: macos-13
|
||||
@@ -147,7 +157,14 @@ jobs:
|
||||
# Use system clang for better compatibility
|
||||
export CC=clang
|
||||
export CXX=clang++
|
||||
export MACOSX_DEPLOYMENT_TARGET=11.0
|
||||
# Homebrew libraries on each macOS version require matching minimum version
|
||||
if [[ "${{ matrix.os }}" == "macos-13" ]]; then
|
||||
export MACOSX_DEPLOYMENT_TARGET=13.0
|
||||
elif [[ "${{ matrix.os }}" == "macos-14" ]]; then
|
||||
export MACOSX_DEPLOYMENT_TARGET=14.0
|
||||
elif [[ "${{ matrix.os }}" == "macos-15" ]]; then
|
||||
export MACOSX_DEPLOYMENT_TARGET=15.0
|
||||
fi
|
||||
uv build --wheel --python ${{ matrix.python }} --find-links ${GITHUB_WORKSPACE}/packages/leann-core/dist
|
||||
else
|
||||
uv build --wheel --python ${{ matrix.python }} --find-links ${GITHUB_WORKSPACE}/packages/leann-core/dist
|
||||
@@ -161,7 +178,14 @@ jobs:
|
||||
export CC=clang
|
||||
export CXX=clang++
|
||||
# DiskANN requires macOS 13.3+ for sgesdd_ LAPACK function
|
||||
export MACOSX_DEPLOYMENT_TARGET=13.3
|
||||
# But Homebrew libraries on each macOS version require matching minimum version
|
||||
if [[ "${{ matrix.os }}" == "macos-13" ]]; then
|
||||
export MACOSX_DEPLOYMENT_TARGET=13.3
|
||||
elif [[ "${{ matrix.os }}" == "macos-14" ]]; then
|
||||
export MACOSX_DEPLOYMENT_TARGET=14.0
|
||||
elif [[ "${{ matrix.os }}" == "macos-15" ]]; then
|
||||
export MACOSX_DEPLOYMENT_TARGET=15.0
|
||||
fi
|
||||
uv build --wheel --python ${{ matrix.python }} --find-links ${GITHUB_WORKSPACE}/packages/leann-core/dist
|
||||
else
|
||||
uv build --wheel --python ${{ matrix.python }} --find-links ${GITHUB_WORKSPACE}/packages/leann-core/dist
|
||||
@@ -197,10 +221,24 @@ jobs:
|
||||
- name: Repair wheels (macOS)
|
||||
if: runner.os == 'macOS'
|
||||
run: |
|
||||
# Determine deployment target based on runner OS
|
||||
# Must match the Homebrew libraries for each macOS version
|
||||
if [[ "${{ matrix.os }}" == "macos-13" ]]; then
|
||||
HNSW_TARGET="13.0"
|
||||
DISKANN_TARGET="13.3"
|
||||
elif [[ "${{ matrix.os }}" == "macos-14" ]]; then
|
||||
HNSW_TARGET="14.0"
|
||||
DISKANN_TARGET="14.0"
|
||||
elif [[ "${{ matrix.os }}" == "macos-15" ]]; then
|
||||
HNSW_TARGET="15.0"
|
||||
DISKANN_TARGET="15.0"
|
||||
fi
|
||||
|
||||
# Repair HNSW wheel
|
||||
cd packages/leann-backend-hnsw
|
||||
if [ -d dist ]; then
|
||||
delocate-wheel -w dist_repaired -v dist/*.whl
|
||||
export MACOSX_DEPLOYMENT_TARGET=$HNSW_TARGET
|
||||
delocate-wheel -w dist_repaired -v --require-target-macos-version $HNSW_TARGET dist/*.whl
|
||||
rm -rf dist
|
||||
mv dist_repaired dist
|
||||
fi
|
||||
@@ -209,7 +247,8 @@ jobs:
|
||||
# Repair DiskANN wheel
|
||||
cd packages/leann-backend-diskann
|
||||
if [ -d dist ]; then
|
||||
delocate-wheel -w dist_repaired -v dist/*.whl
|
||||
export MACOSX_DEPLOYMENT_TARGET=$DISKANN_TARGET
|
||||
delocate-wheel -w dist_repaired -v --require-target-macos-version $DISKANN_TARGET dist/*.whl
|
||||
rm -rf dist
|
||||
mv dist_repaired dist
|
||||
fi
|
||||
@@ -249,8 +288,8 @@ jobs:
|
||||
# Activate virtual environment
|
||||
source .venv/bin/activate || source .venv/Scripts/activate
|
||||
|
||||
# Run all tests
|
||||
pytest tests/
|
||||
# Run tests
|
||||
pytest -v tests/
|
||||
|
||||
- name: Run sanity checks (optional)
|
||||
run: |
|
||||
|
||||
Reference in New Issue
Block a user