qgis / QGIS

QGIS is a free, open source, cross platform (lin/win/mac) geographical information system (GIS)
https://qgis.org
GNU General Public License v2.0
10.04k stars 2.92k forks source link

Debian sid Qt6 compile fails on sip build, python bindings #57760

Open rduivenvoorde opened 3 weeks ago

rduivenvoorde commented 3 weeks ago

What is the bug or the crash?

Trying to compile QGIS in Debian sid (just to see if in near future I can use QGIS on Debian).

I fail to 'just compile' because of:

/home/richard/git/qgis/build/python/core/auto_generated/settings/qgssettingstreenode.sip: line 201: 'throw' is deprecated and will be removed in SIP v7.0.0
/home/richard/git/qgis/build/python/core/auto_generated/settings/qgssettingstreenode.sip: line 212: 'throw' is deprecated and will be removed in SIP v7.0.0
/home/richard/git/qgis/build/python/core/auto_generated/settings/qgssettingstreenode.sip: line 222: 'throw' is deprecated and will be removed in SIP v7.0.0
/home/richard/git/qgis/build/python/core/auto_generated/settings/qgssettingstreenode.sip: line 231: 'throw' is deprecated and will be removed in SIP v7.0.0
/home/richard/git/qgis/build/python/core/auto_generated/settings/qgssettingstreenode.sip: line 241: 'throw' is deprecated and will be removed in SIP v7.0.0
/home/richard/git/qgis/build/python/gui/auto_generated/qgsmapcanvas.sip: line 250: 'throw' is deprecated and will be removed in SIP v7.0.0
sip-build: /home/richard/git/qgis/build/python/core/auto_generated/qgsspatialindex.sip: line 144: column 5: 'QgsSpatialIndex::intersects' has an unsupported return type - provide %MethodCode and a C++ signature
/home/richard/git/qgis/build/python/core/auto_generated/qgsspatialindex.sip: line 155: column 5: 'QgsSpatialIndex::nearestNeighbor' has an unsupported return type - provide %MethodCode and a C++ signature
/home/richard/git/qgis/build/python/core/auto_generated/qgsspatialindex.sip: line 175: column 5: 'QgsSpatialIndex::nearestNeighbor' has an unsupported return type - provide %MethodCode and a C++ signature
/home/richard/git/qgis/build/python/gui/auto_generated/attributetable/qgsattributetableview.sip: line 61: column 5: 'QgsAttributeTableView::selectedFeaturesIds' has an unsupported return type - provide %MethodCode and a C++ signature
ninja: build stopped: subcommand failed.

Asked this earlier on the mailing list, there Nyall proposed to use a fixed python/PyQt6/core/conversions.sip: https://github.com/nyalldawson/QGIS/commit/c9b8c74d8abbc61f373dafbe94c35f2b8e9fe41d

This works but apparently it cannot be merged, or the latest versions of the sid packages still are not on par with the Fedora versions??

Note that even after this conversions.sip fix, the install fails because of an error in the dbmanager python plugin (of which I then disable the install).

Steps to reproduce the issue

Create VM with Debian sid, checkout master in your ~/git dir.

Try to Compile QGIS

Versions

In the end of the configure step I get:

