From dd916cf7f377407fe6a314f86a0da7848c10bb1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9drik=20Fuoco?= Date: Wed, 12 Aug 2026 11:37:15 -0400 Subject: [PATCH] fix: Pin pip build-isolation cmake to 4.4.0 for the OTIO wheel build MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Windows Debug jobs have failed on every nightly since 2026-08-05 with no OpenRV change. Two nightlies of the identical commit 6a3af6e9 straddle the boundary: Aug 4 passed, Aug 5 failed. OpenTimelineIO is built from source against our custom debug Python, and its setup.py runs find_package(Python ... Interpreter Development.Module) using the cmake wheel pip installs into the isolated build environment -- not the cmake driving the outer OpenRV build, and not the msys2 one. That resolution is unpinned, so it floats with PyPI. cmake 4.4.2 was published to PyPI on 2026-08-04T06:13:31Z, between those two runs. It contains "FindPython: Add support for pydebug ABI flag on Windows" (Kitware/CMake 84cb7e262), which reworks how the debug Python artifacts are located and makes that find_package fail: Could NOT find Python (missing: Interpreter Development.Module) (found version "3.11.9") Constrain the build environment via PIP_CONSTRAINT to cmake==4.4.0, the last version known good on Windows, Linux and macOS. Release builds are unaffected because they never build OTIO against a debug interpreter. Signed-off-by: Cédrik Fuoco --- cmake/dependencies/python3.cmake | 11 +++++++++-- src/build/pip-build-constraints.txt | 18 ++++++++++++++++++ 2 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 src/build/pip-build-constraints.txt diff --git a/cmake/dependencies/python3.cmake b/cmake/dependencies/python3.cmake index 3533bad3f..39db7665e 100644 --- a/cmake/dependencies/python3.cmake +++ b/cmake/dependencies/python3.cmake @@ -250,6 +250,13 @@ SET(_requirements_output_file CONFIGURE_FILE(${_requirements_input_file} ${_requirements_output_file} @ONLY) +# Constraints for the build-isolation environments pip creates for packages built from source. Their build requirements are resolved from PyPI on every build +# and are otherwise unpinned, so an upstream release can break a build that has not changed. See the file itself for what is pinned and why. PIP_CONSTRAINT must +# be an absolute path: pip resolves it relative to the working directory of each build-environment subprocess, which is not ours. +SET(_pip_constraint_file + "${PROJECT_SOURCE_DIR}/src/build/pip-build-constraints.txt" +) + # OpenTimelineIO needs to be built from source with CMAKE_ARGS to ensure it uses the correct custom-built Python libraries. This is required for both old and # new versions of pybind11, especially pybind11 v2.13.6+ which has stricter detection. Note: pybind11's FindPythonLibsNew.cmake uses PYTHON_LIBRARY (all caps), # PYTHON_INCLUDE_DIR, and PYTHON_EXECUTABLE variables. --no-cache-dir: Don't use pip's wheel cache (prevents using wheels built for wrong Python version) @@ -321,7 +328,7 @@ SET(_build_deps_install_command # Phase 2: Install main requirements (with build-from-source for native extensions) SET(_requirements_install_command - ${CMAKE_COMMAND} -E env ${_otio_debug_env} ${_sdkroot_env} + ${CMAKE_COMMAND} -E env ${_otio_debug_env} ${_sdkroot_env} "PIP_CONSTRAINT=${_pip_constraint_file}" ) # On Windows, the MinGW cmake (from msys2) appears before the Windows cmake in PATH. MinGW cmake defaults to MinGW Makefiles and cannot find the MSVC compiler. # OTIO's setup.py always calls "cmake" by name from PATH; it does not read CMAKE_GENERATOR. Prepend the directory of our outer build's cmake binary (the Windows @@ -493,7 +500,7 @@ ADD_CUSTOM_COMMAND( OUTPUT ${${_python3_target}-requirements-flag} COMMAND ${_requirements_install_command} COMMAND cmake -E touch ${${_python3_target}-requirements-flag} - DEPENDS ${_python3_target} ${${_python3_target}-build-deps-flag} ${_requirements_output_file} ${_requirements_input_file} + DEPENDS ${_python3_target} ${${_python3_target}-build-deps-flag} ${_requirements_output_file} ${_requirements_input_file} ${_pip_constraint_file} ) # Test Python package imports after requirements are installed. This validates that all pip-installed packages (numpy, opentimelineio, OpenGL, cryptography, diff --git a/src/build/pip-build-constraints.txt b/src/build/pip-build-constraints.txt new file mode 100644 index 000000000..9e4e6afc9 --- /dev/null +++ b/src/build/pip-build-constraints.txt @@ -0,0 +1,18 @@ +# Constraints applied to pip's build-isolation environments when installing the packages in requirements.txt. +# +# Packages built from source (notably OpenTimelineIO) get an isolated build environment whose build requirements are resolved fresh from PyPI on every build. +# Those resolutions float, so an upstream release can break a build that has not changed. Pin the ones that have bitten us here. +# +# cmake: OTIO's setup.py runs find_package(Python ... Interpreter Development.Module) using the cmake wheel installed into its isolated build environment (NOT +# the cmake driving the outer OpenRV build). cmake 4.4.2 added "FindPython: Add support for pydebug ABI flag on Windows" (Kitware/CMake 84cb7e262), which +# changes how the debug Python artifacts are located and makes that find_package fail against our custom debug Python on Windows: +# +# Could NOT find Python (missing: Interpreter Development.Module) (found version "3.11.9") +# +# This broke every Windows Debug CI build from 2026-08-05 onward with no OpenRV change: cmake 4.4.2 was published to PyPI on 2026-08-04T06:13:31Z, between two +# nightly runs of the same commit. 4.4.0 is the last version known good on Windows, Linux and macOS. +# +# TODO: This pin holds the line rather than adapting to the new behaviour. The forward fix is to satisfy 4.4.2+ directly -- likely by passing +# Python_LIBRARY_DEBUG in the CMAKE_ARGS built in cmake/dependencies/python3.cmake, and revisiting the python_d.lib -> python.lib copy in that same +# file, which predates cmake's own pydebug support and may now interfere with it. That needs a Windows Debug build to validate before the pin can be lifted. +cmake==4.4.0