[Pkg-cmake-team] Bug#1041633: cmake: FindPython.cmake returns /usr/local/lib/python3.11/dist-packages for Python_SITEARCH
Timo Röhling
roehling at debian.org
Sun Jul 23 14:26:34 BST 2023
Control: reassign -1 qgis 3.28.8+dfsg-1
Control: retitle -1 qgis: needs DEB_PYTHON_INSTALL_LAYOUT=deb to build
Hi Bas,
* Sebastiaan Couwenberg <sebastic at xs4all.nl> [2023-07-21 17:17]:
>Changes between bookworm and sid:
>
>cmake 3.25.1:
>
> ``Python_SITELIB``
> Third-party platform independent installation directory.
>
> Information returned by
>
>``distutils.sysconfig.get_python_lib(plat_specific=False,standard_lib=False)``
> or else ``sysconfig.get_path('purelib')``.
> ``Python_SITEARCH``
> Third-party platform dependent installation directory.
>
> Information returned by
>
>``distutils.sysconfig.get_python_lib(plat_specific=True,standard_lib=False)``
> or else ``sysconfig.get_path('platlib')``.
>
>cmake 3.27.0:
>
> ``Python_SITELIB``
> Third-party platform independent installation directory.
>
> Information returned by ``sysconfig.get_path('purelib')``.
> ``Python_SITEARCH``
> Third-party platform dependent installation directory.
>
> Information returned by ``sysconfig.get_path('platlib')``.
>
>On bookworm distutils is still used which returns:
>
> >>> distutils.sysconfig.get_python_lib(
> plat_specific=False,
> standard_lib=False,
> )
> '/usr/lib/python3/dist-packages'
>
>On sid sysconfig is used which results:
>
> >>> sysconfig.get_path('platlib')
> '/usr/local/lib/python3.11/dist-packages'
>
>To get the right path for the Debian python3 interpreter,
>you need to add 'deb_system':
>
> >>> sysconfig.get_path('platlib', 'deb_system')
> '/usr/lib/python3/dist-packages'
After a bit of discussion in #d-python, I believe that
CMake actually behaves as intended now, and the previous behavior was
unintended.
The default use-case is a local user build, not a package build, and
the default SITELIB reflects that.
It is the package maintainer's responsibility to set
DEB_PYTHON_INSTALL_LAYOUT=deb in d/rules, either implicitly through
the use of pybuild, or explicitly with "export
DEB_PYTHON_INSTALL_LAYOUT", as you already did in Salsa.
Cheers
Timo
--
⢀⣴⠾⠻⢶⣦⠀ ╭────────────────────────────────────────────────────╮
⣾⠁⢠⠒⠀⣿⡁ │ Timo Röhling │
⢿⡄⠘⠷⠚⠋⠀ │ 9B03 EBB9 8300 DF97 C2B1 23BF CC8C 6BDD 1403 F4CA │
⠈⠳⣄⠀⠀⠀⠀ ╰────────────────────────────────────────────────────╯
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/pkg-cmake-team/attachments/20230723/3e95208e/attachment.sig>
More information about the Pkg-cmake-team
mailing list