Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.maint.python > #15066

Python module installation with cmake

From Gregor Riepl <onitake@gmail.com>
Newsgroups linux.debian.maint.python
Subject Python module installation with cmake
Date 2023-07-28 09:30 +0200
Message-ID <GWq5c-3jWm-7@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


Hi,

I'm looking for help with a regression in cmake 3.27, that is currently 
producing incorrect module installation paths for the Python package 
Uranium: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1042157

Uranium's cmake script uses the cmake variable Python_SITELIB to 
determine the installation path for Python modules, and that used to 
work correctly up until cmake 3.26.
In 3.27, the value of this variable has changed, and it now points to 
/usr/local, which seems wrong to me. Furthermore, it includes the full 
Python version, which also doesn't look right:

In 3.26.4-4, Python_SITELIB is /usr/lib/python3/dist-packages, and the 
documentation[1] says:
 > Information returned by 
distutils.sysconfig.get_python_lib(plat_specific=False,standard_lib=False) 
or else sysconfig.get_path('purelib').

In 3.27.1-1, it's /usr/local/lib/python3.11/dist-packages, coming from[2]:
 > Information returned by sysconfig.get_path('purelib').

There don't seem to be any other useful cmake variables that could be 
used. The relevant cmake script parts look like this:

####
if(NOT DEFINED Python_SITELIB_LOCAL)
     set(Python_SITELIB_LOCAL
             "${Python_SITELIB}"
             CACHE PATH "Local alternative site-package location to 
install Uranium" FORCE)
endif()
install(DIRECTORY UM DESTINATION "${Python_SITELIB_LOCAL}")
####

I do think this is a regression in cmake, but perhaps something was 
wrong with the script in the first place and only showed up now?

Can someone help with sorting this issue out?

Thanks,
Gregor

[1] https://cmake.org/cmake/help/v3.26/module/FindPython.html
[2] https://cmake.org/cmake/help/v3.27/module/FindPython.html

Back to linux.debian.maint.python | Previous | Next — Next in thread | Find similar | Unroll thread


Thread

Python module installation with cmake Gregor Riepl <onitake@gmail.com> - 2023-07-28 09:30 +0200
  Re: Python module installation with cmake Timo Röhling <roehling@debian.org> - 2023-07-28 09:50 +0200

csiph-web