Python: add patch to abort if module fails to build

Signed-off-by: Stephan Raue <stephan@openelec.tv>
This commit is contained in:
Stephan Raue 2016-03-07 15:53:29 +01:00
parent 2c7678c41e
commit ebb3882752
2 changed files with 21 additions and 7 deletions

View File

@ -135,13 +135,6 @@ post_makeinstall_target() {
python -Wi -t -B ../Lib/compileall.py $INSTALL/usr/lib/python*/ -f
rm -rf `find $INSTALL/usr/lib/python*/ -name "*.py"`
if [ ! -f $INSTALL/usr/lib/python*/lib-dynload/_socket.so ]; then
echo "sometimes Python dont build '_socket.so' for some reasons and continues without failing,"
echo "let it fail here, to be sure '_socket.so' will be installed. A rebuild of Python fixes"
echo "the issue in most cases"
exit 1
fi
rm -rf $INSTALL/usr/lib/python*/config
rm -rf $INSTALL/usr/bin/2to3
rm -rf $INSTALL/usr/bin/idle

View File

@ -0,0 +1,21 @@
Abort on failed module build
When building a Python module fails, the setup.py script currently
doesn't exit with an error, and simply continues. This is not a really
nice behavior, so this patch changes setup.py to abort with an error,
so that the build issue is clearly noticeable.
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Index: b/setup.py
===================================================================
--- a/setup.py
+++ b/setup.py
@@ -283,6 +283,7 @@
print "Failed to build these modules:"
print_three_column(failed)
print
+ sys.exit(1)
def build_extension(self, ext):