Bug 1144112 - missing /usr/lib64/libpython3.4.so symlink
Summary: missing /usr/lib64/libpython3.4.so symlink
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: python3
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Bohuslav "Slavek" Kabrda
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 1115489
TreeView+ depends on / blocked
 
Reported: 2014-09-18 17:07 UTC by Pavel Šimerda (pavlix)
Modified: 2014-09-19 08:10 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-09-19 07:05:50 UTC
Type: Bug


Attachments (Terms of Use)

Description Pavel Šimerda (pavlix) 2014-09-18 17:07:36 UTC
I'm trying to build unbound with python 3.x (bug #1115489) and it apparently expect to find a python so including the full python version. It detect that the used python version is 3.4 and then expects to find libpython3.4 just like it did with libpython2.7.

The relevant line from configure output:

checking for Python library path...
-L/usr/lib64/python3.4 -L/usr/lib64 -lpython3.4

Details about the scratch build attempt is here:

http://koji.fedoraproject.org/koji/taskinfo?taskID=7618550

Comment 1 Bohuslav "Slavek" Kabrda 2014-09-19 07:05:50 UTC
The reason why this fails are "Python ABI Flags" [1] added since Python 3.2. For example, Fedora's python3 builds have "m" abi flag appended to soname, hence you have to link against "python3.4m".
The upstream shouldn't hardcode "-lpython3.4", Instead, they should get the library name dynamically, there are two ways to do this:
- $PYTHON -c "from distutils import sysconfig; print(sysconfig.get_config_var('BLDLIBRARY'))" (on Fedora, this returns "-L. -lpython3.4m")
- -lpython`$PYTHON -c "from distutils import sysconfig; print(sysconfig.get_config_var('LDVERSION'))"`

The second option however doesn't work with Python 2, so I'd recommend using the first one.
I'm closing this as notabug, but feel free to reopen this if you think it needs a longer discussion.

[1] http://legacy.python.org/dev/peps/pep-3149/

Comment 2 Pavel Šimerda (pavlix) 2014-09-19 07:44:35 UTC
I'm ok with closing, will work with upstream to configure using `sysconfig`. Is there any best practice for using `distutils.sysconfig` data in makefiles/autotools? Why does it return `-L.` by the way? I certainly need an option which works at least with the most common Python 2.x variants.

Comment 3 Bohuslav "Slavek" Kabrda 2014-09-19 08:10:11 UTC
(In reply to Pavel Šimerda (pavlix) from comment #2)
> I'm ok with closing, will work with upstream to configure using `sysconfig`.
> Is there any best practice for using `distutils.sysconfig` data in
> makefiles/autotools?

I'm not aware of any approach being talked about as "best practice" in this regard. AFAIK it's normal to just use

$PYTHON -c "from distutils import sysconfig; print(sysconfig.get_config_var('BLDLIBRARY'))"

makefiles/autotools files to get the proper values.

> Why does it return `-L.` by the way? I certainly need
> an option which works at least with the most common Python 2.x variants.

Honestly, I have no idea why it also returns "-L.", I can investigate...
The above option works fine with Python >= 2.6, is that good enough?


Note You need to log in before you can comment on or make changes to this bug.