Bug 1465991 - Python3 support
Summary: Python3 support
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: perl-Inline-Python
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Jon Kerr Nilsen
QA Contact: Mattias Ellert
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-06-28 15:57 UTC by Petr Pisar
Modified: 2021-08-19 08:18 UTC (History)
3 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2021-08-19 08:18:38 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Petr Pisar 2017-06-28 15:57:20 UTC
perl-Inline-Python-0.54-1.fc27 is built against Python 2. It would be great to build it for Python3. Upstream supports Python3.

The issue is that Makefile.PL has some checks that does work in Fedora.

First one must to override the python executable with INLINE_PYTHON_EXECUTABLE environment variable.

Second it fails because it cannot find Python3 library:

$ INLINE_PYTHON_EXECUTABLE=/usr/bin/python3 perl Makefile.PL
Using /usr/bin/python3

This python's configuration files are messed up. You'll have have to
answer the questions yourself. Here is what Python said:

   Extra Libs:  -lpthread -ldl  -lutil
   Python Library:  /usr/lib64/python3.6/config-3.6m-x86_64-linux-gnu/libpython3.6m.a
   Include Path:    /usr/include/python3.6m

        1. LIBS option. I need to know what extra libraries, if any,
           are required by this build of python. I recommend this:
           -lpthread -ldl  -lutil

The /usr/lib64/python3.6/config-3.6m-x86_64-linux-gnu/libpython3.6m.a file does not exist. Fedora has /usr/lib64/libpython3.6m.so. It's possible that the check is bogus because it should check for a shared library.

Commenting out (-f join '/', $ref->{libpath}, $ref->{libpython}) test in Makefile.PL allows to build against Python 3 and all tests pass.

In case of Python 2, it checks for /usr/lib64/python2.7/config/libpython2.7.so which is a symlink to /usr/lib64/libpython2.7.so.
In case of Python 3, there is no such symlink.

Comment 1 Petr Pisar 2017-06-29 06:55:41 UTC
Python recommends using pythonX-config tool for discovering compiler and linker flags <https://docs.python.org/3/extending/embedding.html#compiling-and-linking-under-unix-like-systems>.

Comment 2 Mattias Ellert 2021-08-19 08:18:38 UTC
All current releases (except EPEL 7) build perl-Inline-Python against Python 3.


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