From 90413864d2120e5876ea36f1829b30bc03f3d5d4 Mon Sep 17 00:00:00 2001 From: "Hans J. Johnson" Date: Wed, 25 Nov 2026 20:09:03 -0600 Subject: [PATCH 1/2] DOC: Document --exclude-libs on Linux and the one manylinux version #315 made --exclude-libs (-x in the Linux module script) pass each library to auditwheel as --exclude, but AGENTS.md and README.md still called it Windows only, and the module guide did not show -x. AGENTS.md and the ITK build guide also listed _2_34 as a manylinux version. Only manylinux_2_28 has a pixi environment and ITK caches, and the Linux module script now rejects anything else. The Windows example in the module guide used Python 3.10 and showed --exclude-libs where the text described --lib-paths; it now shows both with Python 3.11. --- AGENTS.md | 12 ++++++------ README.md | 4 ++-- docs/Build_ITK_Module_Python_packages.rst | 14 ++++++++++---- docs/Build_ITK_Python_packages.rst | 2 +- 4 files changed, 19 insertions(+), 13 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 965631a1..9326ca30 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -298,12 +298,12 @@ not a real flag; do not invent one. **Platform options** -| Argument | Meaning | -| -------------------------------- | ----------------------------------------------- | -| `--macosx-deployment-target VER` | macOS floor and wheel tag | -| `--manylinux-version VER` | `_2_28`, `_2_34`; empty builds native Linux | -| `--lib-paths DIRS` | Windows only; `;`-delimited dirs for delvewheel | -| `--exclude-libs DLLS` | Windows only; `;`-delimited DLLs not to bundle | +| Argument | Meaning | +| -------------------------------- | ------------------------------------------------ | +| `--macosx-deployment-target VER` | macOS floor and wheel tag | +| `--manylinux-version VER` | `_2_28`; empty builds native Linux | +| `--lib-paths DIRS` | Windows only; `;`-delimited dirs for delvewheel | +| `--exclude-libs LIBS` | Windows, Linux; `;`-delimited libs not to bundle | **Remote modules** diff --git a/README.md b/README.md index 72940797..60a4793e 100644 --- a/README.md +++ b/README.md @@ -202,7 +202,7 @@ Key options: | `--use-compiler-cache` | sccache on Windows, ccache elsewhere (`--use-ccache`) | (flag) | | `--no-dead-strip` | Linux, macOS: keep unreferenced code (default: strip) | (flag) | | `--lib-paths` | Windows only: `;`-delimited dirs for delvewheel | `C:\deps\bin` | -| `--exclude-libs` | Windows only: `;`-delimited DLLs delvewheel must skip | `nvcuda.dll` | +| `--exclude-libs` | Windows, Linux: `;`-delimited libraries not to bundle | `nvcuda.dll`, `libcuda.so.1` | | `--no-build-itk-tarball-cache` | Skip tarball generation (default) | (flag) | | `--no-skip-itk-build` | Don't skip ITK build step (default | (flag) | | `--no-skip-itk-wheel-build` | Don't skip the ITK wheel build step (default) | (flag) | @@ -353,7 +353,7 @@ Key environment variables: | `ITK_SOURCE_DIR` | `/ITKPythonPackage-build/ITK` | Path to local ITK source (skips git clone) | | `ITK_PACKAGE_VERSION` | derived from git | PEP 440 version of the wheels | | `TARGET_ARCH` | host architecture | `x64` or `aarch64` | -| `MANYLINUX_VERSION` | `_2_28` | Manylinux standard to target | +| `MANYLINUX_VERSION` | `_2_28` | Manylinux standard to target; only `_2_28` is built | | `IMAGE_TAG` | `20260203-3dfb3ff` (dockcross) or `2025.08.12-1` (quay manylinux) | Container image tag; the default depends on `CONTAINER_SOURCE` | | `CONTAINER_DNS` | unset (container runtime default) | DNS servers for the build container, space- or comma-separated; this script only | | `USE_COMPILER_CACHE` | `0` (`USE_CCACHE` also accepted) | Compile through ccache in the container | diff --git a/docs/Build_ITK_Module_Python_packages.rst b/docs/Build_ITK_Module_Python_packages.rst index 6fb4924d..8d8bbee8 100644 --- a/docs/Build_ITK_Module_Python_packages.rst +++ b/docs/Build_ITK_Module_Python_packages.rst @@ -163,7 +163,7 @@ Key environment variables: - Root directory for build artifacts * - ``MANYLINUX_VERSION`` - ``_2_28`` - - Manylinux compatibility standard + - Manylinux compatibility standard; the script accepts only ``_2_28`` * - ``CMAKE_OPTIONS`` - *(empty)* - Extra CMake ``-D`` definitions @@ -246,18 +246,24 @@ the build script:: export LD_LIBRARY_PATH=/path/to/mylib/lib:$LD_LIBRARY_PATH +A library the wheel must not bundle, such as the CUDA driver, is named with +``-x`` (``--exclude_libs``); separate several names with ``;``:: + + ./dockcross-manylinux-download-cache-and-build-module-wheels.sh -x "libcuda.so.1" cp311 + **macOS**: add the directory to ``DYLD_LIBRARY_PATH``:: export DYLD_LIBRARY_PATH=/path/to/mylib/lib:$DYLD_LIBRARY_PATH **Windows**: pass the library directory via ``--lib-paths`` (or the -``-setup_options`` parameter of the PowerShell script): +``-setup_options`` parameter of the PowerShell script), and name a DLL the +wheel must not bundle with ``--exclude-libs``: .. code-block:: powershell .\windows-download-cache-and-build-module-wheels.ps1 ` - -python_version_minor 10 ` - -setup_options "--exclude-libs nvcuda.dll" + -python_version_minor 11 ` + -setup_options "--lib-paths C:\CUDA\bin --exclude-libs nvcuda.dll" Output diff --git a/docs/Build_ITK_Python_packages.rst b/docs/Build_ITK_Python_packages.rst index 385b2074..2f21c036 100644 --- a/docs/Build_ITK_Python_packages.rst +++ b/docs/Build_ITK_Python_packages.rst @@ -164,7 +164,7 @@ Key Options - Root directory for all build artifacts * - ``--manylinux-version`` - ``$MANYLINUX_VERSION``, else empty - - Manylinux compatibility standard (e.g. ``_2_28``, ``_2_34``); empty + - Manylinux compatibility standard; only ``_2_28`` is built. Empty builds native Linux, and a ``manylinux228-*`` platform env implies ``_2_28`` * - ``--itk-source-dir`` From 0e32938cd388cea1d6e23b82ba1e4991d7334ef3 Mon Sep 17 00:00:00 2001 From: "Hans J. Johnson" Date: Wed, 25 Nov 2026 20:09:03 -0600 Subject: [PATCH 2/2] STYLE: Describe what is, not what was, in two comments A comment on the manylinux check and a test docstring explained the code by the behavior it replaced. --- ...ockcross-manylinux-download-cache-and-build-module-wheels.sh | 2 +- tests/test_build_steps.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/dockcross-manylinux-download-cache-and-build-module-wheels.sh b/scripts/dockcross-manylinux-download-cache-and-build-module-wheels.sh index b5ffb18a..36159e48 100755 --- a/scripts/dockcross-manylinux-download-cache-and-build-module-wheels.sh +++ b/scripts/dockcross-manylinux-download-cache-and-build-module-wheels.sh @@ -108,7 +108,7 @@ ITK_GIT_TAG=${ITK_GIT_TAG:=${ITK_PACKAGE_VERSION}} # Set default values MANYLINUX_VERSION=${MANYLINUX_VERSION:-_2_28} TARGET_ARCH=${TARGET_ARCH:-x64} -# ITKPythonBuilds has caches for manylinux_2_28 only; manylinux2014 is no longer built. +# ITKPythonBuilds publishes caches for manylinux_2_28 only. if [ "${MANYLINUX_VERSION}" != "_2_28" ]; then echo "ERROR: MANYLINUX_VERSION=${MANYLINUX_VERSION} is not built; module wheels are manylinux_2_28 only." exit 1 diff --git a/tests/test_build_steps.py b/tests/test_build_steps.py index 1c2b9229..fdccc474 100644 --- a/tests/test_build_steps.py +++ b/tests/test_build_steps.py @@ -155,7 +155,7 @@ def second() -> object: def test_a_module_build_keeps_its_own_step_report( linux_builder: LinuxBuildPythonInstance, ) -> None: - """A module's inputs differ from ITK's, so a shared report reran every step.""" + """A module's inputs differ from ITK's, so each needs its own report.""" builder = _configure(linux_builder) builder.dist_dir = Path("dist") assert builder.build_report_path().name == "build_log_manylinux228-py311.json"