Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 770961 - sci-libs/vtk-8.2.0-r1: python modules installed into wrong site-dir path: /usr/lib64/python
Summary: sci-libs/vtk-8.2.0-r1: python modules installed into wrong site-dir path: /us...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: PPC64 Linux
: Normal normal (vote)
Assignee: Gentoo Science Related Packages
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2021-02-16 15:40 UTC by Alexei Colin
Modified: 2024-01-08 14:48 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Patch to update the overriding of site-dir path in the ebuild. (0001-sci-libs-vtk-8.2.0-update-deprecated-var-for-setting.patch,3.31 KB, patch)
2021-02-16 15:41 UTC, Alexei Colin
Details | Diff
Patch to update the overriding of site-dir path in the ebuild (corrected commit msg). (0001-sci-libs-vtk-8.2.0-update-deprecated-var-for-setting.patch,3.28 KB, patch)
2021-02-17 19:42 UTC, Alexei Colin
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexei Colin 2021-02-16 15:40:42 UTC
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.
Comment 1 Alexei Colin 2021-02-16 15:41:57 UTC
Created attachment 686970 [details, diff]
Patch to update the overriding of site-dir path in the ebuild.
Comment 2 Alexei Colin 2021-02-16 15:47:53 UTC
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.
Comment 3 Alexei Colin 2021-02-17 19:39:08 UTC
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).
Comment 4 Alexei Colin 2021-02-17 19:42:56 UTC
Created attachment 687327 [details, diff]
Patch to update the overriding of site-dir path in the ebuild (corrected commit msg).
Comment 5 Michael Orlitzky gentoo-dev 2021-03-26 01:00:40 UTC
Thanks for figuring this out. It's just plain broken everywhere, even my boring amd64 machine. I applied your patch. Thanks again!
Comment 6 Larry the Git Cow gentoo-dev 2024-01-08 14:48:28 UTC
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(+)