Check duplicate issues.
Description
The addition of Py_LIMITED_API in the build as of #21766 conflicts with the use of free-threaded python builds, which do not support the limited API. This is a regression from 6.38 which worked with free-threaded builds (even if it was not necessarily taking advantage of them, but other installed python packages could be).
Reproducer
🤷 Installing python against 3.14 hits the following line: https://github.com/python/cpython/blob/3.14/Include/Python.h#L52
#if defined(Py_LIMITED_API) && defined(Py_GIL_DISABLED)
# error "The limited API is not currently supported in the free-threaded build"
#endif
e.g.
In file included from /opt/spack/stage/wdconinc/spack-stage-root-6.40.00-wlntrvmzykb3ftfk5h7pkdmeu77rj7nv/spack-src/bindings/tpython/src/TPyClassGenerator.cxx:12:
> /opt/software/linux-skylake/python-3.14.3-uax6wd3hoqf2u7cosermlynybhxi7x74/include/python3.14t/Python.h:52:4: error: "The limited API is not currently supported in the free-threaded build"
52 | # error "The limited API is not currently supported in the free-threaded build"
ROOT version
Not installed, but while trying to install 6.40.00.
Installation method
Spack (develop + PR adding 6.40.00)
Operating system
Linux Ubuntu 26.04
Additional context
It may make sense to gate the addition of the private limited ABI flag behind a version && GIL disabled check so ROOT can be installed with python 3.14t.
While I understand the benefit of restricting the python interface to the limited ABI, there are systems and installs (including Spack) where that is not really a benefit since the ROOT binaries are not ever going to be reused with other python versions, so the use of the full ABI (including the PyMutex additions in 3.14t that make the ABI extend beyond limited only) is acceptable.
Maybe it is possible to combine both paragraphs above into a default-off flag that allows ROOT to use the full ABI, with a hint when a (windows or free-threaded) python version is used that won't work with the default limited ABI.
Check duplicate issues.
Description
The addition of
Py_LIMITED_APIin the build as of #21766 conflicts with the use of free-threaded python builds, which do not support the limited API. This is a regression from 6.38 which worked with free-threaded builds (even if it was not necessarily taking advantage of them, but other installed python packages could be).Reproducer
🤷 Installing python against 3.14 hits the following line: https://github.com/python/cpython/blob/3.14/Include/Python.h#L52
e.g.
ROOT version
Not installed, but while trying to install 6.40.00.
Installation method
Spack (develop + PR adding 6.40.00)
Operating system
Linux Ubuntu 26.04
Additional context
It may make sense to gate the addition of the private limited ABI flag behind a version && GIL disabled check so ROOT can be installed with python 3.14t.
While I understand the benefit of restricting the python interface to the limited ABI, there are systems and installs (including Spack) where that is not really a benefit since the ROOT binaries are not ever going to be reused with other python versions, so the use of the full ABI (including the PyMutex additions in 3.14t that make the ABI extend beyond limited only) is acceptable.
Maybe it is possible to combine both paragraphs above into a default-off flag that allows ROOT to use the full ABI, with a hint when a (windows or free-threaded) python version is used that won't work with the default limited ABI.