From cecef9b62b0e3ffd8fdd3f7a31aaab726b8211ea Mon Sep 17 00:00:00 2001 From: filipovic Date: Sun, 19 Jul 2026 02:20:45 +0200 Subject: [PATCH 1/3] Remvoe CUDA requirement from pypy wheel build --- .github/workflows/python.yml | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index 997fc4b2..31685676 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -153,24 +153,21 @@ jobs: env: CIBW_SKIP: ${{ matrix.skip }} CIBW_MANYLINUX_X86_64_IMAGE: ghcr.io/viennatools/vienna-builder:cuda-python - CIBW_REPAIR_WHEEL_COMMAND_LINUX: >- - auditwheel repair - --exclude libcuda.so.1 - --exclude libcudart.so.12 - --exclude libcusparse.so.12 - --exclude libnvJitLink.so.12 - -w {dest_dir} {wheel} CIBW_TEST_COMMAND: >- python -c "import viennals; print(viennals.__file__); print(viennals.d2); print(viennals.d3)" + # VIENNALS_USE_GPU is deliberately OFF for wheels: it puts hard + # DT_NEEDED entries for libcudart/libcusparse on _core.so, and those + # are far too large to vendor (libcusparse alone is >160 MB, over the + # PyPI file limit). The wheel would then fail to import on any machine + # without a CUDA toolkit. GPU users build from source with + # -DVIENNALS_USE_GPU=ON. CIBW_CONFIG_SETTINGS: >- cmake.define.VIENNALS_PACKAGE_PYTHON=ON cmake.define.VIENNALS_IS_CI=ON cmake.define.VIENNALS_VTK_RENDERING=ON - cmake.define.VIENNALS_USE_GPU=ON - cmake.define.VIENNACORE_LINK_CUDA_DRIVER=OFF cmake.define.USE_IPO=OFF - name: 🏗️ Build Wheels (Other) From bcf9f268124af0518237a526d172f97fff8673d9 Mon Sep 17 00:00:00 2001 From: filipovic Date: Sun, 19 Jul 2026 10:43:41 +0200 Subject: [PATCH 2/3] ci: source libaec from GitHub mirror to unblock Windows builds. This is a workaround for an upstream outage --- .github/vcpkg-overlays/libaec/portfile.cmake | 64 ++++++++++++++++++++ .github/vcpkg-overlays/libaec/usage | 7 +++ .github/vcpkg-overlays/libaec/vcpkg.json | 17 ++++++ .github/workflows/build.yml | 6 +- .github/workflows/python.yml | 6 +- 5 files changed, 98 insertions(+), 2 deletions(-) create mode 100644 .github/vcpkg-overlays/libaec/portfile.cmake create mode 100644 .github/vcpkg-overlays/libaec/usage create mode 100644 .github/vcpkg-overlays/libaec/vcpkg.json diff --git a/.github/vcpkg-overlays/libaec/portfile.cmake b/.github/vcpkg-overlays/libaec/portfile.cmake new file mode 100644 index 00000000..8d1a4ee4 --- /dev/null +++ b/.github/vcpkg-overlays/libaec/portfile.cmake @@ -0,0 +1,64 @@ +# Overlay of the upstream vcpkg `libaec` port, identical to the port at our +# pinned vcpkg baseline except for where the sources come from. +# +# Upstream fetches from https://gitlab.dkrz.de/k202009/libaec. That host now +# answers every request to its /-/archive/ tarball endpoint with a bare +# nginx "429 Too Many Requests" (no Retry-After), so any cold vcpkg build +# fails there and no amount of retrying gets past it. The repository web +# pages still serve 200 — it is specifically the archive endpoint that is +# rate limited. +# +# libaec reaches us only as a transitive dependency: vtk -> hdf5 -> (szip +# feature) -> libaec, so it cannot simply be dropped. +# +# MathisRosenhauer/libaec on GitHub is the upstream author's mirror of the +# same project. The SHA512 below is of GitHub's v1.1.6 tarball, which is a +# different archive from GitLab's and therefore has a different hash than +# upstream's portfile records. +# +# Remove this overlay once gitlab.dkrz.de serves archives again. + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO MathisRosenhauer/libaec + REF "v${VERSION}" + SHA512 76df7501d1b7d91a43b525ba828f092f18d83f8ab09a9331e5758f93942a9758ad580baca8f9316b92a98639bde2e23cacbc2f33f52d0dd98ce7efe412cf43cd + HEAD_REF master +) + +string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" BUILD_STATIC) + +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" + OPTIONS + -DBUILD_STATIC_LIBS=${BUILD_STATIC} + -Dlibaec_INSTALL_CMAKEDIR=share/${PORT} +) +vcpkg_cmake_install() +vcpkg_copy_pdbs() +vcpkg_cmake_config_fixup() +vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/share/libaec/libaec-config.cmake" + "if(libaec_USE_STATIC_LIBS)" + "if(\"${BUILD_STATIC}\") # forced by vcpkg" +) + +# Compatibility with user's CMake < 3.18 (vcpkg claims support for >= 3.16): +# Make imported targets global so that libaec-config.cmake can create ALIAS targets. +set(_target_file "libaec_shared-targets") +if(BUILD_STATIC) + set(_target_file "libaec_static-targets") +endif() +file(READ "${CURRENT_PACKAGES_DIR}/share/libaec/${_target_file}.cmake" libaec_targets) +string(REGEX REPLACE " (SHARED|STATIC) IMPORTED" " \\1 IMPORTED \${libaec_maybe_global}" libaec_targets "${libaec_targets}") +file(WRITE "${CURRENT_PACKAGES_DIR}/share/libaec/${_target_file}.cmake" "set(libaec_maybe_global \"\") +if(CMAKE_VERSION VERSION_LESS 3.18) + set(libaec_maybe_global \"GLOBAL\") +endif() +${libaec_targets} +" +) + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") + +file(INSTALL "${CURRENT_PORT_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE.txt") diff --git a/.github/vcpkg-overlays/libaec/usage b/.github/vcpkg-overlays/libaec/usage new file mode 100644 index 00000000..a6aeb5f6 --- /dev/null +++ b/.github/vcpkg-overlays/libaec/usage @@ -0,0 +1,7 @@ +libaec provides CMake targets: + + find_package(libaec CONFIG REQUIRED) + # libaec API + target_link_libraries(main PRIVATE libaec::aec) + # szip compatible API + target_link_libraries(main PRIVATE libaec::sz) diff --git a/.github/vcpkg-overlays/libaec/vcpkg.json b/.github/vcpkg-overlays/libaec/vcpkg.json new file mode 100644 index 00000000..299cd632 --- /dev/null +++ b/.github/vcpkg-overlays/libaec/vcpkg.json @@ -0,0 +1,17 @@ +{ + "name": "libaec", + "version": "1.1.6", + "description": "Adaptive Entropy Coding library", + "homepage": "https://github.com/MathisRosenhauer/libaec", + "license": "BSD-2-Clause", + "dependencies": [ + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ] +} diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5d24b799..6ffad122 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -78,7 +78,11 @@ jobs: if: ${{ matrix.os == 'windows-latest' && steps.vcpkg-installed-cache.outputs.cache-hit != 'true' }} shell: pwsh run: | - ./vcpkg/vcpkg install --triplet x64-windows + # The libaec overlay sources that port from GitHub instead of + # gitlab.dkrz.de, whose archive endpoint returns 429 to everyone. + # See .github/vcpkg-overlays/libaec/portfile.cmake. + ./vcpkg/vcpkg install --triplet x64-windows ` + --overlay-ports="${{ github.workspace }}/.github/vcpkg-overlays" - name: 🏗️ Compile (Windows) if: ${{ matrix.os == 'windows-latest' }} diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index 31685676..6ad060dc 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -75,7 +75,11 @@ jobs: if: ${{ matrix.os == 'windows-latest' && steps.vcpkg-installed-cache.outputs.cache-hit != 'true' }} shell: pwsh run: | - ./vcpkg/vcpkg install --triplet x64-windows + # The libaec overlay sources that port from GitHub instead of + # gitlab.dkrz.de, whose archive endpoint returns 429 to everyone. + # See .github/vcpkg-overlays/libaec/portfile.cmake. + ./vcpkg/vcpkg install --triplet x64-windows ` + --overlay-ports="${{ github.workspace }}/.github/vcpkg-overlays" - name: 🐍 Build and check Python Module (Windows) if: ${{ matrix.os == 'windows-latest' }} From a3f4540c5bd7f019ec8b6c1969db1091fbf61f99 Mon Sep 17 00:00:00 2001 From: filipovic Date: Sun, 19 Jul 2026 11:23:13 +0200 Subject: [PATCH 3/3] format --- .github/vcpkg-overlays/libaec/portfile.cmake | 40 ++++++++++---------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/.github/vcpkg-overlays/libaec/portfile.cmake b/.github/vcpkg-overlays/libaec/portfile.cmake index 8d1a4ee4..e04dabea 100644 --- a/.github/vcpkg-overlays/libaec/portfile.cmake +++ b/.github/vcpkg-overlays/libaec/portfile.cmake @@ -19,44 +19,44 @@ # Remove this overlay once gitlab.dkrz.de serves archives again. vcpkg_from_github( - OUT_SOURCE_PATH SOURCE_PATH - REPO MathisRosenhauer/libaec - REF "v${VERSION}" - SHA512 76df7501d1b7d91a43b525ba828f092f18d83f8ab09a9331e5758f93942a9758ad580baca8f9316b92a98639bde2e23cacbc2f33f52d0dd98ce7efe412cf43cd - HEAD_REF master -) + OUT_SOURCE_PATH + SOURCE_PATH + REPO + MathisRosenhauer/libaec + REF + "v${VERSION}" + SHA512 + 76df7501d1b7d91a43b525ba828f092f18d83f8ab09a9331e5758f93942a9758ad580baca8f9316b92a98639bde2e23cacbc2f33f52d0dd98ce7efe412cf43cd + HEAD_REF + master) string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" BUILD_STATIC) -vcpkg_cmake_configure( - SOURCE_PATH "${SOURCE_PATH}" - OPTIONS - -DBUILD_STATIC_LIBS=${BUILD_STATIC} - -Dlibaec_INSTALL_CMAKEDIR=share/${PORT} -) +vcpkg_cmake_configure(SOURCE_PATH "${SOURCE_PATH}" OPTIONS -DBUILD_STATIC_LIBS=${BUILD_STATIC} + -Dlibaec_INSTALL_CMAKEDIR=share/${PORT}) vcpkg_cmake_install() vcpkg_copy_pdbs() vcpkg_cmake_config_fixup() vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/share/libaec/libaec-config.cmake" - "if(libaec_USE_STATIC_LIBS)" - "if(\"${BUILD_STATIC}\") # forced by vcpkg" -) + "if(libaec_USE_STATIC_LIBS)" "if(\"${BUILD_STATIC}\") # forced by vcpkg") # Compatibility with user's CMake < 3.18 (vcpkg claims support for >= 3.16): # Make imported targets global so that libaec-config.cmake can create ALIAS targets. set(_target_file "libaec_shared-targets") if(BUILD_STATIC) - set(_target_file "libaec_static-targets") + set(_target_file "libaec_static-targets") endif() file(READ "${CURRENT_PACKAGES_DIR}/share/libaec/${_target_file}.cmake" libaec_targets) -string(REGEX REPLACE " (SHARED|STATIC) IMPORTED" " \\1 IMPORTED \${libaec_maybe_global}" libaec_targets "${libaec_targets}") -file(WRITE "${CURRENT_PACKAGES_DIR}/share/libaec/${_target_file}.cmake" "set(libaec_maybe_global \"\") +string(REGEX REPLACE " (SHARED|STATIC) IMPORTED" " \\1 IMPORTED \${libaec_maybe_global}" + libaec_targets "${libaec_targets}") +file( + WRITE "${CURRENT_PACKAGES_DIR}/share/libaec/${_target_file}.cmake" + "set(libaec_maybe_global \"\") if(CMAKE_VERSION VERSION_LESS 3.18) set(libaec_maybe_global \"GLOBAL\") endif() ${libaec_targets} -" -) +") file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")