• Re: Python module installation with cmake

    From Timo =?utf-8?Q?R=C3=B6hling?=@21:1/5 to All on Fri Jul 28 09:50:02 2023
    Hi Gregor,

    * Gregor Riepl <onitake@gmail.com> [2023-07-28 09:21]:
    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

    I posted an explanation to debian-devel yesterday: https://lists.debian.org/debian-devel/2023/07/msg00307.html


    Cheers
    Timo

    --
    ⢀⣴⠾⠻⢶⣦⠀ ╭────────────────────────────────────────────────────╮
    ⣾⠁⢠⠒⠀⣿⡁ │ Timo Röhling │
    ⢿⡄⠘⠷⠚⠋⠀ │ 9B03 EBB9 8300 DF97 C2B1 23BF CC8C 6BDD 1403 F4CA │
    ⠈⠳⣄⠀⠀⠀⠀ ╰────────────────────────────────────────────────────╯

    -----BEGIN PGP SIGNATURE-----

    iQGzBAEBCgAdFiEEJvtDgpxjkjCIVtam+C8H+466LVkFAmTDcTQACgkQ+C8H+466 LVmb+wv/TGD9Q+YWRh5CbCR55822a9sveMlnIT9C/YBDY9xmCXQJJMzHgBfCY3jb E7aiearFgMG8p946p8GFQguBHjK32yJnxzNI8am8yrBC5Gv1Z+SpjESPxX8skUJb MyGCxHwVxt5NIX05NeZWbKBQHAEHMu6425knlxYFKn9g1WNG9p3iJbOKxkgKkAdL zI0zadJi+VW7iep59YoZjRjMJ+QbsL0blKL0QgcVi2gH111AZW8H3bd0up62Tzz9 00X+l6fUfjZXcxQgqqhD8fB3d5AiqSXSMeUIrNKWJtnJ/5WX14fUsDkZ663bmPIA hAiPMwiHI8CXvfo/2ePFHSOKFyyiioiUwIv05BtYWO5
  • From Gregor Riepl@21:1/5 to All on Fri Jul 28 09:30:02 2023
    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)