fix(python): only bundle the DiskANN plugin where it is supported (#510)

This commit is contained in:
Cuiys
2026-06-23 10:08:24 +08:00
committed by GitHub
parent 3a15a9d5b7
commit 5627e950e8
2 changed files with 16 additions and 3 deletions
+8
View File
@@ -26,6 +26,14 @@ dist
html
*.lcov.info
# Compiled extension modules must never live in the source package: they are
# built by CMake and installed into the wheel. A stray copy left here gets
# bundled verbatim by scikit-build's wheel.packages and breaks the wheel
# (e.g. a stale binary with the wrong macOS deployment target).
python/zvec/*.so
python/zvec/*.dylib
python/zvec/*.pyd
# Dependencies
/node_modules
+8 -3
View File
@@ -183,9 +183,14 @@ if(BUILD_PYTHON_BINDINGS)
# function. The Python extension resolves the module next to _zvec.so
# (see the $ORIGIN rpath in src/binding/python/CMakeLists.txt); the
# module must therefore be installed alongside _zvec.so in the wheel.
# The target exists only on platforms where DiskAnn is buildable
# (currently Linux x86_64 with libaio).
if(TARGET core_knn_diskann)
#
# Gate on DISKANN_SUPPORTED, not on the target's existence: on unsupported
# platforms (e.g. macOS / ARM64) the core_knn_diskann target is still
# defined, but built from an empty stub (src/core/algorithm/CMakeLists.txt)
# with zero exported symbols and a runtime load path compiled out
# (#if DISKANN_SUPPORTED). Shipping that stub is pure dead weight, so it is
# only packaged where DiskAnn is real — currently Linux x86_64 with libaio.
if(DISKANN_SUPPORTED)
install(TARGETS core_knn_diskann LIBRARY DESTINATION ${ZVEC_PY_INSTALL_DIR}
COMPONENT python)
endif()