Bug 1412432 - python2-libs Provides: python(abi)
Summary: python2-libs Provides: python(abi)
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: python-rpm-generators
Version: 28
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Miro Hrončok
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-01-12 02:21 UTC by Athos Ribeiro
Modified: 2018-04-10 13:23 UTC (History)
18 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-04-10 13:23:14 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Athos Ribeiro 2017-01-12 02:21:13 UTC
The new python2-2.7.12-9.fc26.x86_64 python-libs subpackage provides

python(abi)

As it can be seen in

$ dnf --disablerepo=* --enablerepo=rawhide repoquery python2-libs --provides
libpython2.7.so.1.0
libpython2.7.so.1.0()(64bit)
python(abi) = 2.7
python-libs = 2.7.12-9.fc26
python-libs(x86-32) = 2.7.12-9.fc26
python-libs(x86-64) = 2.7.12-9.fc26
python2-libs = 2.7.12-9.fc26
python2-libs(x86-32) = 2.7.12-9.fc26
python2-libs(x86-64) = 2.7.12-9.fc26
python2.7dist(python) = 2.7.12
python2dist(python) = 2.7.12

When installing a python2-* package in mock, the system is happy enough installing python2-libs and no /usr/bin/python2.MINOR is provided. Is this the desired behaviour for this change?

Comment 1 Miro Hrončok 2017-01-12 02:36:25 UTC
On my Fedora 25:

$ rpm -q --provides python-libs
libpython2.7.so.1.0()(64bit)
python(abi) = 2.7
python-libs = 2.7.12-7.fc25
python-libs(x86-64) = 2.7.12-7.fc25
python2.7dist(python) = 2.7.12
python2dist(python) = 2.7.12

And on Fedora 24:

$ dnf repoquery --provides python-libs --disablerepo=\* --enablerepo=fedora --releasever=24
libpython2.7.so.1.0
libpython2.7.so.1.0()(64bit)
python(abi) = 2.7
python-libs = 2.7.11-4.fc24
python-libs = 2.7.12-7.fc25
python-libs(x86-32) = 2.7.11-4.fc24
python-libs(x86-64) = 2.7.11-4.fc24
python-libs(x86-64) = 2.7.12-7.fc25
python2.7dist(python) = 2.7.12
python2dist(python) = 2.7.12

So this was not actually changed with the rename.



On the other hand, this is not the case for python3, where python(abi) is only provided by python3:

$ rpm -q --provides python3-libs
python3-enum34 = 1.0.4-5.fc25
python3-libs = 3.5.2-4.fc25
python3-libs(x86-64) = 3.5.2-4.fc25

$ rpm -q --provides python3
python(abi) = 3.5
python3 = 3.5.2-4.fc25
python3(x86-64) = 3.5.2-4.fc25
python35 = 3.5.2-4.fc25


So this definitively needs uniting.

Comment 2 Miro Hrončok 2017-01-12 02:46:40 UTC
The F24 output above is obviously mixed with my installed Python, sorry:

$ dnf repoquery --provides python-libs-0:2.7.11-4.fc24.x86_64 --disablerepo=\* --enablerepo=fedora --releasever=24
libpython2.7.so.1.0()(64bit)
python-libs = 2.7.11-4.fc24
python-libs(x86-64) = 2.7.11-4.fc24



So this changed between F24 and F25.



There's a code in /usr/lib/rpm/pythondistdeps.py (introduced in F25):

        if Provides:
            # If egg/dist metadata says package name is python, we provide python(abi)
            if dist.key == 'python':
                name = 'python(abi)'
                if name not in py_deps:
                    py_deps[name] = []
                py_deps[name].append(('==', dist.py_version))


This code basically adds python(abi) to a package that has python2dist(python), and this (I believe) is wrong.

