Bug report #19476

"PyCapsule_GetPointer called with incorrect name" when trying to build master

Added by Johannes Kroeger over 6 years ago. Updated over 6 years ago.

Status:Rejected
Priority:Normal
Assignee:-
Category:Build/Install
Affected QGIS version:3.3(master) Regression?:No
Operating System:Linux Easy fix?:No
Pull Request or Patch supplied:No Resolution:up/downstream
Crashes QGIS or corrupts data:No Copied to github as #:27304

Description

I am trying to compile QGIS from Git master on Archlinux.

python-sip 4.19.12-4
python-sip-pyqt5 4.19.12-4
sip 4.19.12-4
pyqt5-common 5.11.2-1
python-pyqt5 5.11.2-1

[ 98%] Built target pyutils
[ 98%] Built target pyqtcompat
[ 98%] Built target pygui
[ 98%] Generating ui_DlgAddGeometryColumn.py
Traceback (most recent call last):
  File "../../../../scripts/pyuic-wrapper.py", line 26, in <module>
    import qgis.PyQt.uic.pyuic
  File "/home/qgis/.cache/aurman/qgis-git/src/qgis/build/output/python/qgis/__init__.py", line 80, in <module>
    import qgis.gui
  File "/home/qgis/.cache/aurman/qgis-git/src/qgis/build/output/python/qgis/gui/__init__.py", line 27, in <module>
    from qgis._gui import *
ValueError: PyCapsule_GetPointer called with incorrect name
make[2]: *** [python/plugins/db_manager/CMakeFiles/zzz-db_manager-15-depend.dir/build.make:74: python/plugins/db_manager/ui_DlgAddGeometryColumn.py] Error 1
make[1]: *** [CMakeFiles/Makefile2:4143: python/plugins/db_manager/CMakeFiles/zzz-db_manager-15-depend.dir/all] Error 2
make: *** [Makefile:152: all] Error 2
==> ERROR: A failure occurred in build().
    Aborting...

qgis-3.2.1-fix-sip-name.patch Magnifier (4.12 KB) Chris Clayton, 2018-08-01 09:26 AM

Associated revisions

Revision 0fad3e57
Added by Nyall Dawson about 6 years ago

Fix build with newer sip versions

Fixes #19476

History

#1 Updated by Nyall Dawson over 6 years ago

  • Resolution set to up/downstream
  • Status changed from Open to Rejected

#2 Updated by Chris Clayton over 6 years ago

I too have been having trouble building QGIS - 3.2.1 in my case. I think I've tracked this issue down. I think it happens if the --sip-module is passed to configure.py when building sip. Riverbank Computing seem keen that the argument should be used to build private copies of the sip module - private will be mandatory from sip 5 (see http://pyqt.sourceforge.net/Docs/sip4/using.html#ref-private-sip). I blindly followed that line and found myself getting this error. I added some debugging to python3 to print the correct and incorrect names and found that they are "PyQt5.sip" and "sip". grepping the python code in qgis revealed that, at least in some places, the sip module name is hard coded as "sip".

The attached patch allowed the build to complete. Additionally, the changes to the two python source files allow qgis to run without having to use the PYTHONPATH environment variable so that the private module can be imported.

So, it would appear that folks may or may not run into this issue depending on how they (or their distro maintainers) build sip and the order in which sip, PyQt5, QGIS and, maybe, qscintilla are built. Ouch!

#3 Updated by Johannes Kroeger over 6 years ago

Thank you so much, works perfectly.

Also available in: Atom PDF