Bug report #19332

QGIS 2.18.21 fails to build with SIP 4.19.11

Added by Bas Couwenberg over 6 years ago. Updated over 6 years ago.

Status:Closed
Priority:High
Assignee:-
Category:Python bindings / sipify
Affected QGIS version:2.18.21 Regression?:Yes
Operating System:Debian GNU/Linux (unstable) Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:27160

Description

QGIS 2.18.21 fails to build in Debian unstable where sip4 was recently updated to 4.19.11.

Applying the `sip_mod_dir` changes to `cmake/FindSIP.py` is not sufficient, the build still fails to find SIP headers:

[...]
[ 42%] Building CXX object python/CMakeFiles/python_module_qgis__analysis.dir/analysis/sip_analysispart0.cpp.o
cd /build/qgis-2.18.21+dfsg/debian/build/python && /usr/bin/c++  -DQT_CORE_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_NO_CAST_TO_ASCII -DQT_NO_DEBUG -DQT_SQL_LIB -DQT_SVG_LIB -DQT_XML_LIB -Dprotected=public -Dpython_module_qgis__analysis_EXP
ORTS -isystem /usr/include/qt4 -isystem /usr/include/qt4/QtSvg -isystem /usr/include/qt4/QtGui -isystem /usr/include/qt4/QtXml -isystem /usr/include/qt4/QtSql -isystem /usr/include/qt4/QtNetwork -isystem /usr/include/qt4/QtCore -I/build/
qgis-2.18.21+dfsg/debian/build -isystem /usr/include/python2.7 -isystem /usr/include/gdal -isystem /usr/include/qwt -isystem /build/qgis-2.18.21+dfsg/src/core/gps/qextserialport -isystem /usr/include/QtCrypto -I/build/qgis-2.18.21+dfsg/p
ython/../src/core -I/build/qgis-2.18.21+dfsg/python/../src/core/auth -I/build/qgis-2.18.21+dfsg/python/../src/core/pal -I/build/qgis-2.18.21+dfsg/python/../src/core/composer -I/build/qgis-2.18.21+dfsg/python/../src/core/diagram -I/build/
qgis-2.18.21+dfsg/python/../src/core/effects -I/build/qgis-2.18.21+dfsg/python/../src/core/dxf -I/build/qgis-2.18.21+dfsg/python/../src/core/geometry -I/build/qgis-2.18.21+dfsg/python/../src/core/gps -I/build/qgis-2.18.21+dfsg/python/../
src/core/layertree -I/build/qgis-2.18.21+dfsg/python/../src/core/raster -I/build/qgis-2.18.21+dfsg/python/../src/core/symbology-ng -I/build/qgis-2.18.21+dfsg/python/../src/gui/raster -I/build/qgis-2.18.21+dfsg/python/../src/gui/attribute
table -I/build/qgis-2.18.21+dfsg/python/../src/gui/auth -I/build/qgis-2.18.21+dfsg/python/../src/gui/editorwidgets -I/build/qgis-2.18.21+dfsg/python/../src/gui/editorwidgets/core -I/build/qgis-2.18.21+dfsg/python/../src/gui/effects -I/bu
ild/qgis-2.18.21+dfsg/python/../src/gui/layertree -I/build/qgis-2.18.21+dfsg/python/sip_helpers -I/build/qgis-2.18.21+dfsg/python/../src/gui -I/build/qgis-2.18.21+dfsg/python/../src/gui/symbology-ng -I/build/qgis-2.18.21+dfsg/python/../s
rc/plugins -I/build/qgis-2.18.21+dfsg/debian/build/src/gui -I/build/qgis-2.18.21+dfsg/debian/build/src/ui -I/build/qgis-2.18.21+dfsg/python/../src/server -I/build/qgis-2.18.21+dfsg/debian/build/src/server -I/build/qgis-2.18.21+dfsg/pytho
n/../src/analysis/vector -I/build/qgis-2.18.21+dfsg/python/../src/analysis/raster -I/build/qgis-2.18.21+dfsg/python/../src/analysis/network -I/build/qgis-2.18.21+dfsg/python/../src/analysis/interpolation -I/build/qgis-2.18.21+dfsg/python
/../src/analysis/openstreetmap -I/build/qgis-2.18.21+dfsg/debian/build/src/analysis/vector -I/build/qgis-2.18.21+dfsg/debian/build/src/analysis/network -I/build/qgis-2.18.21+dfsg/debian/build/src/analysis/raster -I/build/qgis-2.18.21+dfs
g/debian/build/src/analysis/interpolation -I/build/qgis-2.18.21+dfsg/debian/build/src/analysis/openstreetmap  -g -O2 -fdebug-prefix-map=/build/qgis-2.18.21+dfsg=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_F
ORTIFY_SOURCE=2 -O2 -Wdate-time -D_FORTIFY_SOURCE=2 -DSPATIALITE_VERSION_GE_4_0_0 -DSPATIALITE_VERSION_G_4_1_1 -DSPATIALITE_HAS_INIT_EX -std=c++11 -Wall -Wextra -Wno-long-long -Wformat-security -Wno-strict-aliasing -fPIC -fvisibility=def
ault   -DCORE_EXPORT= -DGUI_EXPORT= -DPYTHON_EXPORT= -DANALYSIS_EXPORT= -DAPP_EXPORT= -DCUSTOMWIDGETS_EXPORT= -DSERVER_EXPORT= -w -Wno-deprecated-declarations -fpermissive -w -Wno-deprecated-declarations -fpermissive -w -Wno-deprecated-d
eclarations -fpermissive -w -Wno-deprecated-declarations -fpermissive -w -Wno-deprecated-declarations -fpermissive -o CMakeFiles/python_module_qgis__analysis.dir/analysis/sip_analysispart0.cpp.o -c /build/qgis-2.18.21+dfsg/debian/build/p
ython/analysis/sip_analysispart0.cpp
/build/qgis-2.18.21+dfsg/debian/build/python/analysis/sip_analysispart0.cpp:7:10: fatal error: sipAPI_analysis.h: No such file or directory
 #include "sipAPI_analysis.h" 
          ^~~~~~~~~~~~~~~~~~~
