building of python C extensions with setuptools is broken

Bug #428004 reported by Elliot Murphy
20
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Ubuntu One Servers
Fix Released
Critical
Elliot Murphy
python-setuptools (Ubuntu)
Fix Released
High
Matthias Klose
Karmic
Fix Released
High
Matthias Klose

Bug Description

Binary package hint: python2.6

This problem is new since python2.6 2.6.2-0ubuntu2 was uploaded to Karmic.
As part of my project, we regularly run python setup.py build for a few zope modules, including some such as zope.proxy that include C extensions. very recently, this started failing under python 2.6. It still works fine under python2.5. I believe this is a regression that was introduced when the new version of python2.6 was uploaded in order to fix https://bugs.edge.launchpad.net/ubuntu/+source/python2.6/+bug/392355

I don't know enough about setuptools internals (yet) to submit a patch, but I can point to exactly what is going wrong:

Here is a terminal session that shows me grabbing the source for zope.proxy, running setup.py build, and printing some variables from the python debugger to explain the traceback that happens:

emurphy@detox:~$ bzr get lp:zope.proxy
Branched 28 revision(s).
emurphy@detox:~$ cd zope.proxy/
emurphy@detox:~/zope.proxy$ python setup.py build
running build
running build_py
creating build
creating build/lib.linux-i686-2.6
creating build/lib.linux-i686-2.6/zope
copying src/zope/__init__.py -> build/lib.linux-i686-2.6/zope
creating build/lib.linux-i686-2.6/zope/proxy
copying src/zope/proxy/__init__.py -> build/lib.linux-i686-2.6/zope/proxy
copying src/zope/proxy/decorator.py -> build/lib.linux-i686-2.6/zope/proxy
copying src/zope/proxy/interfaces.py -> build/lib.linux-i686-2.6/zope/proxy
running egg_info
creating src/zope.proxy.egg-info
writing requirements to src/zope.proxy.egg-info/requires.txt
writing src/zope.proxy.egg-info/PKG-INFO
writing namespace_packages to src/zope.proxy.egg-info/namespace_packages.txt
writing top-level names to src/zope.proxy.egg-info/top_level.txt
writing dependency_links to src/zope.proxy.egg-info/dependency_links.txt
writing manifest file 'src/zope.proxy.egg-info/SOURCES.txt'
> /usr/lib/python2.6/dist-packages/setuptools/command/build_ext.py(85)get_ext_filename()
-> filename = _build_ext.get_ext_filename(self,fullname)
(Pdb) c
reading manifest file 'src/zope.proxy.egg-info/SOURCES.txt'
writing manifest file 'src/zope.proxy.egg-info/SOURCES.txt'
copying src/zope/proxy/_zope_proxy_proxy.c -> build/lib.linux-i686-2.6/zope/proxy
running build_ext
> /usr/lib/python2.6/dist-packages/setuptools/command/build_ext.py(85)get_ext_filename()
-> filename = _build_ext.get_ext_filename(self,fullname)
(Pdb) n
> /usr/lib/python2.6/dist-packages/setuptools/command/build_ext.py(86)get_ext_filename()
-> ext = self.ext_map[fullname]
(Pdb) p filename
'_zope_proxy_proxy.so'
(Pdb) pp self.ext_map
{'zope.proxy._zope_proxy_proxy': <setuptools.extension.Extension instance at 0xa038aec>}
(Pdb) p fullname
'_zope_proxy_proxy'
(Pdb) c
Traceback (most recent call last):
  File "setup.py", line 72, in <module>
    zip_safe = False,
  File "/usr/lib/python2.6/distutils/core.py", line 152, in setup
    dist.run_commands()
  File "/usr/lib/python2.6/distutils/dist.py", line 975, in run_commands
    self.run_command(cmd)
  File "/usr/lib/python2.6/distutils/dist.py", line 995, in run_command
    cmd_obj.run()
  File "/usr/lib/python2.6/distutils/command/build.py", line 135, in run
    self.run_command(cmd_name)
  File "/usr/lib/python2.6/distutils/cmd.py", line 333, in run_command
    self.distribution.run_command(command)
  File "/usr/lib/python2.6/distutils/dist.py", line 995, in run_command
    cmd_obj.run()
  File "/usr/lib/python2.6/dist-packages/setuptools/command/build_ext.py", line 46, in run
    _build_ext.run(self)
  File "/usr/lib/python2.6/distutils/command/build_ext.py", line 340, in run
    self.build_extensions()
  File "/usr/lib/python2.6/dist-packages/Pyrex/Distutils/build_ext.py", line 82, in build_extensions
    self.build_extension(ext)
  File "/usr/lib/python2.6/dist-packages/setuptools/command/build_ext.py", line 176, in build_extension
    _build_ext.build_extension(self,ext)
  File "/usr/lib/python2.6/distutils/command/build_ext.py", line 460, in build_extension
    ext_path = self.get_ext_fullpath(ext.name)
  File "/usr/lib/python2.6/distutils/command/build_ext.py", line 633, in get_ext_fullpath
    filename = self.get_ext_filename(modpath[-1])
  File "/usr/lib/python2.6/dist-packages/setuptools/command/build_ext.py", line 86, in get_ext_filename
    ext = self.ext_map[fullname]
