classification
Title: _md5 should be built if _ssl cannot be built
Type: compile error Stage: needs patch
Components: Build Versions: Python 2.7
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: Arfrever, christian.heimes, eric.araujo, jdemeyer, pitrou, vbraun
Priority: normal Keywords: patch

Created on 2013-05-17 19:23 by jdemeyer, last changed 2013-06-14 19:49 by Arfrever.

Files
File name Uploaded Description Edit
hashlibfallbacks.patch vbraun, 2013-05-18 11:35 Backport of patch from #1469
Messages (7)
msg189479 - (view) Author: Jeroen Demeyer (jdemeyer) * Date: 2013-05-17 19:23
I have an Itanium Linux system where compiling Python's _ssl module fails for some reason, with the consequence that there is no md5 support at all in the resulting Python 2.7.5 installation.

With Python 2.7.4, setup.py didn't even try to compile _ssl, instead it compiled the _sha, _md5, _sha256, _sha512 modules and it worked.

With Python 2.7.5, setup.py somehow thinks that _ssl should work, tries to compile _ssl, which fails and (this is the real failure): it doesn't try anymore to compile the _sha, _md5, _sha256, _sha512 modules.
msg189481 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2013-05-17 19:57
setup.py doesn't compile _md5 and the other C extension if it thinks that _ssl is available. Can you post the build error of the _ssl module here, too?
msg189482 - (view) Author: Jeroen Demeyer (jdemeyer) * Date: 2013-05-17 19:59
Sure, building _ssl fails with:
building '_ssl' extension
gcc -pthread -fPIC -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -I. -IInclude -I./Include -I/usr/include -I/home/buildbot/build/sage/iras-1/iras_full/build
/sage-5.10.beta4/local/include -I/home/buildbot/local/iras/include -I/home/buildbot/build/sage/iras-1/iras_full/build/sage-5.10.beta4/spkg/build/python-2.7.5.p0/src/Inc
lude -I/home/buildbot/build/sage/iras-1/iras_full/build/sage-5.10.beta4/spkg/build/python-2.7.5.p0/src -c /home/buildbot/build/sage/iras-1/iras_full/build/sage-5.10.bet
a4/spkg/build/python-2.7.5.p0/src/Modules/_ssl.c -o build/temp.linux-ia64-2.7/home/buildbot/build/sage/iras-1/iras_full/build/sage-5.10.beta4/spkg/build/python-2.7.5.p0
/src/Modules/_ssl.o
gcc -pthread -shared -L/home/buildbot/build/sage/iras-1/iras_full/build/sage-5.10.beta4/local/lib -L/home/buildbot/build/sage/iras-1/iras_full/build/sage-5.10.beta4/loc
al/lib build/temp.linux-ia64-2.7/home/buildbot/build/sage/iras-1/iras_full/build/sage-5.10.beta4/spkg/build/python-2.7.5.p0/src/Modules/_ssl.o -L/usr/lib -L/lib -L/home
/buildbot/build/sage/iras-1/iras_full/build/sage-5.10.beta4/local/lib -L/home/buildbot/local/iras/lib -L. -lssl -lcrypto -lpython2.7 -o build/lib.linux-ia64-2.7/_ssl.so
/usr/bin/ld: /home/buildbot/local/iras/lib/libcrypto.a(obj_dat.o): @gprel relocation against dynamic symbol obj_cleanup_defer
/usr/bin/ld: /home/buildbot/local/iras/lib/libcrypto.a(obj_dat.o): @gprel relocation against dynamic symbol obj_cleanup_defer
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status

But really: I think the main problem here is that _md5 isn't even attempted to build.
msg189483 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2013-05-17 20:23
Yes, that's the main culprit. At first setup.py checks if all necessary bits and pieces for _ssl are available. If setup.py doesn't find the shared libraries and header files it adds _md5 to the list of extensions. Compilation and linking happens *after* the list of extension modules has been created.
msg189506 - (view) Author: Volker Braun (vbraun) Date: 2013-05-18 11:35
This has been fixed for Python-3.3 in #14693. Attached is a straightforward Python-2.7.5 backport of the patch.
msg189923 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2013-05-24 16:59
The other bug report classifies the request behavior as a new feature, so it could not go into 2.7.
msg191124 - (view) Author: Jeroen Demeyer (jdemeyer) * Date: 2013-06-14 12:45
The problem on the machine that I mentioned was a regression from 2.7.4 to 2.7.5, probably due to #17086. Whether you consider a patch a "bugfix" or "new feature" is quite subjective, right? If #17086 is a bugfix, then this can also be a bugfix.
History
Date User Action Args
2013-06-14 19:49:49Arfreversetnosy: + Arfrever
2013-06-14 12:45:22jdemeyersetmessages: + msg191124
2013-05-24 16:59:28eric.araujosetnosy: + eric.araujo, pitrou
messages: + msg189923
2013-05-18 11:35:20vbraunsetfiles: + hashlibfallbacks.patch

nosy: + vbraun
messages: + msg189506

keywords: + patch
2013-05-17 20:23:18christian.heimessetmessages: + msg189483
2013-05-17 19:59:52jdemeyersetmessages: + msg189482
2013-05-17 19:57:46christian.heimessetnosy: + christian.heimes
messages: + msg189481

type: compile error
stage: needs patch
2013-05-17 19:23:12jdemeyercreate