This is an archive of the discontinued LLVM Phabricator instance.

python path should be platform-dependent
ClosedPublic

Authored by llunak on Oct 12 2019, 4:44 AM.

Details

Summary

Because one of the installed files is the _lldb.so symlink.

Diff Detail

Event Timeline

llunak created this revision.Oct 12 2019, 4:44 AM
mgorny requested changes to this revision.Oct 12 2019, 5:06 AM

No, it isn't. Some distros patch some Python versions for that but it's not a rule.

This revision now requires changes to proceed.Oct 12 2019, 5:06 AM
llunak updated this revision to Diff 224739.Oct 12 2019, 5:41 AM
llunak edited the summary of this revision. (Show Details)

Updated misleading description.

labath added a reviewer: hhb.Oct 14 2019, 1:37 AM
labath added a subscriber: hhb.

As @mgorny said, I'm afraid the solution is not going to be as simple as attaching LLVM_LIBDIR_SUFFIX to the lib path. There is some ongoing work to refactor/fix the way python paths are handled, but unfortunately I've lost track of what exactly is the state of it right now. @mgorny, @hhb, would it be correct to say that once your python changes land, the above use case should work?

hhb requested changes to this revision.Oct 15 2019, 10:46 AM

Can you sync to the latest code and try again? Your problem is likely to be fixed in a previous change...

This revision now requires changes to proceed.Oct 15 2019, 10:46 AM
In D68910#1709832, @hhb wrote:

Can you sync to the latest code and try again? Your problem is likely to be fixed in a previous change...

With current master 'ninja install' at least proceeds without an error. But it still puts things in lib/ and given that one of the files is the _lldb.so symlink, I still think it should go to lib64/ (and that's indeed where the official openSUSE package puts it).

llunak updated this revision to Diff 225101.Oct 15 2019, 12:38 PM
llunak retitled this revision from use LLVM_LIBDIR_SUFFIX for python lib path to python path should be platform-dependent.
llunak edited the summary of this revision. (Show Details)

How about this one?

hhb accepted this revision.Oct 15 2019, 2:21 PM

How about this one?

This is fine for me. Actually it doesn't make any difference for all platforms I tried... Out of curiosity, is it possible to share the implementation of get_python_lib() in openSUSE? Thanks.

hhb added a comment.Oct 15 2019, 2:36 PM
Python 3.6.8 (default, Apr 30 2019, 13:27:23) [GCC] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import distutils.sysconfig
>>> print(distutils.sysconfig.get_python_lib(True, False, ''))
lib64/python3.6/site-packages
>>> print(distutils.sysconfig.get_python_lib(True, False, '/abc'))
/abc/lib64/python3.6/site-packages
>>> print(distutils.sysconfig.get_python_lib(True, False))
/usr/lib64/python3.6/site-packages
>>> print(distutils.sysconfig.get_python_lib(False, False, ''))
lib/python3.6/site-packages
>>> print(distutils.sysconfig.get_python_lib(False, False, '/abc'))
/abc/lib/python3.6/site-packages
>>> print(distutils.sysconfig.get_python_lib(False, False))
/usr/lib/python3.6/site-packages

This is interesting...

hhb added a comment.Oct 15 2019, 2:46 PM

One additional statement in openSUSE comparing to standard python:

libdir = plat_specific and get_config_var("platlibdir") or "lib"

Hmmm basically what does platform dependent mean...

Anyway this change looks good to me.

In D68910#1710147, @hhb wrote:

This is fine for me. Actually it doesn't make any difference for all platforms I tried... Out of curiosity, is it possible to share the implementation of get_python_lib() in openSUSE? Thanks.

https://build.opensuse.org/package/show/devel:languages:python:Factory/python3-base is the sources of the package. F00102-lib64.patch is probably what you're interested in.

This revision was not accepted when it landed; it landed in state Needs Review.Nov 2 2019, 2:24 AM
This revision was automatically updated to reflect the committed changes.