Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 88530 - python-config output doesn't match the /usr/bin/python in use
Summary: python-config output doesn't match the /usr/bin/python in use
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All All
: Highest normal
Assignee: Python Gentoo Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-04-09 18:27 UTC by Scott Taylor (RETIRED)
Modified: 2006-09-02 05:06 UTC (History)
0 users

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 Scott Taylor (RETIRED) gentoo-dev 2005-04-09 18:27:06 UTC
python-config shows the last version of python that was emerged, while the
symlinks stick with highest version, which is fine by me. But since it runs the
version that the symlink refers to as will the python apps that get built now,
the python-config should respond with that version instead. Suggest either
giving it the same symlink treatment as /usr/bin/python, or adding the code to
make python-config report the running version instead of hardcoded values.
Ugly yet functional example of that at the bottom of this.

Silver python # emerge -k =dev-lang/python-2.2.3-r6 2>&1 > /dev/null
Silver python # ll /usr/bin | grep python
lrwxrwxrwx  1 root   root         9 Apr  9 16:35 python -> python2.3
-rwxr-xr-x  1 root   root       178 Apr  9 16:32 python-config
lrwxrwxrwx  1 root   root         9 Apr  9 16:35 python2 -> python2.3
-rwxr-xr-x  1 root   root   1006964 Apr  9 16:32 python2.2
-rwxr-xr-x  1 root   root      6012 Apr  9 15:53 python2.3
Silver python # python-config
-lpython2.2 -lm -L/usr/lib/python2.2/config

Silver python # emerge -k =dev-lang/python-2.3.5 2>&1 > /dev/null
Silver python # ll /usr/bin | grep python
lrwxrwxrwx  1 root   root         9 Apr  9 17:06 python -> python2.3
-rwxr-xr-x  1 root   root       178 Apr  9 17:04 python-config
lrwxrwxrwx  1 root   root         9 Apr  9 17:06 python2 -> python2.3
-rwxr-xr-x  1 root   root   1006964 Apr  9 16:32 python2.2
-rwxr-xr-x  1 root   root      6012 Apr  9 17:04 python2.3
Silver python # python-config
-lpython2.3 -lm -L/usr/lib/python2.3/config

Silver python # emerge -k =dev-lang/python-2.2.3-r6 2>&1 > /dev/null
Silver python # ll /usr/bin | grep python
lrwxrwxrwx  1 root   root         9 Apr  9 17:12 python -> python2.3
-rwxr-xr-x  1 root   root       178 Apr  9 17:11 python-config
lrwxrwxrwx  1 root   root         9 Apr  9 17:12 python2 -> python2.3
-rwxr-xr-x  1 root   root   1006964 Apr  9 17:11 python2.2
-rwxr-xr-x  1 root   root      6012 Apr  9 17:04 python2.3
Silver python # python-config
-lpython2.2 -lm -L/usr/lib/python2.2/config

Silver python # emerge -k =dev-lang/python-2.4-r3 2>&1 > /dev/null
Silver python # ll /usr/bin | grep python
lrwxrwxrwx  1 root   root         9 Apr  9 18:06 python -> python2.4
-rwxr-xr-x  1 root   root       179 Apr  9 18:05 python-config
lrwxrwxrwx  1 root   root         9 Apr  9 18:06 python2 -> python2.4
-rwxr-xr-x  1 root   root   1006964 Apr  9 17:11 python2.2
-rwxr-xr-x  1 root   root      6012 Apr  9 17:04 python2.3
-rwxr-xr-x  1 root   root      6012 Apr  9 18:05 python2.4
Silver python # python-config
-lpython2.4 -lm -L/usr/lib/python2.4/config -L/usr/lib -lz


This could likely be written prettier, but something like this would make the
perl-config report the actual version of what is symlinked:

#!/usr/bin/python
import sys, distutils.sysconfig, string
thisversion = "%d.%d" % (sys.version_info[0] , sys.version_info[1])
print "-lpython%s -lm -L/usr/lib/python%s/config"%(thisversion,thisversion),string.join(string.split(distutils.sysconfig.get_config_var("MODLIBS")))
Comment 1 Alastair Tse (RETIRED) gentoo-dev 2005-04-20 10:02:06 UTC
that is a good point. although i'm not quite sure how many apps use python-config. as far as i know, this is something concocted before distutils.
Comment 2 Alastair Tse (RETIRED) gentoo-dev 2006-09-02 05:06:18 UTC
I believe this is fixed with the 2.4.3-r3 as part of the anti-collision
changes. In the upcoming python-2.5 there will be a proper python-config
from upstream too.