Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
2 tasks
rduivenvoorde opened this issue Jun 14, 2024 · 10 comments
Closed
2 tasks

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

rduivenvoorde opened this issue Jun 14, 2024 · 10 comments
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Build/Install Related to compiling or installing QGIS Feedback Waiting on the submitter for answers Linux

Comments

@rduivenvoorde
Copy link
Contributor

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:
nyalldawson@c9b8c74

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

  • I'm running a supported QGIS version according to the roadmap.

New profile

Additional context

No response

@rduivenvoorde rduivenvoorde added the Bug Either a bug report, or a bug fix. Let's hope for the latter! label Jun 14, 2024
@agiudiceandrea agiudiceandrea added Build/Install Related to compiling or installing QGIS Linux labels Jun 14, 2024
@troopa81 troopa81 self-assigned this Jun 18, 2024
@troopa81
Copy link
Contributor

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
Copy link
Contributor

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.

@troopa81 troopa81 removed their assignment Jun 19, 2024
@nyalldawson
Copy link
Collaborator

@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
Copy link
Contributor Author

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
Copy link
Contributor

@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.

@troopa81
Copy link
Contributor

@rduivenvoorde Is it just me of is it just working right now ? AFAIK I never see any modification on this on QGIS, but I managed to build QGIS master with Qt6 on debian testing. Do you confirm?

@troopa81 troopa81 added the Feedback Waiting on the submitter for answers label Sep 16, 2024
@rduivenvoorde
Copy link
Contributor Author

Mmm, I failed the 12th of sept....
But will try right away :-)

@rduivenvoorde
Copy link
Contributor Author

Still failing here.

  • ccache -C
  • fresh git pull
  • fresh apt update

Building using (tried both with and without OAUTH2_PLUGIN):

ccmake -GNinja -DBUILD_TESTING=FALSE -DENABLE_TESTS=OFF -DWITH_SERVER=FALSE -DWITH_3D=FALSE -DCMAKE_INSTALL_PREFIX=/home/richard/bin/qgis_/qt6/debug -DWITH_QWTPOLAR=OFF -DCMAKE_BUILD_TYPE=Debug -DWITH_GRASS=FALSE -DBUILD_WITH_QT6=TRUE -DWITH_OAUTH2_PLUGIN=FALSE -DWITH_WITH_SERVER_PLUGINS=OFF -DWITH_STAGED_PLUGINS=OFF -DWITH_PDAL=OFF -DWITH_QTWEBKIT=OFF ..

Keeps failing on (which I earlier fixed by using an old PR of Nyall, but that does not work anymore with me):

home/richard/git/qgis/src/core/auth/qgsauthconfigurationstoragedb.cpp
/home/richard/git/qgis/src/core/auth/qgsauthconfigurationstoragedb.cpp: In lambda function:
/home/richard/git/qgis/src/core/auth/qgsauthconfigurationstoragedb.cpp:174:62: error: no matching function for call to QMapIterator<QString, QVariant>::QMapIterator(QVariantList)
  174 |     QMapIterator<QString, QVariant> it( query->boundValues() );
      |                                                              ^
In file included from /usr/include/x86_64-linux-gnu/qt6/QtCore/qlist.h:11,
                 from /usr/include/x86_64-linux-gnu/qt6/QtCore/qdebug.h:28,
                 from /usr/include/x86_64-linux-gnu/qt6/QtCore/qvariant.h:11,
                 from /usr/include/x86_64-linux-gnu/qt6/QtCore/qmetaobject.h:9,
                 from /usr/include/x86_64-linux-gnu/qt6/QtCore/QMetaEnum:1,
                 from /home/richard/git/qgis/src/core/qgis.h:22,
                 from /home/richard/git/qgis/src/core/auth/qgsauthconfigurationstorage.h:22,
                 from /home/richard/git/qgis/src/core/auth/qgsauthconfigurationstoragedb.h:20,
                 from /home/richard/git/qgis/src/core/auth/qgsauthconfigurationstoragedb.cpp:16:
/usr/include/x86_64-linux-gnu/qt6/QtCore/qmap.h:782:1: note: candidate: QMapIterator<Key, T>::QMapIterator(const QMap<Key, T>&) [with Key = QString; T = QVariant]
  782 | Q_DECLARE_ASSOCIATIVE_ITERATOR(Map)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/x86_64-linux-gnu/qt6/QtCore/qmap.h:782:1: note:   no known conversion for argument 1 from QVariantList {aka QList<QVariant>} to const QMap<QString, QVariant>&
  782 | Q_DECLARE_ASSOCIATIVE_ITERATOR(Map)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/x86_64-linux-gnu/qt6/QtCore/qmap.h:782:1: note: candidate: QMapIterator<QString, QVariant>::QMapIterator(const QMapIterator<QString, QVariant>&)
  782 | Q_DECLARE_ASSOCIATIVE_ITERATOR(Map)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/x86_64-linux-gnu/qt6/QtCore/qmap.h:782:1: note:   no known conversion for argument 1 from QVariantList {aka QList<QVariant>} to const QMapIterator<QString, QVariant>&
/usr/include/x86_64-linux-gnu/qt6/QtCore/qmap.h:782:1: note: candidate: QMapIterator<QString, QVariant>::QMapIterator(QMapIterator<QString, QVariant>&&)
/usr/include/x86_64-linux-gnu/qt6/QtCore/qmap.h:782:1: note:   no known conversion for argument 1 from QVariantList {aka QList<QVariant>} to QMapIterator<QString, QVariant>&&
[2151/9529] Generating analysis/build/_analysis/sip_analysispart0.cpp, analysis/bu.../_analysis/sip_analysispart23.cpp, analysis/build/_analysis/sip_analysispart24.cpp

pyproject.toml: line 7: using '[tool.sip.metadata]' to specify the project metadata is deprecated and will be removed in SIP v7.0.0, use '[project]' instead
Querying qmake about your Qt installation...
These bindings will be built: analysis.
Generating the analysis bindings...
/usr/lib/python3/dist-packages/PyQt6/bindings/QtCore/QtCoremod.sip: line 64: '%Plugin' is deprecated and will be removed in SIP v7.0.0
/home/richard/git/qgis/build/python/core/auto_generated/qgsconnectionregistry.sip: line 37: 'throw' is deprecated and will be removed in SIP v7.0.0
/home/richard/git/qgis/build/python/core/auto_generated/qgsdistancearea.sip: line 263: 'throw' is deprecated and will be removed in SIP v7.0.0
/home/richard/git/qgis/build/python/core/auto_generated/qgsfeatureiterator.sip: line 130: 'throw' is deprecated and will be removed in SIP v7.0.0
/home/richard/git/qgis/build/python/core/auto_generated/qgsfeatureiterator.sip: line 140: 'throw' is deprecated and will be removed in SIP v7.0.0

@troopa81
Copy link
Contributor

This issue has been fixed recently #58719

@rduivenvoorde
Copy link
Contributor Author

Confirmed: a clean Debian testing with vanilla QGIS sources can be compiled to a working state (including Python) now !!

\o/

Thanks ALL!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Build/Install Related to compiling or installing QGIS Feedback Waiting on the submitter for answers Linux
Projects
None yet
Development

No branches or pull requests

4 participants