Repository navigation
Conversation
The Linux module script ignored the exit status of the cache download: when the ITKPythonBuilds tarball was missing, dockcross-manylinux- download-cache.sh exited 1, and the script went on to run ITKPythonPackage/scripts/dockcross-manylinux-build-module-wheels.sh, which the missing tarball should have provided. The job then failed with exit 127, "No such file or directory", instead of the download error. Fetching the download script with plain curl -L likewise kept an HTTP error page as the script. Exit when either the download script cannot be fetched (curl -f) or it fails.
…uild Workflows that still list 2014-x64 in manylinux-platforms, such as ITKANTsWasm and ITKGenericLabelInterpolator, ran the Linux module script with MANYLINUX_VERSION=2014. It tried to download ITKPythonBuilds-manylinux2014-x64.tar.zst, which is no longer built, and then a container image and a pixi environment that do not exist. Say that only manylinux_2_28 is built, before downloading anything.
fixup_module_wheel called fixup_wheel without library paths, so a remote module's wheel was repaired with delvewheel --add-path "": the --lib-paths directories given to build_wheels.py (for instance -setup_options "--lib-paths C:\CUDA\bin", as windows-download-cache-and-build-module-wheels.ps1 documents) and oneTBB-prefix\bin were searched only for itk-core. A module that needs a DLL from one of them failed to repair, or bundled whatever copy was on PATH. The previous windows_build_module_wheels.py added both. Search the same directories for module wheels as for itk-core.
ITKRemoteModuleBuildTestPackageAction puts each Windows CMake option in double quotes and passes them as one string: -cmake_options '"-DA:BOOL=ON" "-DB=2"' The previous script ran its command line through Invoke-Expression, which removed those quotes. The new one splits the string on spaces and passes the pieces to pixi, so build_wheels.py received "-DA:BOOL=ON" with its quotes, did not take it for a -D definition, and stopped with "CMake option '\"-DA:BOOL=ON\"' is not a -D<KEY>=<VALUE> definition". Drop the quotes from each option, and skip empty pieces from repeated spaces. Checked with PowerShell 7.6 and Windows PowerShell 5.1.
ITKRemoteModuleBuildTestPackageAction runs ./macpython-download-cache-and-build-module-wheels.sh $CMAKE_OPTIONS 3.11 with CMAKE_OPTIONS="--cmake_options -DA=1 -DB=2" unquoted. The script took -DA=1 as the CMake options and -DB=2 as a Python version, built the module without -DB=2, failed to find a "macosx-py-DB=2" pixi environment, and still exited 0, because only the last build's status counted. Reject an unknown option, as the Linux module script does, and stop at the first build that fails.
The Linux module script accepted -x/--exclude_libs only to print that it was ignored, and build_wheels.py applied --exclude-libs on Windows alone. A module that links the CUDA driver or runtime, such as RTK with RTK_USE_CUDA, therefore had libcuda.so.1 and the other CUDA libraries grafted into its manylinux wheel by auditwheel, as the previous scripts prevented with auditwheel --exclude. Pass -x on to build_wheels.py as --exclude-libs, and give auditwheel an --exclude for each library it names.
dockcross-manylinux-build-module-wheels.sh mounts each LD_LIBRARY_PATH directory at /usr/lib64/<name> and sets LD_LIBRARY_PATH to those mount points, but no longer passes the variable into the container; the previous script added -e LD_LIBRARY_PATH to the docker arguments. auditwheel in the container therefore did not look in the mounted directories, and a module whose libraries come from there failed to repair. Pass the rewritten LD_LIBRARY_PATH to the container when it is set.
On Windows, subprocess.run(["bash", ...]) starts C:\Windows\System32\bash.exe, the WSL launcher, even when Git's bash comes first on PATH, because process creation searches System32 before PATH. Without a WSL distribution it fails, so 14 tests of the module scripts and require_env_vars.sh failed on Windows. Take bash from Git for Windows there, next to git, and skip the tests when there is none.
On Windows str(Path("/bdr/ITK")) is "\bdr\ITK", so four BuildConfig
environment tests, which expected "/bdr/ITK", failed there, and the
fake cgroup files of test_cgroup_v2_limit_caps_reported_memory, looked
up by str(path), were never found.
Expect the paths as the host renders them, and look the fake cgroup
files up by their POSIX form.
In a raw string "\\" is two backslashes, so r"C:\Program Files\7-Zip" named a path with doubled separators. pathlib collapses them, which is why 7-Zip was still found; write the paths as they are.
test_zip_fallback_archives_the_seven_zip_roots hid 7-Zip by patching shutil.which, but build_tarball checks C:\Program Files\7-Zip\7z.exe and two other fixed paths first. On a Windows host with 7-Zip installed, the test ran 7-Zip and failed. Name the fixed paths in a module constant, which the test empties.
build_tarball ran "7z a" on ITKPythonBuilds-windows.zip, which updates an existing archive: files deleted from the build tree since the last --build-itk-tarball-cache run stayed in the cache, and a module build extracting it got them back. Only the zip fallback removed the old archive first. Remove it before running 7-Zip too.
A remote module build wrote its steps to the same dist/build_log_<platform-env>.json as the ITK build. Its inputs carry a module state the ITK build's lack, so each run found the inputs changed and replaced the ITK build's records with its own skipped steps: the next ITK build reran every step, and dependency modules, built into the same report, did the same to each other. Name a module build's report build_log_<platform-env>_<module>.json.
The step report recorded the ITK commit, HEAD, as the build's ITK input. Editing ITK sources, or adding a file, without committing left it unchanged, so a rerun skipped the ITK build and wheel steps and packaged the previous build: the local edits never reached the wheels. Record "<commit>+<hash>" when the ITK tree has changes to tracked files or untracked files git does not ignore, as the module state already does for changes to a module's tracked files.
module_source_state hashed "git diff HEAD", which leaves out untracked files. Adding a new header, source, or .wrap file to a module without committing it left the state unchanged, so a rerun skipped the module wheel step and kept the wheel built without it. Hash the untracked files git does not ignore too, except the build outputs and caches MODULE_STATE_SKIP already leaves out of a module without a repository.
The build inputs left out --lib-paths, --exclude-libs, and, for a remote module, --module-itk-dir. Rerunning with a different value found every step done and kept wheels repaired with the old library paths and exclusions, or a module built against the other ITK tree. Add them to the settings the fingerprint covers.
post_build_cleanup removes the checkout's build/ directory. With --build-dir-root <ipp>/build, that is the build root itself, so --cleanup deleted dist/ and the wheels just built. Leave a directory that holds the build root in place.
sync_itk_source runs git with GIT_CEILING_DIRECTORIES set to the ITK tree's parent, so a tree restored from a cache, whose .git is empty, is used as it is. compute_itk_package_version then ran git with the plain environment: inside another checkout, such as a module or ITKPythonPackage clone, git found that repository, fetched its tags, checked out the ITK tag there, and named the wheels after its "git describe" if that worked. Give the version derivation the same environment, so such a tree gets the error that asks for --itk-package-version.
sync_itk_source lets a build go on without network access when the requested ITK revision is already present, but compute_itk_package_version then ran "git fetch --tags" again and stopped the build when it failed. An offline build with the default --itk-package-version gitauto could therefore never start. Warn and describe the revision with the local tags instead.
--use-compiler-cache sets CMAKE_C_COMPILER_LAUNCHER and CMAKE_CXX_COMPILER_LAUNCHER, and CMake keeps them in the build tree's cache. Rebuilding that tree with --no-use-compiler-cache set nothing, so the compiles still went through ccache or sccache. When the ITK build runs without the cache, set both launchers to empty and ITK_USE_CCACHE to OFF. A module build on a cached tree, which skips the ITK build, leaves them as they are: clearing them would only make the superbuild rebuild oneTBB, which gets the launcher too.
Without --platform-env, build_wheels.py used get_default_platform_build(), which spells the manylinux228-py311 environment manylinux_2_28-py311, the form the tarball names need. The environment guard then compared that with PIXI_ENVIRONMENT_NAME and aborted the build with "WRONG ENVIRONMENT" inside the very environment it asks for. Default to the active environment's own name when one is active.
The CMAKE_OPTIONS environment variable is split with shlex, which takes a backslash outside quotes for an escape character, so on Windows CMAKE_OPTIONS="-DFOO_DIR=C:\deps\foo" reached CMake as -DFOO_DIR=C:depsfoo. On Windows, double each backslash before splitting, so that the split keeps it.
ITK loads itk/__init_<module>__.py using the module name from itk/Configuration/<Module>Config.py, which need not match the distribution name: itk-vkfft wraps VkFFTBackend. Deriving the name from the distribution gave __init_vkfft__.py, so ITK never ran the DLL search setup delvewheel adds on Windows. Take the name from the wheel's Configuration member, keeping the distribution name as a fallback.
dzenanz
marked this pull request as ready for review
November 24, 2026 22:20
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes 22 problems found while reviewing and testing #312. Each commit fixes one problem, and its message explains it.
Changes by area
Remote module scripts
MANYLINUX_VERSIONother than_2_28, which is the only one with caches.-x/--exclude_libsto auditwheel as--exclude.LD_LIBRARY_PATHinto the container.--lib-pathsdirectories and oneTBB'sbin, asitk-coreis.Step report and rebuild inputs
itk_commit.module_state.--module-itk-direnter the fingerprint.Other build fixes
--cleanupkeepsdist/when the build root is inside the checkout.--platform-envdefaults to the active manylinux pixi environment, so the environment guard no longer aborts there.CMAKE_OPTIONSare kept.Tests on Windows
System32\bash.exe.Found in the review but left as is
Test results
pixi run teston Windows: 496 passed, 6 skipped. At ENH: Replace the shell wheel build system with Python (supersedes #309) #312's head, 20 tests failed on Windows.pre-commit run --all-filespasses, except prettier, which was skipped because its node environment does not install on this host.Type of Change
Checklist
pre-commit run --all-files), except prettierdocs/)BUG:,COMP:,DOC:,ENH:,PERF:,STYLE:)Platform(s) Tested
Related Issues
Follow-up to #312.
AI assistance