From acf303417179a7fd2ec7cb27b8af4b3f3b74d237 Mon Sep 17 00:00:00 2001 From: Andy Lee Date: Tue, 12 Aug 2025 10:58:35 -0700 Subject: [PATCH] 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. --- .github/workflows/build-reusable.yml | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-reusable.yml b/.github/workflows/build-reusable.yml index fdf6653..a78813e 100644 --- a/.github/workflows/build-reusable.yml +++ b/.github/workflows/build-reusable.yml @@ -157,7 +157,8 @@ jobs: # Use system clang for better compatibility export CC=clang export CXX=clang++ - export MACOSX_DEPLOYMENT_TARGET=14.0 + # Use 11.0 for broad macOS compatibility + export MACOSX_DEPLOYMENT_TARGET=11.0 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 @@ -170,9 +171,8 @@ jobs: # Use system clang for better compatibility export CC=clang export CXX=clang++ - # DiskANN requires macOS 13.3+ for sgesdd_ LAPACK function - # Using 14.0 for better M4 compatibility - export MACOSX_DEPLOYMENT_TARGET=14.0 + # DiskANN requires macOS 13+ for sgesdd_ LAPACK function + export MACOSX_DEPLOYMENT_TARGET=13.3 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 @@ -211,7 +211,10 @@ jobs: # Repair HNSW wheel cd packages/leann-backend-hnsw if [ -d dist ]; then - delocate-wheel -w dist_repaired -v dist/*.whl + # Set deployment target to ensure wheel compatibility with older macOS versions + # This ensures the wheel is tagged for macOS 11.0+ compatibility + export MACOSX_DEPLOYMENT_TARGET=11.0 + delocate-wheel -w dist_repaired -v --require-target-macos-version 11.0 dist/*.whl rm -rf dist mv dist_repaired dist fi @@ -220,7 +223,10 @@ jobs: # Repair DiskANN wheel cd packages/leann-backend-diskann if [ -d dist ]; then - delocate-wheel -w dist_repaired -v dist/*.whl + # DiskANN requires macOS 13.3+ for sgesdd_ LAPACK function + # But we need to support macOS 13 runners, so use 13.0 as the target + export MACOSX_DEPLOYMENT_TARGET=13.0 + delocate-wheel -w dist_repaired -v --require-target-macos-version 13.0 dist/*.whl rm -rf dist mv dist_repaired dist fi