Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 304311 - sys-apps/portage pulls in Python 3.1, which has no good upgrade path
Summary: sys-apps/portage pulls in Python 3.1, which has no good upgrade path
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High critical
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks:
 
Reported: 2010-02-10 12:48 UTC by Adam Nielsen
Modified: 2010-02-11 05:19 UTC (History)
3 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Adam Nielsen 2010-02-10 12:48:30 UTC
I just upgraded Portage on a server as per the recommendation by emerge --sync, and it wanted me to upgrade to Python 3.1, so I let it.  During the upgrade this happened:

 * Messages for package dev-lang/python-3.1.1-r1:

 * 
 * WARNING!
 * Many Python modules haven't been ported yet to Python 3.*.
 * Python 3 hasn't been activated and Python wrapper is still configured to use Python 2.
 * You can manually activate Python 3.1 using `eselect python set python3.1`.
 * It is recommended to currently have Python wrapper configured to use Python 2.
 * Having Python wrapper configured to use Python 3 is unsupported.
 * 
 * 
 * ************************************************************************
 * 
 * You have just upgraded from an older version of Python.
 * You should run 'python-updater ${options}' to rebuild Python modules.
 * 
 * ************************************************************************
 * 

 * Messages for package sys-apps/portage-2.1.7.17:

 * Attempting to select a compatible default python interpreter
 * Unable to select a compatible default python interpreter!
 * 
 * ERROR: sys-apps/portage-2.1.7.17 failed.
 * Call stack:
 *                 ebuild.sh, line   49:  Called pkg_setup
 *   portage-2.1.7.17.ebuild, line   92:  Called die
 * The specific snippet of code:
 *                      die "This version of portage requires at least python-2.6 to be selected as the default python interpreter (see \`eselect python --help\`)."
 *  The die message:
 *   This version of portage requires at least python-2.6 to be selected as the default python interpreter (see `eselect python --help`).
 * 

Since I don't have Python 2.6 installed (I was running 2.4 before the emerge) and it couldn't select a version automatically, I set it to the version it just installed for me:

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

Then it broke:

$ python-updater
  File "/usr/bin/portageq", line 52
    print "ERROR: insufficient parameters!"
                                          ^
SyntaxError: invalid syntax
 * Unable to proceed. Can not find PORTDIR. Make sure the command:
 *
 *   portageq portdir
 * returns a value. If it doesn't, make sure you have updated to
 * latest portage version.
 *
 * Report bugs to http://bugs.gentoo.org/
$ portageq portdir
  File "/usr/bin/portageq", line 52
    print "ERROR: insufficient parameters!"
                                          ^
SyntaxError: invalid syntax

I'm hoping that switching back to Python 2.4 will at least allow me to emerge in Python 2.6 so that I can get my system working again, but why did an upgrade to Portage pull in Python 3.1 if it's both broken and unsupported??

Since this is a production server I don't have anything unmasked.  Surely the dependency should be on <python-3 until it becomes supported?
Comment 1 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2010-02-10 18:56:24 UTC
So, what portage version do you actually have? Now, you are in a weird state with (I believe) an old version of portage with python that isn't supported by it.
Comment 2 Adam Stylinski 2010-02-10 19:43:40 UTC
(In reply to comment #1)
> So, what portage version do you actually have? Now, you are in a weird state
> with (I believe) an old version of portage with python that isn't supported by
> it.
> 

eix gives me this:

[I] sys-apps/portage
     Available versions:  [P]2.1.6.7 2.1.6.13 2.1.7.16 (~)2.1.7.17 [M](~)2.2_rc62 {build doc epydoc linguas_pl python3 selinux}
     Installed versions:  2.1.7.17(13:32:21 01/31/10)(-build -doc -epydoc -linguas_pl -python3 -selinux)
     Homepage:            http://www.gentoo.org/proj/en/portage/index.xml
     Description:         Portage is the package management and distribution system for Gentoo
Comment 3 Adam Nielsen 2010-02-10 22:42:28 UTC
(In reply to comment #1)
> So, what portage version do you actually have? Now, you are in a weird state
> with (I believe) an old version of portage with python that isn't supported by
> it.

Oh you're right, it looks like it hasn't installed 2.1.7.17 after all:

$ emerge --version
Portage 2.1.6.13 (default/linux/x86/10.0, gcc-4.4.1, glibc-2.10.1-r0, 2.6.24.2 i686)
Comment 4 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2010-02-10 22:59:30 UTC
Ok, so if I understand this correctly you should be able to use the old portage version to emerge python-2.6 and then switch to that python and then upgrade portage and be back to a working system.

I'm assigning this to the dev-portage team and ferringb because he was talking about this situation before. (Brian, please remove yourself if you are not interested). Something should definitely be looked at here which requires abit more knowledge than myself.

Thanks.
Comment 5 Adam Nielsen 2010-02-10 23:03:02 UTC
Yes, now I'm aware of the problem I should be able to fix it that way which is good.

I would imagine that this could be solved by blocking >python-2.6 for <=portage2.1.7 (or whichever versions they actually are.)  Then the old Portage would pick python-2.6 as the latest valid version to install, after which re-emerging would pull in python-3.1.
Comment 6 Zac Medico gentoo-dev 2010-02-11 01:17:36 UTC
It's fixed in cvs to ensure that a supported version of python-2.x is always pulled in when upgrading from <portage-2.1.7.
Comment 7 Zac Medico gentoo-dev 2010-02-11 01:26:53 UTC
I guess you were the first to report this because most stable users who don't have python-2.6 installed yet also have python-3.x masked by keywords. So, this issue would not have affected most stable users until sometime in the future when python-3.x is marked stable.
Comment 8 Brian Harring (RETIRED) gentoo-dev 2010-02-11 02:10:07 UTC
@zac

that !python3 fallback isn't exactly right- if you're going to have user flags for controlling py2k vs py3k, !python3 shouldn't fallback to py3k- it should be an unsatisfied OR block.
Comment 9 Zac Medico gentoo-dev 2010-02-11 05:19:57 UTC
(In reply to comment #8)
> that !python3 fallback isn't exactly right- if you're going to have user flags
> for controlling py2k vs py3k, !python3 shouldn't fallback to py3k- it should be
> an unsatisfied OR block.

The purpose of the python3 flag is to force python3 via shebangs. With !python3, the default interpreter is used regardless of whether it is py2k or py3k. So, we need to count py3k as a valid choice in this block.