classification
Title: PEP 3149 related build failures
Type: compile error Stage: needs patch
Components: Build Versions: Python 2.6
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: barry Nosy List: Arfrever, Jan.Groenewald, barry, georg.brandl, orsenthil, stephen.mcquay
Priority: critical Keywords: patch

Created on 2010-09-03 19:40 by pitrou, last changed 2012-08-20 23:38 by stephen.mcquay. This issue is now closed.

Files
File name Uploaded Description Edit
py26-fix.diff stephen.mcquay, 2012-08-20 23:38 Patch that obviates the need to drop py2.6 support from ubuntu. review
Repositories containing patches
https://bitbucket.org/smcquay/cpython
Messages (12)
msg115489 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2010-09-03 19:40
After a `make distclean` and a whole recompile I still get these:

building 'crypt' extension
gcc -pthread -fPIC -g -O0 -Wall -Wstrict-prototypes -I. -I./Include -I/usr/local/include -IInclude -I/home/antoine/py3k/debug -c /home/antoine/py3k/debug/Modules/cryptmodule.c -o build/temp.linux-x86_64-3.2-pydebug/home/antoine/py3k/debug/Modules/cryptmodule.o
gcc -pthread -shared build/temp.linux-x86_64-3.2-pydebug/home/antoine/py3k/debug/Modules/cryptmodule.o -L/usr/local/lib -o build/lib.linux-x86_64-3.2-pydebug/crypt.cpython-32dm.so
*** WARNING: renaming "crypt" since importing it failed: build/lib.linux-x86_64-3.2-pydebug/crypt.cpython-32dm.so: undefined symbol: crypt

building 'nis' extension
gcc -pthread -fPIC -g -O0 -Wall -Wstrict-prototypes -I. -I./Include -I/usr/local/include -IInclude -I/home/antoine/py3k/debug -c /home/antoine/py3k/debug/Modules/nismodule.c -o build/temp.linux-x86_64-3.2-pydebug/home/antoine/py3k/debug/Modules/nismodule.o
gcc -pthread -shared build/temp.linux-x86_64-3.2-pydebug/home/antoine/py3k/debug/Modules/nismodule.o -L/usr/local/lib -o build/lib.linux-x86_64-3.2-pydebug/nis.cpython-32dm.so
*** WARNING: renaming "nis" since importing it failed: build/lib.linux-x86_64-3.2-pydebug/nis.cpython-32dm.so: undefined symbol: yp_get_default_domain

Failed to build these modules:
crypt              nis
msg115495 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2010-09-03 19:58
The normal build lines for the crypt and nis modules contain additional library linkage ("normal", that is before your commit :-)):

gcc -pthread -shared build/temp.linux-x86_64-3.2/home/antoine/py3k/__svn__/Modules/cryptmodule.o -L/home/antoine/py3k/__svn__/usr/lib -L/usr/local/lib -lcrypt -o build/lib.linux-x86_64-3.2/crypt.so

gcc -pthread -shared build/temp.linux-x86_64-3.2/home/antoine/py3k/__svn__/Modules/nismodule.o -L/home/antoine/py3k/__svn__/usr/lib -L/usr/local/lib -lnsl -o build/lib.linux-x86_64-3.2/nis.so

("-lcrypt" in the former, "-lnsl" in the latter)
msg115583 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2010-09-04 16:04
Oh, I just noticed that many other modules weren't built either: _ssl, _hashlib, _sqlite, _tkinter. Apparently setup.py cannot find the relevant "bits" anymore.

Bisecting shows that this happened with the PEP 3149 commit.
msg115586 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2010-09-04 16:28
I've committed a workaround in r84488. Feel free to improve.
msg115835 - (view) Author: Barry A. Warsaw (barry) * (Python committer) Date: 2010-09-08 00:58
What platform/OS is this happening on?  I've tested the PEP 3149 patch on various Ubuntu, OS X, and Debian systems and never needed this.  Not saying it's a bad patch, I just think there's something else environmental going on that I never saw for some reason.
msg119572 - (view) Author: Barry A. Warsaw (barry) * (Python committer) Date: 2010-10-25 19:33
Closing this because I can't think of anything better than your workaround (plus, I was apparently unable to reproduce it).
msg133925 - (view) Author: Jan Groenewald (Jan.Groenewald) Date: 2011-04-17 13:46
I am trying to build www.sagemath.org on ubuntu 10.04 natty beta 2 for amd64. Bear with me.

Sage includes a patched version of python2.6.4, and it fails to build
modules nis and crypt.

Upstream python 2.6.4, 2.6.6, and 2.7.1 fail to build with the same
error with ./configure, make, as per the README. The patch proposed is for setup.py, which is not used here?