The original provide for that is supposed to be added to the packages owning the binary [/usr/lib/rpm/pythondeps.sh]: 

    # Match buildroot/payload paths of the form
    #    /PATH/OF/BUILDROOT/usr/bin/pythonMAJOR.MINOR
    # generating a line of the form
    #    python(abi) = MAJOR.MINOR
    # (Don't match against -config tools e.g. /usr/bin/python2.6-config)
    grep "/usr/bin/python.\..$" \
        | sed -e "s|.*/usr/bin/python\(.\..\)|python(abi) = \1|"

Comment 3 Neal Gompa 2017-01-12 13:16:12 UTC
(In reply to Miro Hrončok from comment #2)
> 
> There's a code in /usr/lib/rpm/pythondistdeps.py (introduced in F25):
> 
>         if Provides:
>             # If egg/dist metadata says package name is python, we provide
> python(abi)
>             if dist.key == 'python':
>                 name = 'python(abi)'
>                 if name not in py_deps:
>                     py_deps[name] = []
>                 py_deps[name].append(('==', dist.py_version))
> 
> 
> This code basically adds python(abi) to a package that has
> python2dist(python), and this (I believe) is wrong.
> 

Hmm, I'm not sure if there's supposed to be a "python2dist(python)" at all. I don't see a corresponding "python3dist(python)" occurring for Python 3. Does Python 2 have dist metadata?

Comment 4 Miro Hrončok 2017-01-12 13:29:23 UTC
/usr/lib64/python2.7/lib-dynload/Python-2.7.12-py2.7.egg-info

Comment 5 Florian Festi 2017-02-15 15:44:03 UTC
So the generator adds python(abi) = 2.7 to python-libs because it ships /usr/lib64/python2.7/lib-dynload/Python-2.7.12-py2.7.egg-info which says "This is Sparta! ... ehm, Python".

What about just adding a requires from the python-lib to the python package?

Comment 6 Fedora End Of Life 2017-02-28 10:56:08 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 26 development cycle.
Changing version to '26'.

Comment 7 Panu Matilainen 2018-02-13 14:18:47 UTC
(In reply to Florian Festi from comment #5)
> What about just adding a requires from the python-lib to the python package?

-> tossing back to python2 and rawhide. In any case rpm can't really do anything here as the python generators have been moved to python-rpm-generators nowadays.

Comment 8 Fedora End Of Life 2018-02-20 15:37:48 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 28 development cycle.
Changing version to '28'.

Comment 10 Miro Hrončok 2018-04-10 13:23:14 UTC
$ repoquery --releasever 26 --disablerepo='*' --enablerepo=fedora --enablerepo=updates --whatprovides 'python(abi)'
python2-0:2.7.14-7.fc26.i686
python2-0:2.7.14-7.fc26.x86_64
python2-libs-0:2.7.14-7.fc26.i686
python2-libs-0:2.7.14-7.fc26.x86_64
python3-0:3.6.5-1.fc26.i686
python3-0:3.6.5-1.fc26.x86_64

$ repoquery --releasever 27 --disablerepo='*' --enablerepo=fedora --enablerepo=updates --whatprovides 'python(abi)'
python2-0:2.7.14-10.fc27.i686
python2-0:2.7.14-10.fc27.x86_64
python3-0:3.6.5-1.fc27.i686
python3-0:3.6.5-1.fc27.x86_64

$ repoquery --releasever 28 --disablerepo='*' --enablerepo=fedora --enablerepo=updates --whatprovides 'python(abi)'
python2-0:2.7.14-15.fc28.i686
python2-0:2.7.14-15.fc28.x86_64
python3-0:3.6.5-1.fc28.i686
python3-0:3.6.5-1.fc28.x86_64

$ repoquery --releasever rawhide --disablerepo='*' --enablerepo=fedora --enablerepo=updates --whatprovides 'python(abi)'
Poslední kontrola metadat: před 2:48:52, Út 10. duben 2018, 12:31:58 CEST.
python2-0:2.7.14-15.fc29.i686
python2-0:2.7.14-15.fc29.x86_64
python3-0:3.6.5-1.fc29.i686
python3-0:3.6.5-1.fc29.x86_64


This is only bug on Fedora 26 where I don't feel like investing the time in it is worth it.


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