Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 570542 - python-3.x ebuilds set bad EPYTHON values
Summary: python-3.x ebuilds set bad EPYTHON values
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: All Linux
: Normal critical (vote)
Assignee: Python Gentoo Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-01-01 23:19 UTC by Tobias Hommel
Modified: 2016-01-04 17:39 UTC (History)
1 user (show)

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


Attachments
fix setting bad EPYTHON (python3-epython-fix.patch,306 bytes, patch)
2016-01-02 08:01 UTC, Tobias Hommel
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tobias Hommel 2016-01-01 23:19:59 UTC
Nearly all python-3.x ebuilds, especially ALL stable 3.x ebuilds, set bad values for EPYTHON in the epython.py module.
This is fatal for packages depending on python-exec including portage itself. While portage still runs fine with python2, this issue prevents programs from running that depend on python3 (e.g. some alembic database migration scripts).

For python-3.4.3.ebuild (currently the latest stable) this was introduced with the following commit:
https://gitweb.gentoo.org/repo/gentoo.git/commit/dev-lang/python/python-3.4.3.ebuild?id=bc46e49ff67cf1e5157ab95b41e780067f433685

python-3.4.3-r7 seems to be fixed but is keyworded.

EPYTHON is set to "python" instead of "python3.4". This seems to happen due to not setting variable $PYVER in the ebuild (see diff between python-3.4.3.ebuild and python-3.4.3-r7.ebuild).

python-2.x ebuilds work because they do not use $PYVER for setting EPYTHON but $SLOT.

Reproducible: Always

Actual Results:  
# python3.4 /usr/bin/emerge --version
This Python implementation (python) is not supported by the script.


Expected Results:  
# python2.7 /usr/bin/emerge --version
Portage 2.2.24 (python 2.7.10-final-0, hardened/linux/amd64, gcc-4.9.3, glibc-2.21-r1, 4.1.6 x86_64)
Comment 1 Adam Feldman gentoo-dev 2016-01-01 23:30:23 UTC
Are you able to clarify on your steps to reproduce?

eselect python list
Available Python interpreters:
  [1]   python2.7
  [2]   python3.3
  [3]   python3.4 *

python3.4 /usr/bin/emerge --version
Portage 2.2.25 (python 3.4.3-final-0, default/linux/amd64/13.0/developer, gcc-4.8.4, glibc-2.22-r1, 3.19.0-tuxonice x86_64)

python2.7 /usr/bin/emerge --version
Portage 2.2.25 (python 2.7.10-final-0, default/linux/amd64/13.0/developer, gcc-4.8.4, glibc-2.22-r1, 3.19.0-tuxonice x86_64

eselect python list
Available Python interpreters:
  [1]   python2.7 *
  [2]   python3.3
  [3]   python3.4

python3.4 /usr/bin/emerge --version
Portage 2.2.25 (python 3.4.3-final-0, default/linux/amd64/13.0/developer, gcc-4.8.4, glibc-2.22-r1, 3.19.0-tuxonice x86_64)

python2.7 /usr/bin/emerge --version
Portage 2.2.25 (python 2.7.10-final-0, default/linux/amd64/13.0/developer, gcc-4.8.4, glibc-2.22-r1, 3.19.0-tuxonice x86_64
Comment 2 Tobias Hommel 2016-01-02 08:01:55 UTC
Created attachment 421582 [details, diff]
fix setting bad EPYTHON
Comment 3 Tobias Hommel 2016-01-02 08:02:13 UTC
Well, this is a flaw in the ebuilds and has nothing to do with the python version set for /usr/bin/python.
So the output stays, of course, the same:
# python3.4 /usr/bin/emerge --version
This Python implementation (python) is not supported by the script.
# python2.7 /usr/bin/emerge --version
Portage 2.2.24 (python 2.7.10-final-0, hardened/linux/amd64, gcc-4.9.3, glibc-2.21-r1, 4.1.6 x86_64)

I've attached a patch which fixes the issue:
# python3.4 /usr/bin/emerge --version
Portage 2.2.24 (python 3.4.3-final-0, hardened/linux/amd64, gcc-4.9.3, glibc-2.21-r1, 4.1.6 x86_64)
Comment 4 Tobias Hommel 2016-01-04 09:08:18 UTC
added mgorny to CC list because he did the commit that actually broke it
Comment 5 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2016-01-04 16:31:54 UTC
Indeed that's a bad copy-paste fail. I've got a fix staged, I'm going to test it and commit it afterwards.
Comment 6 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2016-01-04 16:51:59 UTC
commit f21ac182f8d6eed7b4dbc69cdbce40ca44776d17
Author: Michał Górny <mgorny@gentoo.org>
Date:   Mon Jan 4 17:47:23 2016

    dev-lang/python: Fix invalid PYVER references, #570542


That's a start to prevent more people from getting this. Now, there's a question how to fix existing stable systems. I guess we'd need to revbump both stable and ~arch to get clear -r for stable.
Comment 7 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2016-01-04 17:25:41 UTC
And revbumped.
Comment 8 Tobias Hommel 2016-01-04 17:39:02 UTC
Great, thanks!