KeyError: '_zope_proxy_proxy'
emurphy@detox:~/zope.proxy$

ProblemType: Bug
Architecture: i386
Date: Fri Sep 11 13:03:47 2009
DistroRelease: Ubuntu 9.10
Package: python2.6 2.6.2-0ubuntu5
ProcEnviron:
 PATH=(custom, user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
ProcVersionSignature: Ubuntu 2.6.31-10.30-generic-pae
SourcePackage: python2.6
Uname: Linux 2.6.31-10-generic-pae i686

Revision history for this message
Elliot Murphy (statik) wrote :
Changed in ubuntuone-servers:
assignee: nobody → Elliot Murphy (statik)
importance: Undecided → Critical
status: New → Confirmed
Revision history for this message
Elliot Murphy (statik) wrote :

ScottK pointed out that building C extensions that don't use setuptools seems to be working fine.

summary: - building of python C extensions is broken
+ building of python C extensions with setuptools is broken
Revision history for this message
Ilya Barygin (randomaction) wrote :

Looks similar to bug 427496.

tags: added: regression-potential
Changed in python2.6 (Ubuntu Karmic):
status: New → Triaged
importance: Undecided → High
Revision history for this message
Robbie Williamson (robbiew) wrote :

Is this related to bug 392355 ?

Changed in python2.6 (Ubuntu Karmic):
assignee: nobody → Matthias Klose (doko)
Revision history for this message
Tarek Ziadé (tziade) wrote :

Here's a detailed explanation of the problem:

http://bitbucket.org/tarek/distribute/issue/41

I doubt setuptools will be fixed and released any soon for that. The project didn't see any commit from his maintainer since a year, and
he doesn't want anyone else that wish to help to take over to do so.

That's why we created a fork called Distribute that tries to fix the bugs founded in this project.

So there are two options for projects that build extensions:

- use plain distutils
- switch to Distribute 0.6.x.

Matthias Klose (doko)
affects: python2.6 (Ubuntu Karmic) → python-setuptools (Ubuntu Karmic)
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package python-setuptools - 0.6c9-0ubuntu5

---------------
python-setuptools (0.6c9-0ubuntu5) karmic; urgency=low

  * Fix building extensions with recent python 2.6.2+. Patch taken from
    http://bitbucket.org/tarek/distribute/issue/41/. LP: #428004.

 -- Matthias Klose <email address hidden> Sun, 13 Sep 2009 12:11:58 +0200

Changed in python-setuptools (Ubuntu Karmic):
status: Triaged → Fix Released
Elliot Murphy (statik)
Changed in ubuntuone-servers:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.