Mailing List Archive

[issue4706] try to build a C module, but don't worry if it doesn't work
Zooko O'Whielacronx <zooko@zooko.com> added the comment:

Tarek:

Yes, failure to build an extension module for any reason should
definitely cause "build" to fail by default. However, many Python
packages seem to come with optional extension modules, typically for a
performance speed-up. simplejson, zope.interface, and twisted all do
this (these are three packages that allmydata-tahoe depends on). My own
pyutil package used to do this, but I eventually just removed the
optional C extension module in order to avoid this problem. So, for
those it would be good if the package setup.py could specify that an
extension module is optional and that failure to build it for any reason
does not mean failure of the "build".

Note that twisted's setup.py already attempts to do this for certain of
its extension modules, and if I understand correctly it is able to
detect and handle failure to build if gcc fails, but not if gcc is absent.

_______________________________________
Python tracker <report@bugs.python.org>
<http://bugs.python.org/issue4706>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue4706] try to build a C module, but don't worry if it doesn't work [ In reply to ]
Jean-Paul Calderone <exarkun@divmod.com> added the comment:

As far as Twisted is concerned, the two cases Tarek mentioned aren't
really relevant. In order for Zooko's use case to be handled ("install
Twisted on an OLPC"), what would be ideal is if there were a way to tell
distutils about an extension which is optional. It doesn't matter if it
can be built or not. Any failure is irrelevant.

This doesn't necessarily have to mean that errors pass silently. The
build failure can still be reported. The build could even fail by
default and distutils could gain a new option for switching the behavior
to succeeding if only optional extensions fail to build. Or it could be
the other way around, with an option to make the build fail if any
optional extensions cannot be built (this approach favors people who
don't really know what a "build" is and just want something installed,
leaving the more advanced option to people who are able to figure out
that there are options that control build behavior).

----------
nosy: +exarkun

_______________________________________
Python tracker <report@bugs.python.org>
<http://bugs.python.org/issue4706>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue4706] try to build a C module, but don't worry if it doesn't work [ In reply to ]
Zooko O'Whielacronx <zooko@zooko.com> added the comment:

Hey check it out -- simplejson can try to build its extension module,
and when it fails to compile (in this case because there is no
Python.h), then it prints out a warning message and finishes a
successful build:

Added file: http://bugs.python.org/file12910/build-with-no-Python.h.txt

_______________________________________
Python tracker <report@bugs.python.org>
<http://bugs.python.org/issue4706>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue4706] try to build a C module, but don't worry if it doesn't work [ In reply to ]
Zooko O'Whielacronx <zooko@zooko.com> added the comment:

Oh! And simplejson is able to cleanly fall back to pure Python when gcc
is not found, as well. Perhaps Twisted
http://twistedmatrix.com/trac/ticket/3586 could use simplejson's approach.

_______________________________________
Python tracker <report@bugs.python.org>
<http://bugs.python.org/issue4706>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue4706] try to build a C module, but don't worry if it doesn't work [ In reply to ]
Changes by Zooko O'Whielacronx <zooko@zooko.com>:


Added file: http://bugs.python.org/file12911/build-with-no-gcc.txt

_______________________________________
Python tracker <report@bugs.python.org>
<http://bugs.python.org/issue4706>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue4706] try to build a C module, but don't worry if it doesn't work [ In reply to ]
Zooko O'Whielacronx <zooko@zooko.com> added the comment:

Here's Twisted failing to build when gcc is not installed:

Added file: http://bugs.python.org/file12912/Twisted-build-with-no-gcc.txt

_______________________________________
Python tracker <report@bugs.python.org>
<http://bugs.python.org/issue4706>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com
[issue4706] try to build a C module, but don't worry if it doesn't work [ In reply to ]
Zooko O'Whielacronx <zooko@zooko.com> added the comment:

Here's Twisted failing to build because Python.h isn't found:

Added file: http://bugs.python.org/file12913/Twisted-build-no-Python.h.txt

_______________________________________
Python tracker <report@bugs.python.org>
<http://bugs.python.org/issue4706>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com