From d4a5bca8baf305fb2bd318164cf9f01ac117f4b0 Mon Sep 17 00:00:00 2001 From: "w.pomp" Date: Wed, 28 Oct 2026 15:20:12 +0100 Subject: [PATCH] - try fix publish_pypi --- .github/workflows/publish_pypi.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.github/workflows/publish_pypi.yml b/.github/workflows/publish_pypi.yml index f9288e0..57d7dca 100644 --- a/.github/workflows/publish_pypi.yml +++ b/.github/workflows/publish_pypi.yml @@ -39,6 +39,15 @@ jobs: sudo apt update sudo apt install -y llvm cmake build-essential libclang-dev clang fi + # the stock clang on noble is 18, but the 2025+ MSVC STL bundled with + # cargo-xwin requires clang >= 19 (yvals_core.h "error STL1000: expected + # Clang 19.0.0 or newer"). Install a newer toolchain from apt.llvm.org so + # its clang-cl driver, lld-link and libclang (bindgen) are all new enough. + 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 + fi shell: bash - name: Install Rust @@ -127,6 +136,14 @@ jobs: rustup target add aarch64-unknown-linux-musl maturin build --release --out dist --target aarch64-unknown-linux-musl --zig --auditwheel repair -m ndbioimage/Cargo.toml + # cargo-xwin resolves clang-cl / lld-link through PATH and bindgen finds + # libclang via LIBCLANG_PATH, so prefer the >=19 toolchain over the stock + # clang-18 (rejected by the 2025+ MSVC STL with STL1000) for the msvc builds + export PATH="/usr/lib/llvm-24/bin:$PATH" + export LIBCLANG_PATH="/usr/lib/llvm-24/lib" + command -v clang-cl + clang-cl --version + command -v lld-link rustup target add x86_64-pc-windows-msvc maturin build --release --out dist --target x86_64-pc-windows-msvc --auditwheel repair -m ndbioimage/Cargo.toml rustup target add aarch64-pc-windows-msvc