You are viewing a plain text version of this content. The canonical link for it is here.
Posted to discuss-archive@tvm.apache.org by "iamthebot (via GitHub)" <gi...@apache.org> on 2026/08/11 19:14:30 UTC

[PR] [FIX] Support free-threaded Python cross-builds [tvm-ffi]

iamthebot opened a new pull request, #706:
URL: https://github.com/apache/tvm-ffi/pull/706

   ## Summary
   
   - separate the host Python interpreter from target development artifacts during cross-compilation
   - select the free-threaded `t` ABI when CMake 4.4 enforces its non-`t` default
   - preserve scikit-build-core's target SOABI when naming the cross-built extension
   
   ## Background
   
   Cross-compiling against Python 3.14t currently finds the host interpreter and detects
   `Py_GIL_DISABLED`, but the second `FindPython` call combines that host interpreter with target
   `Development.Module` artifacts. CMake 4.4 also enforces the `gil_disabled` ABI default of `OFF`,
   so it rejects the installed `python3.14t` target headers and reports
   `missing: Development.Module`.
   
   The failing configurations are visible in
   [conda-forge/apache-tvm-ffi-feedstock#20](https://github.com/conda-forge/apache-tvm-ffi-feedstock/pull/20):
   Linux x86_64 to PPC64LE and macOS x86_64 to ARM64. Native Python 3.14t and cross-built GIL-enabled
   Python 3.14 already pass.
   
   This change keeps the first interpreter for free-thread detection and Cython, performs a
   development-only target lookup when cross-compiling, and uses `SKBUILD_SOABI` for the target
   extension suffix when available. Native discovery remains unchanged.
   
   Fixes #705.
   
   ## Testing
   
   - configured with CMake 4.4.2 against the exact PPC64LE Python 3.14t target headers; generated
     `core.cpython-314t-powerpc64le-linux-gnu.so`
   - configured with CMake 4.4.2 against the exact macOS ARM64 Python 3.14t target headers; generated
     `core.cpython-314t-darwin.so`
   - verified the cross path on CMake 3.26.4 and 3.30.5 with developer warnings treated as errors
   - built and imported an editable native Python 3.14t package; verified the extension retained its
     `cpython-314t` suffix
   - `pytest -n0 -vvs tests/python/test_free_threaded_python_helpers.py tests/python/test_build.py::test_build_cpp`
   - `cmake-format --check CMakeLists.txt`
   - `cmake-lint CMakeLists.txt`
   - ASF header, file-type, and whitespace checks
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: discuss-archive-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: discuss-archive-unsubscribe@tvm.apache.org
For additional commands, e-mail: discuss-archive-help@tvm.apache.org


Re: [PR] [FIX] Support free-threaded Python cross-builds [tvm-ffi]

Posted by "tqchen (via GitHub)" <gi...@apache.org>.
tqchen commented on PR #706:
URL: https://github.com/apache/tvm-ffi/pull/706#issuecomment-5493720848

   cc @cyx-6 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: discuss-archive-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: discuss-archive-unsubscribe@tvm.apache.org
For additional commands, e-mail: discuss-archive-help@tvm.apache.org


Re: [PR] [FIX] Support free-threaded Python cross-builds [tvm-ffi]

Posted by "tqchen (via GitHub)" <gi...@apache.org>.
tqchen merged PR #706:
URL: https://github.com/apache/tvm-ffi/pull/706


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: discuss-archive-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: discuss-archive-unsubscribe@tvm.apache.org
For additional commands, e-mail: discuss-archive-help@tvm.apache.org


Re: [PR] [FIX] Support free-threaded Python cross-builds [tvm-ffi]

Posted by "tqchen (via GitHub)" <gi...@apache.org>.
tqchen commented on code in PR #706:
URL: https://github.com/apache/tvm-ffi/pull/706#discussion_r3903925787


##########
CMakeLists.txt:
##########
@@ -243,25 +243,39 @@ if (TVM_FFI_BUILD_PYTHON_MODULE)
     COMPONENTS Interpreter
     REQUIRED
   )
+  set(_tvm_ffi_python_executable "${Python_EXECUTABLE}")

Review Comment:
   seems this is python executable itself, if so avoid setting new item



##########
CMakeLists.txt:
##########
@@ -243,25 +243,39 @@ if (TVM_FFI_BUILD_PYTHON_MODULE)
     COMPONENTS Interpreter
     REQUIRED
   )
+  set(_tvm_ffi_python_executable "${Python_EXECUTABLE}")
+  set(_tvm_ffi_python_version ${Python_VERSION})

Review Comment:
   seems this is just python version, if so avoid aliasing



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: discuss-archive-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: discuss-archive-unsubscribe@tvm.apache.org
For additional commands, e-mail: discuss-archive-help@tvm.apache.org