From c53f5caedbb010ccf85b69bcbc7bcfbd23585311 Mon Sep 17 00:00:00 2001 From: hdahmou Date: Fri, 3 Apr 2026 19:56:12 +0200 Subject: [PATCH 1/2] Trim wheel build --- .github/workflows/build.yml | 340 ++---------------------------------- 1 file changed, 12 insertions(+), 328 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2192d7c72..b16d5d761 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,13 +1,14 @@ -# Name cannot contain commas because of setup-emsdk job -name: Build and test +name: Build Linux wheel + +on: + workflow_dispatch: + push: + tags: + - "wheel-*" -on: [push, pull_request] env: - CIBW_ENABLE: pypy - CIBW_ENVIRONMENT_PASS_LINUX: PYTEST_TIMEOUT CIBW_PROJECT_REQUIRES_PYTHON: ">=3.9" CIBW_TEST_COMMAND: "cd {project} && pip install --prefer-binary '.[test]' && python -m pytest -v tests" - # Free-threaded builds excluded for Python 3.14 because they do not support the limited API CIBW_SKIP: "cp314t-*" PYTEST_TIMEOUT: 60 @@ -15,338 +16,21 @@ jobs: build_wheel_linux: name: Build wheels on Linux (x86_64) runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v5 - with: - submodules: true - fetch-depth: 0 - - - name: Build wheels (manylinux) - uses: pypa/cibuildwheel@v3.3.0 - env: - CIBW_BEFORE_BUILD: "yum install -y flex bison libxml2-devel zlib-devel cairo-devel && pip install -U cmake pip setuptools wheel && python setup.py build_c_core" - CIBW_BUILD: "*-manylinux_x86_64" - - - name: Build wheels (musllinux) - uses: pypa/cibuildwheel@v3.3.0 - env: - CIBW_BEFORE_BUILD: "apk add flex bison libxml2-dev zlib-dev cairo-dev && pip install -U cmake pip setuptools wheel && python setup.py build_c_core" - CIBW_BUILD: "*-musllinux_x86_64" - CIBW_TEST_COMMAND: "cd {project} && pip install --prefer-binary '.[test-musl]' && python -m pytest -v tests" - - - uses: actions/upload-artifact@v6 - with: - name: wheels-linux-x86_64 - path: ./wheelhouse/*.whl - build_wheel_linux_aarch64_manylinux: - name: Build wheels on Linux (aarch64/manylinux) - runs-on: ubuntu-22.04-arm steps: - uses: actions/checkout@v5 with: submodules: true fetch-depth: 0 - - name: Build wheels (manylinux) + - name: Build wheels (manylinux x86_64) uses: pypa/cibuildwheel@v3.3.0 env: + CIBW_BUILD: "*-manylinux_x86_64" + CIBW_ENVIRONMENT_PASS_LINUX: PYTEST_TIMEOUT CIBW_BEFORE_BUILD: "yum install -y flex bison libxml2-devel zlib-devel cairo-devel && pip install -U cmake pip setuptools wheel && python setup.py build_c_core" - CIBW_ARCHS_LINUX: aarch64 - CIBW_BUILD: "*-manylinux_aarch64" - - - uses: actions/upload-artifact@v6 - with: - name: wheels-linux-aarch64-manylinux - path: ./wheelhouse/*.whl - - build_wheel_linux_aarch64_musllinux: - name: Build wheels on Linux (aarch64/musllinux) - runs-on: ubuntu-22.04-arm - steps: - - uses: actions/checkout@v5 - with: - submodules: true - fetch-depth: 0 - - - name: Build wheels (musllinux) - uses: pypa/cibuildwheel@v3.3.0 - env: - CIBW_BEFORE_BUILD: "apk add flex bison libxml2-dev zlib-dev cairo-dev && pip install -U cmake pip setuptools wheel && python setup.py build_c_core" - CIBW_ARCHS_LINUX: aarch64 - CIBW_BUILD: "*-musllinux_aarch64" - CIBW_TEST_COMMAND: "cd {project} && pip install --prefer-binary '.[test-musl]' && python -m pytest -v tests" - - - uses: actions/upload-artifact@v6 - with: - name: wheels-linux-aarch64-musllinux - path: ./wheelhouse/*.whl - - build_wheel_macos: - name: Build wheels on macOS (${{ matrix.wheel_arch }}) - runs-on: macos-latest - env: - LLVM_VERSION: "14.0.5" - MACOSX_DEPLOYMENT_TARGET: "10.15" - strategy: - matrix: - include: - - cmake_arch: x86_64 - wheel_arch: x86_64 - - cmake_arch: arm64 - cmake_extra_args: -DF2C_EXTERNAL_ARITH_HEADER=../../../etc/arith_apple_m1.h -DIEEE754_DOUBLE_ENDIANNESS_MATCHES=ON - wheel_arch: arm64 - - steps: - - uses: actions/checkout@v5 - with: - submodules: true - fetch-depth: 0 - - - name: Cache installed C core - id: cache-c-core - uses: actions/cache@v5 - with: - path: vendor/install - key: C-core-cache-${{ runner.os }}-${{ matrix.cmake_arch }}-llvm${{ env.LLVM_VERSION }}-${{ hashFiles('.git/modules/**/HEAD') }} - - - name: Cache C core dependencies - id: cache-c-deps - uses: actions/cache@v5 - with: - path: ~/local - key: deps-cache-v2-${{ runner.os }}-${{ matrix.cmake_arch }}-llvm${{ env.LLVM_VERSION }} - - - name: Install OS dependencies - if: steps.cache-c-core.outputs.cache-hit != 'true' || steps.cache-c-deps.outputs.cache-hit != 'true' # Only needed when building the C core or libomp - run: brew install autoconf automake libtool - - - name: Install OpenMP library - if: steps.cache-c-deps.outputs.cache-hit != 'true' - run: | - wget https://github.com/llvm/llvm-project/releases/download/llvmorg-$LLVM_VERSION/openmp-$LLVM_VERSION.src.tar.xz - tar xf openmp-$LLVM_VERSION.src.tar.xz - cd openmp-$LLVM_VERSION.src - mkdir build && cd build - cmake .. -DCMAKE_INSTALL_PREFIX=$HOME/local -DLIBOMP_ENABLE_SHARED=OFF -DCMAKE_OSX_ARCHITECTURES=${{ matrix.cmake_arch }} - cmake --build . - cmake --install . - - - name: Build wheels - uses: pypa/cibuildwheel@v3.3.0 - env: - CIBW_ARCHS_MACOS: "${{ matrix.wheel_arch }}" - CIBW_BEFORE_BUILD: "pip install -U setuptools && python setup.py build_c_core" - CIBW_ENVIRONMENT: "LDFLAGS=-L$HOME/local/lib" - IGRAPH_CMAKE_EXTRA_ARGS: -DCMAKE_OSX_ARCHITECTURES=${{ matrix.cmake_arch }} ${{ matrix.cmake_extra_args }} -DCMAKE_PREFIX_PATH=$HOME/local - - - uses: actions/upload-artifact@v6 - with: - name: wheels-macos-${{ matrix.wheel_arch }} - path: ./wheelhouse/*.whl - - build_wheel_wasm: - name: Build wheels for WebAssembly - runs-on: ubuntu-22.04 - - steps: - - uses: actions/checkout@v5 - with: - submodules: true - fetch-depth: 0 - - - uses: actions/setup-python@v6 - name: Install Python - with: - python-version: "3.12.1" - - - name: Install OS dependencies - run: sudo apt install ninja-build cmake flex bison - - - uses: mymindstorm/setup-emsdk@v14 - with: - version: "3.1.58" - actions-cache-folder: "emsdk-cache" - - - name: Build wheel - run: | - pip install pyodide-build==0.26.2 - python3 scripts/fix_pyodide_build.py - pyodide build - - - name: Setup upterm session - uses: lhotari/action-upterm@v1 - if: ${{ failure() }} - with: - limit-access-to-actor: true - wait-timeout-minutes: 5 - - - uses: actions/upload-artifact@v6 - with: - name: wheels-wasm - path: ./dist/*.whl - - build_wheel_win: - name: Build wheels on Windows (${{ matrix.cmake_arch }}) - strategy: - matrix: - include: - - cmake_arch: Win32 - wheel_arch: win32 - vcpkg_arch: x86 - os: windows-2022 - test_extra: test - - cmake_arch: x64 - wheel_arch: win_amd64 - vcpkg_arch: x64 - os: windows-2022 - test_extra: test - - cmake_arch: ARM64 - wheel_arch: win_arm64 - vcpkg_arch: arm64 - os: windows-11-arm - test_extra: test-win-arm64 - runs-on: ${{ matrix.os }} - - steps: - - uses: actions/checkout@v5 - with: - submodules: true - fetch-depth: 0 - - name: Cache installed C core - id: cache-c-core - uses: actions/cache@v5 + - uses: actions/upload-artifact@v4 with: - path: vendor/install - key: C-core-cache-${{ runner.os }}-${{ matrix.cmake_arch }}-${{ hashFiles('.git/modules/**/HEAD') }} - - - name: Cache VCPKG - uses: actions/cache@v5 - with: - path: C:/vcpkg/installed/ - key: vcpkg-${{ runner.os }}-${{ matrix.vcpkg_arch }} - - - name: Install build dependencies - if: steps.cache-c-core.outputs.cache-hit != 'true' # Only needed when building the C core - run: choco install winflexbison3 ninja - - - name: Install VCPKG libraries - run: | - %VCPKG_INSTALLATION_ROOT%\vcpkg.exe integrate install - %VCPKG_INSTALLATION_ROOT%\vcpkg.exe install liblzma:${{ matrix.vcpkg_arch }}-windows-static-md libxml2:${{ matrix.vcpkg_arch }}-windows-static-md - shell: cmd - - - name: Build wheels - uses: pypa/cibuildwheel@v3.3.0 - env: - CIBW_BEFORE_BUILD: "pip install -U setuptools && python setup.py build_c_core" - CIBW_BUILD: "*-${{ matrix.wheel_arch }}" - CIBW_TEST_COMMAND: 'cd /d {project} && pip install --prefer-binary ".[${{ matrix.test_extra }}]" && python -m pytest tests' - # Skip tests for Python 3.10 onwards because SciPy does not have - # 32-bit wheels for Windows any more - CIBW_TEST_SKIP: "cp310-win32 cp311-win32 cp312-win32 cp313-win32 cp314-win32" - IGRAPH_CMAKE_EXTRA_ARGS: -DCMAKE_BUILD_TYPE=RelWithDebInfo -DVCPKG_TARGET_TRIPLET=${{ matrix.vcpkg_arch }}-windows-static-md -DCMAKE_TOOLCHAIN_FILE=c:/vcpkg/scripts/buildsystems/vcpkg.cmake -A ${{ matrix.cmake_arch }} - IGRAPH_EXTRA_LIBRARY_PATH: C:/vcpkg/installed/${{ matrix.vcpkg_arch }}-windows-static-md/lib/ - IGRAPH_STATIC_EXTENSION: True - IGRAPH_EXTRA_LIBRARIES: libxml2,lzma,zlib,iconv,charset,bcrypt - IGRAPH_EXTRA_DYNAMIC_LIBRARIES: wsock32,ws2_32 - - - uses: actions/upload-artifact@v6 - with: - name: wheels-win-${{ matrix.wheel_arch }} + name: wheels-linux-x86_64 path: ./wheelhouse/*.whl - - build_sdist: - name: Build sdist and test extra dependencies - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v5 - with: - submodules: true - fetch-depth: 0 - - - name: Cache installed C core - id: cache-c-core - uses: actions/cache@v5 - with: - path: | - vendor/install - key: C-core-cache-${{ runner.os }}-${{ hashFiles('.git/modules/**/HEAD') }} - - - name: Install OS dependencies - if: steps.cache-c-core.outputs.cache-hit != 'true' # Only needed when building the C core - run: sudo apt install ninja-build cmake flex bison - - - uses: actions/setup-python@v6 - name: Install Python - with: - python-version: "3.9" - - - name: Build sdist - run: | - python setup.py build_c_core - python setup.py sdist - pip install . - - - name: Test - run: | - pip install '.[test]' - python -m pytest -v tests - - - uses: actions/upload-artifact@v6 - with: - name: sdist - path: dist/*.tar.gz - - # When updating 'runs-on', the ASan/UBSan library paths/versions must also be updated for LD_PRELOAD - # for the "Test" step below. - build_with_sanitizer: - name: Build with sanitizers for debugging purposes - runs-on: ubuntu-latest - env: - IGRAPH_CMAKE_EXTRA_ARGS: -DFORCE_COLORED_OUTPUT=ON - steps: - - uses: actions/checkout@v5 - with: - submodules: true - fetch-depth: 0 - - - name: Cache installed C core - id: cache-c-core - uses: actions/cache@v5 - with: - path: | - vendor/build - vendor/install - key: C-core-build-sanitizer-v1-${{ runner.os }}-${{ hashFiles('.git/modules/vendor/source/igraph/HEAD') }} - - - name: Install OS dependencies - if: steps.cache-c-core.outputs.cache-hit != 'true' # Only needed when building the C core - run: sudo apt install ninja-build cmake flex bison - - - uses: actions/setup-python@v6 - name: Install Python - with: - python-version: "3.12" - - - name: Build and install Python extension - env: - IGRAPH_USE_SANITIZERS: 1 - run: | - # We cannot install the test dependency group because many test dependencies cause - # false positives in the sanitizer - pip install --prefer-binary networkx pytest pytest-timeout - pip install -e . - - # Only pytest, and nothing else should be run in this section due to the presence of LD_PRELOAD. - # The ASan/UBSan library versions need to be updated when switching to a newer Ubuntu/GCC. - # LD_PRELOAD needs to be specified in the "run" section to ensure that we - # do not pick up memory leaks in the wrapper shell (e.g., /bin/bash) - - name: Test - env: - ASAN_OPTIONS: "detect_stack_use_after_return=1" - LSAN_OPTIONS: "suppressions=etc/lsan-suppr.txt:print_suppressions=false" - run: | - sudo sysctl vm.mmap_rnd_bits=28 - LD_PRELOAD=/lib/x86_64-linux-gnu/libasan.so.8:/lib/x86_64-linux-gnu/libubsan.so.1 python -m pytest --capture=sys tests From 599e4122d53f0a0c8b88b69d83882e213321add7 Mon Sep 17 00:00:00 2001 From: hdahmou <120108478+hdahmou@users.noreply.github.com> Date: Fri, 3 Apr 2026 20:04:03 +0200 Subject: [PATCH 2/2] bug: build fails, remove cairo-devel --- .github/workflows/build.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b16d5d761..6e8734af1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -28,7 +28,10 @@ jobs: env: CIBW_BUILD: "*-manylinux_x86_64" CIBW_ENVIRONMENT_PASS_LINUX: PYTEST_TIMEOUT - CIBW_BEFORE_BUILD: "yum install -y flex bison libxml2-devel zlib-devel cairo-devel && pip install -U cmake pip setuptools wheel && python setup.py build_c_core" + CIBW_BEFORE_BUILD: >- + yum install -y flex bison libxml2-devel zlib-devel && + pip install -U cmake pip setuptools wheel && + python setup.py build_c_core - uses: actions/upload-artifact@v4 with: