Suggested patch to be attached. Problem: On some platforms (ppc64le), Python modules are installed into $EPREFIX/usr/lib/pythonX.Y/site-packages instead of $EPREFIX/usr/lib64/pythonX.Y/site-packages Reason: The ebuild sets VTK_INSTALL_PYTHON_MODULE_DIR, but it has been deprecated and thus has no effect. Thus, the install directory used is the default install directory, and for some reason it's /usr/lib instead of /usr/lib64. The only reference to the deprecated var in v8.2.0 is to print the deprecation warning: ./CMake/vtkDirectories.cmake:29:if(DEFINED VTK_INSTALL_PYTHON_MODULE_DIR) ./CMake/vtkDirectories.cmake-30- message(WARNING ./CMake/vtkDirectories.cmake:31: "VTK_INSTALL_PYTHON_MODULE_DIR is no longer supported. " ./CMake/vtkDirectories.cmake-32- "Set `VTK_PYTHON_SITE_PACKAGES_SUFFIX` instead, although not needed in most cases.") ./CMake/vtkDirectories.cmake-33-endif() Note that in versions >8.2.0, this warning has been removed, too. The fix: VTK_INSTALL_PYTHON_MODULES_DIR is still honored, including in >8.2.0, so use it instead. Note that VTK_PYTHON_SITE_PACKAGES_SUFFIX does not help because it is appended after the lib directory: $EPREFIX/usr/lib/$VTK_PYTHON_SITE_PACKAGES_SUFFIX Perhaps a deeper fix might be to figure out why the default lib dir is set to lib instead of lib64. I didn't investigate this further. The ebuild already intends to override the default, and this commit just fixes that override. I don't know if the default dir is still broken in >8.2.0, i.e. whether it is still necessary for the >8.2.0 ebuilds to override the default installation directory. There have been related changes, though, see at least this commit that's not in 8.2.0 but is in master: commit 4c42ff417c209087bf0058a9eb2614928943156b Author: Ben Boeckel <ben.boeckel@kitware.com> Date: Thu Oct 18 13:17:11 2018 -0400 vtkPython: expose VTK_PYTHONPATH to consumers of VTK Reproducible: Always Steps to Reproduce: 1. ebuild sci-libs/vtk/vtk-8.2.0-r1.ebuild install 2. check the path of /usr/lib*/python3.8/site-packages/vtk.py Actual Results: /usr/lib/python3.8/site-packages/vtk.py Expected Results: /usr/lib64/python3.8/site-packages/vtk.py This is within a Gentoo Prefix installation on ppc64le.
Created attachment 686970 [details, diff] Patch to update the overriding of site-dir path in the ebuild.
Related: Bug 723744 Note that the patch suggested in that bug report hardcodes site-dir path to ".../lib/..." which doesn't seem right. This suggests that CMAKE_INSTALL_LIBDIR is not set correctly: neither for the person who reported this related bug (who wants it to be installed into "lib", so... presumably it defaults to "lib64" for him?), nor for me (I want it installed into "lib64" since that's where all python packages install by default on my Prefix on ppc64le, but it defaults to "lib" for me). Perhaps, cmake warrants some investigation, but I think the patch I'm suggesting is harmless to go in, regardless of further digging into cmake's CMAKE_INTALL_LIBDIR.
Oops. I got lib and lib64 reversed in the comments by mistake. Correction: the issue is that the python module currently ends up installed into lib64, but it should be installed into lib. Everything in my report still holds, just reverse 'lib' with 'lib64', the attached patch is also still fine, except for the same mistake in the commit message. Corrected issue: On some platforms (ppc64le), Python modules are installed into $EPREFIX/usr/lib64/pythonX.Y/site-packages instead of $EPREFIX/usr/lib/pythonX.Y/site-packages So, the related version-bump Bug 723744 did point out this same issue -- the patch there also changes to the path to 'lib' (but that patch hardcodes the path in upstream's CMake script, which shouldn't be necessary).
Created attachment 687327 [details, diff] Patch to update the overriding of site-dir path in the ebuild (corrected commit msg).
Thanks for figuring this out. It's just plain broken everywhere, even my boring amd64 machine. I applied your patch. Thanks again!
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6f05bc88c81a42943e5784736d2eb15f63c5ef40 commit 6f05bc88c81a42943e5784736d2eb15f63c5ef40 Author: Michał Górny <mgorny@gentoo.org> AuthorDate: 2024-01-05 15:52:16 +0000 Commit: Michał Górny <mgorny@gentoo.org> CommitDate: 2024-01-08 14:48:19 +0000 install-qa-check.d/60python-site: Add check for wrong libdir Bug: https://bugs.gentoo.org/702016 Bug: https://bugs.gentoo.org/770961 Signed-off-by: Michał Górny <mgorny@gentoo.org> metadata/install-qa-check.d/60python-site | 12 ++++++++++++ 1 file changed, 12 insertions(+)