From ab4dce3a148668fcac02d105be568cd15a91ca92 Mon Sep 17 00:00:00 2001 From: Jim Schaff Date: Sat, 24 Oct 2026 01:50:19 -0400 Subject: [PATCH 1/3] fix(ci): bundle the C++ runtime in the Linux wheels (auditwheel repair); version 0.9.7 The Linux wheels were hand-retagged manylinux_2_28 without auditwheel, so libIDAWin.so's libc++, libc++abi and libunwind were never bundled and pyvcell_odesolver fails to load on a stock Linux (libc++.so.1: cannot open shared object file). The new verify-wheels job installs each Linux wheel on clean runners and solves a reference input. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/cd.yml | 71 +++++++++++++++++++++++++++++++++++----- pyproject.toml | 2 +- 2 files changed, 63 insertions(+), 10 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 170d328b..d20e62ce 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -366,15 +366,26 @@ jobs: cp -r build/lib/* pyvcell_odesolver/lib/ uv sync --extra build --extra test uv run pytest - uv build --wheel -o wheelhouse - - - name: Re-tag Python Wheel - if: matrix.platform.type == 'gnu_amd64' - run: uv run python -m wheel tags --remove --platform-tag manylinux_2_28_x86_64 ./wheelhouse/$(ls ./wheelhouse) + uv build --wheel -o dist - - name: Re-tag Python Wheel - if: matrix.platform.type == 'gnu_arm64' - run: uv run python -m wheel tags --remove --platform-tag manylinux_2_28_aarch64 ./wheelhouse/$(ls ./wheelhouse) + # libIDAWin.so links clang's libc++, libc++abi and libunwind, which a stock Linux does not have (the release + # archive bundles them too, package_linux.sh). auditwheel copies them into the wheel (pyvcell_odesolver.libs/) + # and sets the rpath; it starts from a platform-tagged wheel and finds them in clang's resource tree. + - name: Repair the Python wheel (bundle the C++ runtime) + shell: bash + run: | + set -euo pipefail + arch="$(uname -m)" + uv run python -m wheel tags --remove --platform-tag "linux_$arch" ./dist/$(ls ./dist) + search="" + for lib in libc++.so.1 libc++abi.so.1 libunwind.so.1; do + p="$(clang++ -print-file-name="$lib" 2>/dev/null || true)" + if [ -n "$p" ] && [ "${p#/}" != "$p" ] && [ -e "$p" ]; then search="$search:$(dirname "$p")"; fi + done + AUDITWHEEL=auditwheel; command -v auditwheel > /dev/null || AUDITWHEEL="uvx auditwheel" + LD_LIBRARY_PATH="${search#:}${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" \ + $AUDITWHEEL repair --plat "manylinux_2_28_$arch" -w wheelhouse ./dist/*.whl + $AUDITWHEEL show wheelhouse/*.whl - name: Upload Python Wheel uses: actions/upload-artifact@v7 @@ -547,6 +558,48 @@ jobs: fi + verify-wheels: + name: Verify the ${{ matrix.wheel }} wheel on ${{ matrix.container || matrix.runner }} + needs: [ Linux ] + strategy: + fail-fast: false + matrix: + include: + - { wheel: gnu_amd64, runner: ubuntu-24.04 } + - { wheel: gnu_amd64, runner: ubuntu-24.04, container: "rockylinux:8" } # glibc 2.28 + - { wheel: gnu_arm64, runner: ubuntu-24.04-arm } + runs-on: ${{ matrix.runner }} + container: ${{ matrix.container }} + steps: + - name: Tools for a bare container + if: matrix.container != '' + run: | + dnf module enable -y nodejs:24 + dnf install -y nodejs python3.11 python3.11-pip + + - uses: actions/checkout@v6 + with: + sparse-checkout: tests/reference + + - uses: actions/download-artifact@v8 + with: + name: pyvcell-ode-${{ matrix.wheel }} + path: dl + + # a clean system, without clang's runtime: the wheel must carry everything libIDAWin.so loads + - name: Install the wheel and solve a reference input + shell: bash + run: | + set -euo pipefail + py=python3; command -v python3.11 > /dev/null && py=python3.11 + $py -m venv "$RUNNER_TEMP/venv" + "$RUNNER_TEMP/venv/bin/pip" install -q dl/*.whl + cd tests/reference + "$RUNNER_TEMP/venv/bin/python" -c "import pyvcell_odesolver as o; print(o.version())" + "$RUNNER_TEMP/venv/bin/python" -c "import sys, pyvcell_odesolver as o; sys.exit(o.solve('cvode_simple.cvodeInput', sys.argv[1], 0))" "$RUNNER_TEMP/cvode_simple.ida" + "$RUNNER_TEMP/venv/bin/python" compare_ida.py cvode_simple.ida.ref "$RUNNER_TEMP/cvode_simple.ida" + + release-assets: name: Attach release assets if: github.event_name == 'release' && github.event.action == 'published' @@ -584,7 +637,7 @@ jobs: publish-to-pypi: name: Publish to PyPI - needs: [ WindowsOS, MacOS-Universal, Linux, verify-archives ] + needs: [ WindowsOS, MacOS-Universal, Linux, verify-archives, verify-wheels ] runs-on: ubuntu-latest if: github.event_name == 'release' && github.event.action == 'published' environment: pypi diff --git a/pyproject.toml b/pyproject.toml index a5ca96a1..92c31f4a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "uv_build" [project] name = "pyvcell_odesolver" -version = "0.9.6" +version = "0.9.7" description="Virtual Cell CVODE / IDA based ODE solver" readme = "README.md" authors = [ From e9301988895c2e79fd084083df5ed7c54580d824 Mon Sep 17 00:00:00 2001 From: Jim Schaff Date: Sat, 24 Oct 2026 02:06:17 -0400 Subject: [PATCH 2/3] fix(ci): bundle libatomic beside libc++ in the Linux wheels libc++ needs libatomic.so.1, which auditwheel leaves to the system, and a minimal Rocky 8 does not have it (verify-wheels on rockylinux:8: libatomic.so.1: cannot open shared object file). Co-Authored-By: Claude Opus 5.5 --- .github/workflows/cd.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index d20e62ce..f4edf502 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -383,9 +383,18 @@ jobs: if [ -n "$p" ] && [ "${p#/}" != "$p" ] && [ -e "$p" ]; then search="$search:$(dirname "$p")"; fi done AUDITWHEEL=auditwheel; command -v auditwheel > /dev/null || AUDITWHEEL="uvx auditwheel" - LD_LIBRARY_PATH="${search#:}${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" \ - $AUDITWHEEL repair --plat "manylinux_2_28_$arch" -w wheelhouse ./dist/*.whl + export LD_LIBRARY_PATH="${search#:}${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}" + $AUDITWHEEL repair --plat "manylinux_2_28_$arch" -w wheelhouse ./dist/*.whl + # auditwheel counts libatomic (which libc++ needs) as a system library, but a minimal RHEL 8 lacks it: + # put it beside the bundled libc++, whose rpath is $ORIGIN (the release archive bundles it too) + libatomic="$(ldd "$(clang++ -print-file-name=libc++.so.1)" | awk '$1 == "libatomic.so.1" {print $3}')" + if [ -n "$libatomic" ]; then + uv run python -m wheel unpack -d unpacked ./wheelhouse/*.whl + cp -L "$libatomic" unpacked/*/pyvcell_odesolver.libs/libatomic.so.1 + uv run python -m wheel pack -d wheelhouse unpacked/* + fi $AUDITWHEEL show wheelhouse/*.whl + python3 -m zipfile -l wheelhouse/*.whl | grep -E '\.so' - name: Upload Python Wheel uses: actions/upload-artifact@v7 From ae0d6f189bea92d5e1aed7f74f95e1c57c96aae5 Mon Sep 17 00:00:00 2001 From: Jim Schaff Date: Sat, 24 Oct 2026 02:22:09 -0400 Subject: [PATCH 3/3] fix(ci): place libatomic beside the bundled libc++, wherever the repaired wheel put it Co-Authored-By: Claude Opus 5.5 --- .github/workflows/cd.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index f4edf502..534693fc 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -390,7 +390,9 @@ jobs: libatomic="$(ldd "$(clang++ -print-file-name=libc++.so.1)" | awk '$1 == "libatomic.so.1" {print $3}')" if [ -n "$libatomic" ]; then uv run python -m wheel unpack -d unpacked ./wheelhouse/*.whl - cp -L "$libatomic" unpacked/*/pyvcell_odesolver.libs/libatomic.so.1 + libcxx="$(find unpacked -name 'libc++-*.so*' | head -1)" + if [ -z "$libcxx" ]; then find unpacked; echo "::error::no bundled libc++ in the repaired wheel"; exit 1; fi + cp -L "$libatomic" "$(dirname "$libcxx")/libatomic.so.1" uv run python -m wheel pack -d wheelhouse unpacked/* fi $AUDITWHEEL show wheelhouse/*.whl