From 1dfc2f37371edeb45ed021a39f11664e3161d87a Mon Sep 17 00:00:00 2001 From: Andy Lee Date: Sat, 9 Aug 2025 18:14:48 -0700 Subject: [PATCH] fix: configure CMake paths in pyproject.toml for proper Homebrew detection MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add CMAKE_PREFIX_PATH and OpenMP_ROOT environment variable mapping in both backends - Remove CMAKE_ARGS from GitHub Actions workflow (cleaner separation) - Ensure scikit-build-core correctly uses environment variables for CMake configuration - This should fix the hardcoded /opt/homebrew paths on Intel Macs 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- .github/workflows/build-reusable.yml | 4 ---- packages/leann-backend-diskann/pyproject.toml | 2 ++ packages/leann-backend-hnsw/pyproject.toml | 4 +++- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-reusable.yml b/.github/workflows/build-reusable.yml index f5c9a65..db01cfc 100644 --- a/.github/workflows/build-reusable.yml +++ b/.github/workflows/build-reusable.yml @@ -150,8 +150,6 @@ jobs: export CC=clang export CXX=clang++ export MACOSX_DEPLOYMENT_TARGET=11.0 - # Pass CMAKE_PREFIX_PATH to help CMake find Homebrew packages - export CMAKE_ARGS="-DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH} -DOpenMP_ROOT=${OpenMP_ROOT}" uv build --wheel --python python else uv build --wheel --python python @@ -166,8 +164,6 @@ jobs: export CXX=clang++ # DiskANN requires macOS 13.3+ for sgesdd_ LAPACK function export MACOSX_DEPLOYMENT_TARGET=13.3 - # Pass CMAKE_PREFIX_PATH to help CMake find Homebrew packages - export CMAKE_ARGS="-DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH} -DOpenMP_ROOT=${OpenMP_ROOT}" uv build --wheel --python python else uv build --wheel --python python diff --git a/packages/leann-backend-diskann/pyproject.toml b/packages/leann-backend-diskann/pyproject.toml index 5519ac2..4dbc397 100644 --- a/packages/leann-backend-diskann/pyproject.toml +++ b/packages/leann-backend-diskann/pyproject.toml @@ -17,3 +17,5 @@ editable.mode = "redirect" cmake.build-type = "Release" build.verbose = true build.tool-args = ["-j8"] +# Let CMake find packages via Homebrew prefix +cmake.define = {CMAKE_PREFIX_PATH = {env = "CMAKE_PREFIX_PATH"}, OpenMP_ROOT = {env = "OpenMP_ROOT"}} diff --git a/packages/leann-backend-hnsw/pyproject.toml b/packages/leann-backend-hnsw/pyproject.toml index 89e63eb..489aa08 100644 --- a/packages/leann-backend-hnsw/pyproject.toml +++ b/packages/leann-backend-hnsw/pyproject.toml @@ -22,6 +22,8 @@ cmake.build-type = "Release" build.verbose = true build.tool-args = ["-j8"] -# CMake definitions to optimize compilation +# CMake definitions to optimize compilation and find Homebrew packages [tool.scikit-build.cmake.define] CMAKE_BUILD_PARALLEL_LEVEL = "8" +CMAKE_PREFIX_PATH = {env = "CMAKE_PREFIX_PATH"} +OpenMP_ROOT = {env = "OpenMP_ROOT"}