compilation terminated.
make[4]: *** [python/CMakeFiles/python_module_qgis__analysis.dir/build.make:437: python/CMakeFiles/python_module_qgis__analysis.dir/analysis/sip_analysispart0.cpp.o] Error 1
make[4]: Leaving directory '/build/qgis-2.18.21+dfsg/debian/build'
make[3]: *** [CMakeFiles/Makefile2:4375: python/CMakeFiles/python_module_qgis__analysis.dir/all] Error 2
make[3]: *** Waiting for unfinished jobs....
[...]
[ 42%] Building CXX object python/CMakeFiles/python_module_qgis__core.dir/core/sip_corepart0.cpp.o
cd /build/qgis-2.18.21+dfsg/debian/build/python && /usr/bin/c++  -DQT_CORE_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_NO_CAST_TO_ASCII -DQT_NO_DEBUG -DQT_SQL_LIB -DQT_SVG_LIB -DQT_XML_LIB -Dprotected=public -Dpython_module_qgis__core_EXPORTS -isystem /usr/include/qt4 -isystem /usr/include/qt4/QtSvg -isystem /usr/include/qt4/QtGui -isystem /usr/include/qt4/QtXml -isystem /usr/include/qt4/QtSql -isystem /usr/include/qt4/QtNetwork -isystem /usr/include/qt4/QtCore -I/build/qgis-2.18.21+dfsg/debian/build -isystem /usr/include/python2.7 -isystem /usr/include/gdal -isystem /usr/include/qwt -isystem /build/qgis-2.18.21+dfsg/src/core/gps/qextserialport -isystem /usr/include/QtCrypto -I/build/qgis-2.18.21+dfsg/python/../src/core -I/build/qgis-2.18.21+dfsg/python/../src/core/auth -I/build/qgis-2.18.21+dfsg/python/../src/core/pal -I/build/qgis-2.18.21+dfsg/python/../src/core/composer -I/build/qgis-2.18.21+dfsg/python/../src/core/diagram -I/build/qgis-2.18.21+dfsg/python/../src/core/effects -I/build/qgis-2.18.21+dfsg/python/../src/core/dxf -I/build/qgis-2.18.21+dfsg/python/../src/core/geometry -I/build/qgis-2.18.21+dfsg/python/../src/core/gps -I/build/qgis-2.18.21+dfsg/python/../src/core/layertree -I/build/qgis-2.18.21+dfsg/python/../src/core/raster -I/build/qgis-2.18.21+dfsg/python/../src/core/symbology-ng -I/build/qgis-2.18.21+dfsg/python/../src/gui/raster -I/build/qgis-2.18.21+dfsg/python/../src/gui/attributetable -I/build/qgis-2.18.21+dfsg/python/../src/gui/auth -I/build/qgis-2.18.21+dfsg/python/../src/gui/editorwidgets -I/build/qgis-2.18.21+dfsg/python/../src/gui/editorwidgets/core -I/build/qgis-2.18.21+dfsg/python/../src/gui/effects -I/build/qgis-2.18.21+dfsg/python/../src/gui/layertree -I/build/qgis-2.18.21+dfsg/python/sip_helpers -I/build/qgis-2.18.21+dfsg/python/../src/gui -I/build/qgis-2.18.21+dfsg/python/../src/gui/symbology-ng -I/build/qgis-2.18.21+dfsg/python/../src/plugins -I/build/qgis-2.18.21+dfsg/debian/build/src/gui -I/build/qgis-2.18.21+dfsg/debian/build/src/ui -I/build/qgis-2.18.21+dfsg/python/../src/server -I/build/qgis-2.18.21+dfsg/debian/build/src/server -I/build/qgis-2.18.21+dfsg/python/../src/analysis/vector -I/build/qgis-2.18.21+dfsg/python/../src/analysis/raster -I/build/qgis-2.18.21+dfsg/python/../src/analysis/network -I/build/qgis-2.18.21+dfsg/python/../src/analysis/interpolation -I/build/qgis-2.18.21+dfsg/python/../src/analysis/openstreetmap -I/build/qgis-2.18.21+dfsg/debian/build/src/analysis/vector -I/build/qgis-2.18.21+dfsg/debian/build/src/analysis/network -I/build/qgis-2.18.21+dfsg/debian/build/src/analysis/raster -I/build/qgis-2.18.21+dfsg/debian/build/src/analysis/interpolation -I/build/qgis-2.18.21+dfsg/debian/build/src/analysis/openstreetmap  -g -O2 -fdebug-prefix-map=/build/qgis-2.18.21+dfsg=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -O2 -Wdate-time -D_FORTIFY_SOURCE=2 -DSPATIALITE_VERSION_GE_4_0_0 -DSPATIALITE_VERSION_G_4_1_1 -DSPATIALITE_HAS_INIT_EX -std=c++11 -Wall -Wextra -Wno-long-long -Wformat-security -Wno-strict-aliasing -fPIC -fvisibility=default   -DCORE_EXPORT= -DGUI_EXPORT= -DPYTHON_EXPORT= -DANALYSIS_EXPORT= -DAPP_EXPORT= -DCUSTOMWIDGETS_EXPORT= -DSERVER_EXPORT= -w -Wno-deprecated-declarations -fpermissive -w -Wno-deprecated-declarations -fpermissive -w -Wno-deprecated-declarations -fpermissive -w -Wno-deprecated-declarations -fpermissive -w -Wno-deprecated-declarations -fpermissive -o CMakeFiles/python_module_qgis__core.dir/core/sip_corepart0.cpp.o -c /build/qgis-2.18.21+dfsg/debian/build/python/core/sip_corepart0.cpp
/build/qgis-2.18.21+dfsg/debian/build/python/core/sip_corepart0.cpp:7:10: fatal error: sipAPI_core.h: No such file or directory
 #include "sipAPI_core.h" 
          ^~~~~~~~~~~~~~~
