Skip to content

Commit 01332eb

Browse files
build known packages with c/c++/rust extension to prevent building pacakges like cpython, meson, ninja, etc from source
Signed-off-by: Cédrik Fuoco <cedrik.fuoco@autodesk.com>
1 parent 2f68b52 commit 01332eb

2 files changed

Lines changed: 13 additions & 5 deletions

File tree

cmake/dependencies/python3.cmake

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -272,8 +272,15 @@ ELSE()
272272
SET(_otio_debug_env "")
273273
ENDIF()
274274

275-
# Using --no-binary :all: to ensure all packages with native extensions are built from source
276-
# against our custom Python build, preventing ABI compatibility issues.
275+
# Force source builds only for packages with C/C++/Rust extensions that need to link against our custom Python.
276+
# All other packages (including build tools like Cython) can use pre-built wheels, which avoids
277+
# path length issues on Windows and improves build speed.
278+
# Packages built from source:
279+
# - opentimelineio: C++ extensions, uses CMAKE_ARGS for proper linking
280+
# - numpy: C extensions that need our Python ABI
281+
# - PyOpenGL-accelerate: Cython extensions
282+
# - cryptography: C extensions linking to OpenSSL
283+
# - pydantic: Has Rust extensions (pydantic-core) in v2+
277284
SET(_requirements_install_command
278285
${CMAKE_COMMAND} -E env
279286
${_otio_debug_env}
@@ -286,7 +293,7 @@ ENDIF()
286293

287294
LIST(APPEND _requirements_install_command
288295
"CMAKE_ARGS=-DPYTHON_LIBRARY=${_python3_cmake_library} -DPYTHON_INCLUDE_DIR=${_include_dir} -DPYTHON_EXECUTABLE=${_python3_executable}"
289-
"${_python3_executable}" -s -E -I -m pip install --upgrade --no-cache-dir --force-reinstall --no-binary :all: --only-binary pip,setuptools,wheel -r "${_requirements_output_file}"
296+
"${_python3_executable}" -s -E -I -m pip install --upgrade --no-cache-dir --force-reinstall --no-binary opentimelineio,numpy,PyOpenGL-accelerate,cryptography,pydantic -r "${_requirements_output_file}"
290297
)
291298

292299
IF(RV_TARGET_WINDOWS)

src/build/requirements.txt.in

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
# NOTE: This is a CMake template file. The actual requirements.txt is generated during CMake configuration.
33
# To update OpenTimelineIO version, edit RV_DEPS_OTIO_VERSION in cmake/defaults/CYCOMMON.cmake
44
# To update NumPy version, edit RV_DEPS_NUMPY_VERSION in cmake/defaults/CY*.cmake
5-
# NOTE: Using --no-binary :all: in pip install ensures all packages are built from source against our custom Python.
6-
# NOTE: pip, setuptools, and wheel are exceptions - they use pre-built binaries for compatibility.
5+
# NOTE: Packages with C/C++/Rust extensions (opentimelineio, numpy, PyOpenGL-accelerate, cryptography, pydantic)
6+
# are built from source to ensure proper linking with our custom Python. Other packages use pre-built wheels.
7+
# See python3.cmake
78

89
pip # License: MIT License (MIT)
910
setuptools # License: MIT License

0 commit comments

Comments
 (0)