diff --git a/.github/workflows/publish_pypi.yml b/.github/workflows/publish_pypi.yml index 57d7dca..2f5c1ab 100644 --- a/.github/workflows/publish_pypi.yml +++ b/.github/workflows/publish_pypi.yml @@ -46,7 +46,8 @@ jobs: if ! command -v clang-24 >/dev/null 2>&1; then echo "deb [trusted=yes] https://apt.llvm.org/noble/ llvm-toolchain-noble main" | sudo tee /etc/apt/sources.list.d/llvm-toolchain-noble.list sudo apt update - sudo apt install -y clang-24 lld-24 libclang-24-dev + # libeigen3-dev: Eigen 3.4.0 for libczirw (see the cmake-shim step below) + sudo apt install -y clang-24 lld-24 libclang-24-dev libeigen3-dev fi shell: bash @@ -95,6 +96,40 @@ jobs: mv ~/osxcross ~/.osxcross fi + - name: Prefer system Eigen in the libczirw cmake build + run: | + # libczirw-sys cmake build clones Eigen3 from gitlab.com (ExternalProject); + # that clone is flaky on this runner (it is the only git-based network step + # left in the build). noble libeigen3-dev is the same Eigen 3.4.0 that libczi + # pins, and libczi has an upstream option to use it - flip that option for + # the libCZI project via CMAKE_PROJECT_INCLUDE. cmake does not read that + # variable from the environment, so a cmake shim injects it (-D); the shim is + # scoped to invocations that look like the libczi configure (no-op for + # --build / --version / other uses). + mkdir -p /root/ci-shims + cat > /root/cm-override-libczi.cmake <<'CMAKEEOF' + if (CMAKE_PROJECT_NAME STREQUAL "libCZI") + set(LIBCZI_BUILD_PREFER_EXTERNALPACKAGE_EIGEN3 ON CACHE BOOL "" FORCE) + endif() + CMAKEEOF + cat > /root/ci-shims/cmake <<'SHIMEOF' + #!/usr/bin/env bash + case "$*" in + --build*) + exec /usr/bin/cmake "$@" ;; + *libczi*) + exec /usr/bin/cmake -DCMAKE_PROJECT_INCLUDE=/root/cm-override-libczi.cmake "$@" ;; + *) + exec /usr/bin/cmake "$@" ;; + esac + SHIMEOF + chmod +x /root/ci-shims/cmake + echo "--- /root/cm-override-libczi.cmake ---" + cat /root/cm-override-libczi.cmake + echo "--- /root/ci-shims/cmake ---" + cat /root/ci-shims/cmake + shell: bash + - name: Build wheels env: # ziglang >= 0.17's bundled libc++ needs these -D_LIBCPP_* macros when @@ -110,6 +145,9 @@ jobs: shell: bash run: | export PATH="$HOME/.osxcross/bin:$PATH" + # put the cmake shim (system-Eigen override for libczirw) in front + export PATH="/root/ci-shims:$PATH" + command -v cmake echo "HOME=$HOME CARGO_HOME=$CARGO_HOME RUSTUP_HOME=$RUSTUP_HOME" command -v cargo-zigbuild || echo "cargo-zigbuild: not on PATH" cargo-zigbuild --version 2>&1 || true