FindPython: Incorrect Python_SITELIB and Python_SITEARCH on Debian 10 and Ubuntu 20
This is closely related to #25113 (closed), but this concerns different versions of Debian-based distributions.
As a side-effect of !8538 (merged), all OSes now rely on sysconfig.get_path() to get Python_SITELIB and Python_SITEARCH. On older Debian-based distributions, they resolve as something like /usr/lib/python3.8/site-packages
. This path isn't present in the python sys.path
. Those distributions do not have workarounds like DEB_PYTHON_INSTALL_LAYOUT=deb_system
enabled, and their versions of libpython3.7-minimal
and libpython3.8-minimal
doesn't know about the posix_local
scheme either. In effect, this means FindPython is not supported any more for those distributions.
The affected live distributions are Debian 10 (in LTS until June 24) and Ubuntu 20 (in standard support until April 2025).
As far as I can tell, on the CMake user side, we have 4 options:
- ad-hoc scripting based on distribution version
- hand-code the previous behavior with a try-catch with distutils
- entirely change the project architecture to use pybuild/dh_python
- lock the cmake version to 3.26.4
Is the intention to stop supporting those distributions from CMake 3.27.0 forward?