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

Build PyQt6 with c++ 17 #55538

Merged
merged 1 commit into from
Dec 11, 2023
Merged

Build PyQt6 with c++ 17 #55538

merged 1 commit into from
Dec 11, 2023

Conversation

troopa81
Copy link
Contributor

@troopa81 troopa81 commented Dec 6, 2023

On my way to split #52739 in small chunks

The hack is no longer needed in Qt 6, as this last requires c++17

@github-actions github-actions bot added this to the 3.36.0 milestone Dec 6, 2023
Copy link

github-actions bot commented Dec 6, 2023

🪟 Windows builds ready!

Windows builds of this PR are available for testing here. Debug symbols for this build are available here.

@nyalldawson
Copy link
Collaborator

Do you know what happens with "throw" in pyqt6? Is it treated like it should be and just a hint to sip now? Previously it was needed to correctly get a proper exception raised instead of a generic one. (Ie QgsCsException vs exception)

@troopa81
Copy link
Contributor Author

troopa81 commented Dec 7, 2023

Do you know what happens with "throw" in pyqt6? Is it treated like it should be and just a hint to sip now? Previously it was needed to correctly get a proper exception raised instead of a generic one. (Ie QgsCsException vs exception)

No, the documentation says that throw() directives are ignored but so far it looks like we have a regression here because only QgsException is returned instead of QgsProviderConnectionException for instance

 xvfb-run python3 ../tests/src/python/test_qgsconnectionregistry.py -k testCreateConnectionBad

======================================================================
ERROR: testCreateConnectionBad (__main__.TestQgsConnectionRegistry.testCreateConnectionBad)
Test creating connection with bad parameters
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/julien/work/QGIS/.worktrees/pyqt6/build-fedora/../tests/src/python/test_qgsconnectionregistry.py", line 65, in testCreateConnectionBad
    QgsApplication.connectionRegistry().createConnection('invalid')
_core.QgsException: Invalid connection id

There is something else to me modified I think. I propose to move on and fix this later.

@nyalldawson
Copy link
Collaborator

Hmm, two things jump to mind here.

Maybe it relates to the ordering of exceptions in the exceptions sip file, and we should move the generic exception to be last there. Possibly sip is just matching the first exception type it encounters.

Or, possibly we should remove the inheritance from the child exception classes and ensure they aren't QgsExceptions....

@troopa81
Copy link
Contributor Author

@nyalldawson Thanks for the hints. I'll try those when it comes to fix more things.

First I would rather move toward a first working version, so do you mind merging this one?

@nyalldawson
Copy link
Collaborator

@troopa81

Looks like my first guess was right, and newer sip gives an explicit warning when a generic exception is handled before more specialised exceptions. See #55481 (comment)

I've hopefully addressed this in #55576 . I'd love to hear if this fixes things in PyQt6!

@nyalldawson nyalldawson merged commit 0884f5c into qgis:master Dec 11, 2023
@troopa81
Copy link
Contributor Author

I've hopefully addressed this in #55576 . I'd love to hear if this fixes things in PyQt6!

It does fix the exception issue in PyQt6 👍

I will try to remove the throw directive from the sip files in PyQt6 as there are probably ignored.

@gdt
Copy link
Contributor

gdt commented Dec 12, 2023

There are many fixes to sip beyond the 6.8.0 tag, and one of them is restoring exception code that was mistakenly not generated in some circumstances. So if you are testing with 6.8.0, things are messy. 6.8.0 should not be used at all.

@troopa81
Copy link
Contributor Author

@gdt I am testing with PyQt 6.6.0 and sip 6.7.12 shipped with fedora:38

With those versions I don't have the same issues, but the modification in #55576 fixed a few things with PyQt6.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants