From 971653fa1a01e1c20085eb41e251abf7e95ffe49 Mon Sep 17 00:00:00 2001 From: Andy Lee Date: Fri, 25 Jul 2025 13:40:07 -0700 Subject: [PATCH] upgrade: switch from manylinux2014 to manylinux_2_35 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Use manylinux_2_35 (GLIBC 2.35) instead of manylinux2014 (GLIBC 2.17) - Still compatible with Google Colab (requires ≤2.35) - Benefits: newer toolchain, better performance, modern C++ features - Switch from yum to dnf package manager - Remove pyzmq version cap as manylinux_2_35 has newer ZeroMQ - Update documentation to reflect the change --- .github/workflows/build-cibuildwheel.yml | 26 ++++++++++------------ MANYLINUX_BUILD_STRATEGY.md | 2 +- packages/leann-backend-hnsw/pyproject.toml | 2 +- pyproject.toml | 6 ++--- 4 files changed, 17 insertions(+), 19 deletions(-) diff --git a/.github/workflows/build-cibuildwheel.yml b/.github/workflows/build-cibuildwheel.yml index 4f477f1..a65202c 100644 --- a/.github/workflows/build-cibuildwheel.yml +++ b/.github/workflows/build-cibuildwheel.yml @@ -46,15 +46,14 @@ jobs: CIBW_BUILD: cp39-* cp310-* cp311-* cp312-* cp313-* CIBW_SKIP: "*-win32 *-manylinux_i686 pp* *musllinux*" - # 使用manylinux2014生成兼容性更好的wheels - CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014 - CIBW_MANYLINUX_AARCH64_IMAGE: manylinux2014 + # Use manylinux_2_35 for Colab compatibility with modern features + CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_35 + CIBW_MANYLINUX_AARCH64_IMAGE: manylinux_2_35 - # Linux dependencies - 使用yum因为manylinux2014基于CentOS 7 + # Linux dependencies - using dnf for manylinux_2_35 (based on AlmaLinux 9) CIBW_BEFORE_ALL_LINUX: | - yum install -y epel-release - yum install -y gcc-c++ boost-devel zeromq-devel openblas-devel cmake3 - ln -sf /usr/bin/cmake3 /usr/bin/cmake + dnf install -y epel-release + dnf install -y gcc-c++ boost-devel zeromq-devel openblas-devel cmake python3-devel # Install numpy before building CIBW_BEFORE_BUILD: | @@ -70,7 +69,7 @@ jobs: # Pre-install test dependencies to avoid compilation CIBW_BEFORE_TEST: | - pip install --only-binary :all: "pyzmq>=23.0.0,<27" + pip install --only-binary :all: "pyzmq>=23.0.0" # Test command to verify the wheel works CIBW_TEST_COMMAND: | @@ -109,13 +108,12 @@ jobs: CIBW_BUILD: cp39-* cp310-* cp311-* cp312-* cp313-* CIBW_SKIP: "*-win32 *-manylinux_i686 pp* *musllinux*" - CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014 - CIBW_MANYLINUX_AARCH64_IMAGE: manylinux2014 + CIBW_MANYLINUX_X86_64_IMAGE: manylinux_2_35 + CIBW_MANYLINUX_AARCH64_IMAGE: manylinux_2_35 CIBW_BEFORE_ALL_LINUX: | - yum install -y epel-release - yum install -y gcc-c++ boost-devel zeromq-devel openblas-devel cmake3 - ln -sf /usr/bin/cmake3 /usr/bin/cmake + dnf install -y epel-release + dnf install -y gcc-c++ boost-devel zeromq-devel openblas-devel cmake python3-devel # Install numpy before building CIBW_BEFORE_BUILD: | @@ -131,7 +129,7 @@ jobs: # Pre-install test dependencies to avoid compilation CIBW_BEFORE_TEST: | - pip install --only-binary :all: "pyzmq>=23.0.0,<27" + pip install --only-binary :all: "pyzmq>=23.0.0" # Test command to verify the wheel works CIBW_TEST_COMMAND: | diff --git a/MANYLINUX_BUILD_STRATEGY.md b/MANYLINUX_BUILD_STRATEGY.md index 58684e2..29f94ef 100644 --- a/MANYLINUX_BUILD_STRATEGY.md +++ b/MANYLINUX_BUILD_STRATEGY.md @@ -4,7 +4,7 @@ Google Colab requires wheels compatible with `manylinux_2_35_x86_64` or earlier. Our previous builds were producing `manylinux_2_39_x86_64` wheels, which are incompatible. ## Solution -We're using `cibuildwheel` with `manylinux2014` images to build wheels that are compatible with a wide range of Linux distributions, including Google Colab. +We're using `cibuildwheel` with `manylinux_2_35` images to build wheels that are compatible with Google Colab while maintaining modern toolchain features. ### Key Changes diff --git a/packages/leann-backend-hnsw/pyproject.toml b/packages/leann-backend-hnsw/pyproject.toml index e8059ac..4a3d4bf 100644 --- a/packages/leann-backend-hnsw/pyproject.toml +++ b/packages/leann-backend-hnsw/pyproject.toml @@ -11,7 +11,7 @@ description = "Custom-built HNSW (Faiss) backend for the Leann toolkit." dependencies = [ "leann-core==0.1.8", "numpy", - "pyzmq>=23.0.0,<27", # Cap at 26.x for manylinux2014 compatibility + "pyzmq>=23.0.0", "msgpack>=1.0.0", ] diff --git a/pyproject.toml b/pyproject.toml index c6bda3e..b71995c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -65,9 +65,9 @@ leann-backend-hnsw = { path = "packages/leann-backend-hnsw", editable = true } # Skip 32-bit and PyPy builds skip = "*-win32 *-manylinux_i686 pp* *musllinux*" -# Use manylinux2014 for maximum compatibility (supports GLIBC 2.17) -manylinux-x86_64-image = "manylinux2014" -manylinux-aarch64-image = "manylinux2014" +# Use manylinux_2_35 for Colab compatibility while keeping modern features +manylinux-x86_64-image = "manylinux_2_35" +manylinux-aarch64-image = "manylinux_2_35" # Linux system dependencies [tool.cibuildwheel.linux]