How to fix the incorrect shared library extension on linux for 3.2 and newer?
This is http://bugs.python.org/issue16754, affecting Linux systems only, and only those which don't provide static libraries. PEP 3149 did change the SO macro to include the ABI tag, although the SO macro is used to search for shared system libraries too. E.g. searching for the jpeg library search for a file libjpeg.cpython3.3m.so, which is not found. If the static library libjpeg.a is found, it is taken, and linked as -ljpeg, which then links with the shared library. The patch in the issue now makes a distinction between EXT_SUFFIX and SHLIB_SUFFIX, and restores the value of SO to SHLIB_SUFFIX. Now this could break users of sysconfig.get_config_var('SO'), however I don't see a better way than to restore the original behaviour and advise people to use the new config variables. Matthias
On Mar 20, 2013, at 01:18 PM, Matthias Klose wrote:
The patch in the issue now makes a distinction between EXT_SUFFIX and SHLIB_SUFFIX, and restores the value of SO to SHLIB_SUFFIX. Now this could break users of sysconfig.get_config_var('SO'), however I don't see a better way than to restore the original behaviour and advise people to use the new config variables.
It should probably be considered a bug that we changed the meaning of SO in PEP 3149, but I don't think anybody realized it was being used for both purposes (otherwise I'm sure we wouldn't have done it that way). I suppose Georg should make the final determination for 3.2 and 3.3, but the solution you propose seems about the best you can do. As we discussed at Pycon, you'll post a diff to the PEP in the tracker issue and I'll commit that when I figure out the best way to indicate that a PEP has been updated post-Final status. -Barry
Am 20.03.2013 22:36, schrieb Barry Warsaw:
On Mar 20, 2013, at 01:18 PM, Matthias Klose wrote:
The patch in the issue now makes a distinction between EXT_SUFFIX and SHLIB_SUFFIX, and restores the value of SO to SHLIB_SUFFIX. Now this could break users of sysconfig.get_config_var('SO'), however I don't see a better way than to restore the original behaviour and advise people to use the new config variables.
I agree. This looks like a seriously broken behavior to me.
It should probably be considered a bug that we changed the meaning of SO in PEP 3149, but I don't think anybody realized it was being used for both purposes (otherwise I'm sure we wouldn't have done it that way). I suppose Georg should make the final determination for 3.2 and 3.3, but the solution you propose seems about the best you can do.
As we discussed at Pycon, you'll post a diff to the PEP in the tracker issue and I'll commit that when I figure out the best way to indicate that a PEP has been updated post-Final status.
Sounds good. Georg
The values on macos for these variables still look wrong in 3.3.1rc1: ./configure --prefix=/Users/jtaylor/tmp/py3.3.1 --enable-shared on macosx-10.8-x86_64 sys.version_info(major=3, minor=3, micro=1, releaselevel='candidate', serial=1) SO .so EXT_SUFFIX .so SHLIB_SUFFIX 0 the only correct one here is EXT_SUFFIX, SHLIB_SUFFIX should be .dylib (libpython is a .dylib) and .SO possibly too given for what it was used in the past. 3.3.0 also returns wrong values SO .so EXT_SUFFIX None SHLIB_SUFFIX ""
In article <515D760D.50608@googlemail.com>,
Julian Taylor
The values on macos for these variables still look wrong in 3.3.1rc1:
./configure --prefix=/Users/jtaylor/tmp/py3.3.1 --enable-shared on macosx-10.8-x86_64
sys.version_info(major=3, minor=3, micro=1, releaselevel='candidate', serial=1) SO .so EXT_SUFFIX .so SHLIB_SUFFIX 0
the only correct one here is EXT_SUFFIX, SHLIB_SUFFIX should be .dylib (libpython is a .dylib) and .SO possibly too given for what it was used in the past.
3.3.0 also returns wrong values SO .so EXT_SUFFIX None SHLIB_SUFFIX ""
I get a SHLIB_SUFFIX of '.so'. --enable-shared configurations are particularly error-prone; for instance, you either need to test using an installed version or be very careful to override the dynamic loading path. Please see the discussion at http://bugs.python.org/issue16754 and either report your concerns there or open an new issue. -- Ned Deily, nad@acm.org
On 4 Apr, 2013, at 14:46, Julian Taylor
The values on macos for these variables still look wrong in 3.3.1rc1:
./configure --prefix=/Users/jtaylor/tmp/py3.3.1 --enable-shared on macosx-10.8-x86_64
sys.version_info(major=3, minor=3, micro=1, releaselevel='candidate', serial=1) SO .so EXT_SUFFIX .so SHLIB_SUFFIX 0
the only correct one here is EXT_SUFFIX, SHLIB_SUFFIX should be .dylib (libpython is a .dylib) and .SO possibly too given for what it was used in the past.
SO is explicitly defined as being the same as EXT_SUFFIX (in Makefile.pre.in for 3.3), and is gone in default. I'm not sure that SHLIB_SUFFIX is supposed to be because it isn't used other than to calculate the suffix to use for extensions and that shouldn't change on OSX for backward compatiblity reasons, and if it were changed I'd much rather see it changes to something like '.pyext' instead of '.dylib'. But that ship has long sailed, the very limited advantages of using a unique filename suffix for Python extensions isn't worth the very real breakage of actually changing it :-) Oh, and at least setup.py assumes that sysconfig.get_config_var('EXT_SUFFIX').endswith(sysconfig.get_config_var('SHLIB_SUFFIX')). BTW. This is a problem for a lot of the information you can retrieve with sysconfig.get_config_var(), a large subset of the information is only useful during the build/installation of Python itself and as none of them are actually documented using sysconfig.get_config_var() is somewhat of a black art.
3.3.0 also returns wrong values SO .so EXT_SUFFIX None SHLIB_SUFFIX ""
Could you file an issue on the tracker about this? Ronald
_______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/ronaldoussoren%40mac.com
participants (6)
-
Barry Warsaw
-
Georg Brandl
-
Julian Taylor
-
Matthias Klose
-
Ned Deily
-
Ronald Oussoren