Ubuntu has a packaged python 2.6.6 and 2.7.1 (default) which I assume
is patched, and builds on their toolchain.
msg133926 - (view) Author: Jan Groenewald (Jan.Groenewald) Date: 2011-04-17 13:47
Oops, correction. Ubuntu 11.04 beta 2 for amd64.
msg133928 - (view) Author: Barry A. Warsaw (barry) * (Python committer) Date: 2011-04-17 14:04
On Apr 17, 2011, at 01:46 PM, Jan Groenewald wrote:

>Jan Groenewald <jan.groenewald@gmail.com> added the comment:
>
>I am trying to build www.sagemath.org on ubuntu 10.04 natty beta 2 for amd64. Bear with me.

As described in your follow up, the problem is really on 11.04.

>Sage includes a patched version of python2.6.4, and it fails to build
>modules nis and crypt.
>
>Upstream python 2.6.4, 2.6.6, and 2.7.1 fail to build with the same
>error with ./configure, make, as per the README. The patch proposed is for setup.py, which is not used here?
>
>Ubuntu has a packaged python 2.6.6 and 2.7.1 (default) which I assume
>is patched, and builds on their toolchain.

This is not related to PEP 3149 failures.  Ubuntu 11.04 introduced multiarch
directories for the underlying shared libraries used to link to the Python
extension modules.  Unpatched, Python's setup.py does not add the necessary
multiarch directories to the search paths, so some extensions won't build.

Ubuntu 11.04's Python packages have been patched to add the correct search
paths.  Upstream Python 2.7, 3.1, 3.2, and 3.3 have also been patched to
include the correct search paths, but fixed versions have not been released
upstream yet.  Python 2.6 won't be patched.

See issue 11715 for details.
msg158550 - (view) Author: Senthil Kumaran (orsenthil) * (Python committer) Date: 2012-04-17 13:56
Hi Barry, 

I stumbled upon this bug when trying to compile Python2.6 from source on Ubuntu 11.10. If this bug report or the related one issue11715 is a problem due to Ubuntu changes, I think, it is good inform in the download or news page. People try previous stable versions just to ensure that things are working fine. In this case, 2.7.x series work but 2.6.xx do not (I am not sure from which xx it started breaking).

Thanks,
Senthil
msg158566 - (view) Author: Barry A. Warsaw (barry) * (Python committer) Date: 2012-04-17 19:16
On Apr 17, 2012, at 01:56 PM, Senthil Kumaran wrote:

>I stumbled upon this bug when trying to compile Python2.6 from source on
>Ubuntu 11.10. If this bug report or the related one issue11715 is a problem
>due to Ubuntu changes, I think, it is good inform in the download or news
>page. People try previous stable versions just to ensure that things are
>working fine. In this case, 2.7.x series work but 2.6.xx do not (I am not
>sure from which xx it started breaking).

Hi Senthil.  I added a note to the 2.6.8 download page and will carry this
forward to future point releases should there be any.  I also updated the
title for this issue to better reflect the actual problem.
msg168718 - (view) Author: Stephen M McQuay (stephen.mcquay) Date: 2012-08-20 23:38
I cobbled together a mix of what I found here:

http://ubuntuforums.org/showthread.php?t=1976837
http://blog.schmichael.com/2012/05/29/building-python-2-6-8-on-ubuntu-12-04/

and got python 2.6 to build fine on modern Ubuntu :

% python -mplatform
Linux-3.2.0-29-generic-x86_64-with-Ubuntu-12.04-precise
History
Date User Action Args
2012-08-20 23:38:57stephen.mcquaysetfiles: + py26-fix.diff

nosy: + stephen.mcquay
messages: + msg168718

hgrepos: + hgrepo146
keywords: + patch
2012-04-17 19:16:44barrysetmessages: + msg158566
title: Multiarch related build failures on Ubuntu >= 11.04 -> PEP 3149 related build failures
2012-04-17 19:15:43barrysettitle: PEP 3149 related build failures -> Multiarch related build failures on Ubuntu >= 11.04
2012-04-17 13:56:31orsenthilsetnosy: + orsenthil
messages: + msg158550
2011-04-17 14:04:25barrysetmessages: + msg133928
2011-04-17 13:47:27Jan.Groenewaldsetmessages: + msg133926
2011-04-17 13:46:43Jan.Groenewaldsetnosy: + Jan.Groenewald

messages: + msg133925
versions: + Python 2.6, - Python 3.2
2010-10-25 19:33:27barrysetstatus: open -> closed
resolution: fixed
messages: + msg119572

title: build failures -> PEP 3149 related build failures
2010-09-08 00:58:29barrysetmessages: + msg115835
2010-09-04 18:59:24Arfreversetnosy: + Arfrever
2010-09-04 16:28:56pitrousetnosy: - pitrou
2010-09-04 16:28:47pitrousetmessages: + msg115586
2010-09-04 16:04:29pitrousetpriority: normal -> critical
nosy: + georg.brandl
messages: + msg115583

2010-09-03 19:58:18pitrousetmessages: + msg115495
2010-09-03 19:40:15pitroucreate