compilation terminated.
make[4]: *** [python/CMakeFiles/python_module_qgis__core.dir/build.make:397: python/CMakeFiles/python_module_qgis__core.dir/core/sip_corepart0.cpp.o] Error 1
make[4]: Leaving directory '/build/qgis-2.18.21+dfsg/debian/build'
make[3]: *** [CMakeFiles/Makefile2:4235: python/CMakeFiles/python_module_qgis__core.dir/all] Error 2

Associated revisions

Revision a0b6dc2d
Added by Jürgen Fischer over 6 years ago

fix build with SIP 4.19.11 (fixes #19332)

History

#1 Updated by Jürgen Fischer over 6 years ago

Bas Couwenberg wrote:

QGIS 2.18.21 fails to build in Debian unstable where sip4 was recently updated to 4.19.11.

Applying the `sip_mod_dir` changes to `cmake/FindSIP.py` is not sufficient, the build still fails to find SIP headers:

here sip crashes, but SUPPRESS_SIP_WARNINGS causes the error to be ignored and the build goes on with an incompletly generated cpp and w/o the header. Without SUPPRESS_SIP_WARNINGS I get:

…
[100%] Generating core/sip_corepart0.cpp, core/sip_corepart1.cpp, core/sip_corepart2.cpp, core/sip_corepart3.cpp
cd /home/fischer/src/qgis-2.18/debian/build/python && /usr/bin/cmake -E echo

cd /home/fischer/src/qgis-2.18/debian/build/python && /usr/bin/cmake -E touch /home/fischer/src/qgis-2.18/debian/build/python/core/sip_corepart0.cpp /home/fischer/src/qgis-2.18/debian/build/python/core/sip_corepart1.cpp /home/fischer/src/qgis-2.18/debian/build/python/core/sip_corepart2.cpp /home/fischer/src/qgis-2.18/debian/build/python/core/sip_corepart3.cpp
cd /home/fischer/src/qgis-2.18/debian/build/python && /usr/bin/sip -w -e -x QT5_SUPPORT -x ANDROID -x ARM -x HAVE_TOUCH -x MOBILITY_LOCATION -x QSETINT_CONVERSION -x QSETTYPE_CONVERSION -x QVECTORINT_CONVERSION -x CHIMERA_NULL_VARIANT_CONVERSION -x VendorID -t WS_X11 -x PyQt_NoPrintRangeBug -t Qt_4_8_6 -x Py_v3 -g -o -a /home/fischer/src/qgis-2.18/debian/build/python/qgis.core.api -j 4 -c /home/fischer/src/qgis-2.18/debian/build/python/core -I /usr/share/sip/PyQt4 -I /home/fischer/src/qgis-2.18/python /home/fischer/src/qgis-2.18/python/core/core.sip
Segmentation fault
make[4]: *** [python/CMakeFiles/python_module_qgis__core.dir/build.make:383: python/core/sip_corepart0.cpp] Error 139
make[4]: *** Deleting file 'python/core/sip_corepart0.cpp'
…

#2 Updated by Jürgen Fischer over 6 years ago

Jürgen Fischer wrote:

here sip crashes,

sip-dev=4.19.11+dfsg-1 also segfaults with 3.2

#3 Updated by Jürgen Fischer over 6 years ago

Apparently caused by an unset module name (QGIS doesn't use new sip -n) - sip doesn't have a sane default, leaves sipName=NULL and crashes here in sipgen/gencode.c:

 2775     prcode(fp,
 2776 "    /* Get the SIP module's API. */\n" 
 2777 "#if PY_VERSION_HEX >= 0x02050000\n" 
 2778 "    sip_sipmod = PyImport_ImportModule(\"%s\");\n" 
 2779 "#else\n" 
 2780         , sipName);

#4 Updated by Jürgen Fischer over 6 years ago

  • % Done changed from 0 to 100
  • Status changed from Open to Closed

#5 Updated by Bas Couwenberg over 6 years ago

FYI: sip4 (4.19.12+dfsg-1) fixed this upstream:

  • New upstream release.
    - Fixes segfault when -n option is not specified (closes: #903263).

Also available in: Atom PDF