-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
fix sid build with sip 6.9.1 #59995
fix sid build with sip 6.9.1 #59995
Conversation
🪟 Windows buildsDownload Windows builds of this PR for testing. 🪟 Windows Qt6 buildsDownload Windows Qt6 builds of this PR for testing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for taking care of this @jef-n !
It looks good. Where did you get that we have to use major version 13 for Qt 6 and 12 for Qt 5 ? I look into the SIP documentation and find nothing.
LGTM and regarding Qt5 vor Qt6, that is in the pyqt[56]-SIP code |
Can you be more specific ? |
https://github.com/Python-SIP/sip/blob/a619d79626cfff6678d194c7dd8d0d948bb644c0/sipbuild/module/source/13/sip.h.in#L37 |
OK. Thanks @t0b3 |
@jef-n does it compile on sid with this merged? unfortunately here on fedora 41 this commit now produces errors how can cmake detect the ABI version instead to react accordingly then? cc @troopa81 we still need some improvements to get this going... |
@t0b3 IMHO fedora needs to ship PyQt-sip-13.9 along with sip-6.9.0 to be fully compliant. In this case PyQt-sip would support the 13.9 ABI If this is not possible, we need to detect the sip ABI in our cmake to set our ABI minimum version accordingly and enable or not /Deprecated/ with message. I would prefer to go option the first option than going into complicated stuff but if there is no other way... |
@troopa81 can you give more details i.e. compliant to what specifically? OTOH sip ABI detection won't hurt, let's see if maybe Phil could show an easy way forward here |
sure - but using qt5. |
@t0b3 If I understand it correctly (which is not 100% sure) You see in PyQt-sip-13.8 ship a sip.h file with a ABI_MINOR_VERSION version 8. QGIS retrieve the SIP module from PyQt SIP module, so even if it's build with sip 6.9.0, your are not garanteed to have the latest SIP minor version (9 actually). So this PyQt sip module supports actually only 13.8 and is not enough to support the option /Deprecated with message which appear in 6.9.0. We enable this option if we have sip 6.9.0, so that's why it fails here. |
Well, see the linked code - pyqtbuild (which provides the abi_version to sipbuild) reports the minimal version 12.13 / 13.6 no matter what version is actually installed and sip-build requires 12.16 / 13.9 for the deprecation messages. So unless the abi-version is explictly set in pyproject.toml it should always fail - and that's what happening on sid - and as said independently from what version is actually installed (would also be 12.16 / 13.9 on sid). |
if pyqtbuild would report the actual sip abi version, it would work too |
💯 my understanding That's why it's not enough to rely on the sip version, it might be foolproof to rely on the ABI version. |
Is pyqtbuild not used on fedora? Because AFAICT that hardwiredly reports 12.13 / 13.6 as the abi_version, and that's what sip-build later uses to check whether deprecation messages can be used. That's why sip-build complains about 12.16 and 13.9 being required although they are installed. |
PyQt-builder default version has been fixed: Python-PyQt/PyQt-builder#25 But your PR should resolve the setting of the minum required ABI version. So the only remaining problem here is that SIP module shipped in PyQt and used by QGIS has not been updated (still 13.8 while we need 1.9). My understanding is that PyQt-builder/PyQt-sip and SIP minor version must be consistent in fedora packages. |
On 23/12/2024 16:10, Jürgen Fischer wrote:
> That's why it's not enough to rely on the sip version, it might be
> foolproof to rely on the ABI version.
Is pyqtbuild not used on fedora? Because AFAICT that hardwiredly
reports 12.13 / 13.6 as the abi_version, and that's what sip-build
later use to check if deprecation messages can be used. That's why
sip-build complains about about 12.16 and 13.6 being required although
they are installed.
The ABI versions in pyqtbuild are just sensible defaults which will
normally be the versions supported by the version of SIP at the time. If
a new version of SIP supports a later ABI then I don't release a new
version of pyqtbuild just for that.
If a project has a requirement for a minimum ABI then it should specify
that in its pyproject.toml.
While any particular version of SIP will generate a particular ABI I
don't think you can assume that that is the ABI available. If a distro
updates its version of SIP I wouldn't expect it to update all its sip
modules at the same time. If your project wants to support multiple ABIs
then it must be told what to use.
Changes I could make if they might be useful...
- include the module ABI as an attribute of the sip module (like
SIP_VERSION)
- add an --abi-version command line option to the build tools (sip-build
etc) to override the value in pyproject.toml
- add a pseudo-timeline for the ABI version (similar to the one for
SIP).
|
IIUC Phils config of so it might be useful to directly rely on the ABI version |
Yes, but here it depends. At compile time, If it's 13.9 or greater we enable /deprecated with message, else we disable them. So we are able to build on several different platform. but how can we do that ?
Yes, that would help certainly in such situation. I don't see how we can manage to fix here without this (except by having PyQt-sip and SIP minor version aligned in fedora) |
@philthompson10 these would be great additions, especially the first would help here a lot 🎁 🎄 If it's soon available to query the ABI version, QGIS may rely directly on this information and adapt it's sources accordingly to get the build passing 😃 While this may not catch all the recent cases, this brings an easy and solid fix. |
On 24/12/2024 07:00, t0b3 wrote:
> Changes I could make if they might be useful...
> - include the module ABI as an attribute of the sip module (like
> SIP_VERSION)
> - add an --abi-version command line option to the build tools
> (sip-build
> etc) to override the value in pyproject.toml
> - add a pseudo-timeline for the ABI version (similar to the one for
> SIP).
@philthompson10 these would be great additions, especially the first
would help here a lot 🎁 🎄
If it's soon available to query the ABI version, QGIS may rely
directly on this information and adapt it's sources accordingly to get
the build passing 😃 While this may not catch all the recent
cases, this brings an easy and solid fix.
See...
Python-SIP/sip#62
|
get build running for sip ABI < 13.9 with sip >= 6.9. addresses qgis#59995 (comment)
get build running for sip ABI < 13.9 with sip >= 6.9. addresses qgis#59995 (comment)
On 23/12/2024 16:50, t0b3 wrote:
IIUC Phils config of `abi-version` has the meaning of ***minimum***
required abi version.
see also his answer here
https://www.riverbankcomputing.com/pipermail/pyqt/2021-May/043919.html
so it might be useful to directly rely on the ABI version
This has caused me to rethink the whole thing, see these if you are
interested...
Python-SIP/sip#61
Python-SIP/sip#62
Python-SIP/sip#63
Python-SIP/sip#64
Python-SIP/sip#65
Comments welcome of course.
|
@jef-n while this PR resolves the build issues through enforcing sip-abi to match sip and ignoring maybe lower PyQt-sip ABI. unfortunately this introduces runtime issues in case of PyQt-sip ABI lower than sip ABI, i.e. PyQt6-sip ABI 13.8 and sip ABI 13.9. This case occurs in fedora 41 and debian sid, it also can be reproduced in gentoo. import qgis._gui
RuntimeError: the sip module implements ABI v13.0 to v13.8 but qgis._gui module requires ABI v13.9 |
On 27/12/2024 17:03, Phil Thompson wrote:
On 23/12/2024 16:50, t0b3 wrote:
> IIUC Phils config of `abi-version` has the meaning of ***minimum***
> required abi version.
> see also his answer here
> https://www.riverbankcomputing.com/pipermail/pyqt/2021-May/043919.html
>
> so it might be useful to directly rely on the ABI version
This has caused me to rethink the whole thing, see these if you are
interested...
Python-SIP/sip#61
Python-SIP/sip#62
Python-SIP/sip#63
Python-SIP/sip#64
Python-SIP/sip#65
Comments welcome of course.
These have now been implemented in the develop branch and will be in SIP
v6.10 (no release date at the moment).
A consequence of the %MinimumABIVersion directive implementation is that
deprecation strings are now just ignored (rather than causing an error)
when using an ABI version that doesn't support them.
|
The build on debian sid is currently broken, because it has sip 6.9.1, hence uses the deprecation messages for sip, which also requires a minimal sip abi of 12.16 / 13.9.
But sip-build defaults to 12.13 / 13.6 from pyqtbuild:
https://github.com/Python-PyQt/PyQt-builder/blob/82162b4966d94054733ff9aa53f4ef4ec63d2222/pyqtbuild/builder.py#L137-L144
although it requires 12.16 / 13.9 for deprecation messages:
https://github.com/Python-SIP/sip/blob/a619d79626cfff6678d194c7dd8d0d948bb644c0/sipbuild/generator/utils.py#L496-L499
The patch adds the required abi-version to the
pyproject.toml
s.