QGIS version: 3.37.0 Master (33700)
 Could NOT find OpenCL (missing: OpenCL_LIBRARY OpenCL_INCLUDE_DIR)
 Couldn't find OpenCL: support DISABLED
 ccache found
 Could not find GRASS 7
 Could not find GRASS 8
 Found Proj: 9.4.1 /usr/lib/x86_64-linux-gnu/cmake/proj
 Found Geos: 3.12.2 /usr/lib/x86_64-linux-gnu/cmake/GEOS
 Found GDAL: 3.9.0 /usr/lib/x86_64-linux-gnu/cmake/gdal
 Found Spatialindex: /usr/lib/x86_64-linux-gnu/libspatialindex.so
 Found libzip: /usr/lib/x86_64-linux-gnu/libzip.so
 Found Sqlite3: /usr/lib/x86_64-linux-gnu/libsqlite3.so
 Could NOT find Protobuf (missing: Protobuf_DIR)
 Found Protobuf: /usr/lib/x86_64-linux-gnu/libprotobuf.so
 Found zlib: /usr/lib/x86_64-linux-gnu/libz.so
 Found exiv2: /usr/lib/x86_64-linux-gnu/libexiv2.so
 Qt WebKit support DISABLED.
 Using embedded laz-perf
 Found ZSTD: /usr/lib/x86_64-linux-gnu/libzstd.so
 Found Draco: /usr/lib/x86_64-linux-gnu/libdraco.so (1.5.6)
 PDF4Qt disabled
 QtWebEngine support DISABLED.
 Found Qt version: 6.6.2
 Found QScintilla2: /usr/lib/x86_64-linux-gnu/libqscintilla2_qt6.so (2.14.1)
 Found Qwt: /usr/lib/x86_64-linux-gnu/libqwt-qt6.so (6.2.0)
 Found QCA: /usr/lib/x86_64-linux-gnu/libqca-qt6.so (2.3.8)
 Found QCA OpenSSL plugin
 Pedantic compiler settings enabled
 Debug output enabled
 -- Found Python executable: /usr/bin/python3 (version 3.11.9)
 -- Python library: /usr/lib/x86_64-linux-gnu/libpython3.11.so
 -- Python site-packages: /usr/local/lib/python3.11/dist-packages
 Found SIP version: 6.8.3
 Found PyQt6 version: 6.7.0

 Found QScintilla2 PyQt module: 2.14.1

 Using PROJ >= 6 srs database.

Supported QGIS version

New profile

Additional context

No response

troopa81 commented 2 weeks ago

Fedora and Debian (testing in my case but I get the same issue) doesn't ship the same PyQt/SIP version.

fedora -- Found SIP version: 6.7.12 -- Found PyQt6 version: 6.6.1

debian -- Found SIP version: 6.8.3 -- Found PyQt6 version: 6.7.0 (6.6.1 in testing)

I cannot restore the QList<qint64> in conversions.sip because it then breaks fedora (same mapped type defined in a different module).

I asked in pyqt list, let's wait their answers.

troopa81 commented 2 weeks ago

I give up!

I fail to understand what's going on and I didn't get much help on the mailing list.

It could be related to the fact that Qt and PyQt minor version differs on Debian (6.6.2/6.7.0 on sid and 6.4.2/6.6.1 on testing) while the version matches on Fedora. I imagine next step would be to try to build pyqt from the Qt distribution package to have matching version...

but I don't have the energy/time left to try this.

nyalldawson commented 2 weeks ago

@troopa81

What a mess 😭. One ugly idea I had would be to just add a cmake bool for "SIP_NEEDS_QLIST_QINT64_CONVERSION", and enable the conversion code selectively based on this setting. It'd require developers to set that switch for certain platforms, but at least it'd get things compiling

rduivenvoorde commented 2 weeks ago

Thanks both, for investigating. I'm not in a hurry, and if I really need a Qt6 build (for some plugin), I can use Nyall's conversions.sip. Please refrain from 'fixes' only because of my question. Better keep it simple for those that actually do Qt6 work, and apparently work on Fedora.

Did we already decide on which python binding system we use in future: PyQt vs the QtPython stuff?

troopa81 commented 2 weeks ago

@nyalldawson Yeah, I thought about something like that, or maybe a If debian and SIP 6 directive so no developer lose time with this. But that's ugly.

Please refrain from 'fixes' only because of my question.

Acutally, I'm also on Debian and it bothers me, and an other contributor already lose some precious time figure out what's going on, so I think we need a fix here.

Did we already decide on which python binding system we use in future: PyQt vs the QtPython stuff?

For now, we stick to PyQt but I still plan to continue the QtPython port to see it it can work.