Bug 415743 - FindSIP.py fails to find sip starting from version 5
Summary: FindSIP.py fails to find sip starting from version 5
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: General (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: amyspark
URL: https://invent.kde.org/graphics/krita...
Keywords:
Depends on:
Blocks:
 
Reported: 2019-12-31 12:57 UTC by rondonumbanine
Modified: 2021-08-03 08:35 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description rondonumbanine 2019-12-31 12:57:00 UTC
It seems that the sipconfig module was removed starting from sip 5.
This makes the FindSIP.py script fail since it tries to import it.


STEPS TO REPRODUCE
1. pip install sip
2. Run the cmake command from the docs:
cmake ../krita \
        -DCMAKE_INSTALL_PREFIX=$HOME/kritadev/install  \
        -DCMAKE_BUILD_TYPE=Debug \
        -DKRITA_DEVS=ON 

OBSERVED RESULT

Traceback (most recent call last):
  File "/home/user/kritadev/krita/cmake/modules/FindSIP.py", line 8, in <module>
    import sipconfig
ModuleNotFoundError: No module named 'sipconfig'

and then later

-- The following OPTIONAL packages have not been found:

 * SIP (required version >= 4.19.13), Support for generating SIP Python bindings, <https://www.riverbankcomputing.com/software/sip/download>
   Required by the Krita PyQt plugin
Comment 1 Halla Rempt 2019-12-31 13:32:53 UTC
We'll only update to a newer version of sip when we're updating to Qt 5.14, which should happen some time this month. Until then, please use sip 4.19.
Comment 3 Antonio Rojas 2020-01-16 12:41:16 UTC
Note that the patch is only to make krita compatible with PyQt5 when the latter has been compiled with sip 5. It does *not* add support for compiling krita itself with sip 5. Luckily, sip 4 and sip 5 are coinstallable (for now).
Comment 4 wolthera 2020-04-24 12:58:28 UTC
Is this still relevant? We've been poking at python and the build system a lot, so maybe it changed?
Comment 5 Bug Janitor Service 2020-05-09 04:33:13 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 6 Antonio Rojas 2020-05-09 07:16:21 UTC
Yes, nothing has changed with respect to this. SIP 5 support requires major porting
Comment 7 Halla Rempt 2020-05-09 08:46:37 UTC
Yes... And since Qt 5.14 turned out to be a big heap of smelly poo, we won't be updating our build system to that any time soon. I'm so sick and tired of having to port, port, port and never see any improvement in return :-(
Comment 8 amyspark 2021-04-01 16:17:01 UTC
Additionally to the porting to SIPv5 itself, we need to move to MSVC first because of the setuptools based toolchain that it now uses.

Please see https://invent.kde.org/graphics/krita/-/merge_requests/776 for progress on that front.
Comment 9 amyspark 2021-06-01 20:34:18 UTC
Assigning to myself, MR in progress in the attached URL.
Comment 10 amyspark 2021-06-15 14:10:07 UTC
Git commit 5bb4874ad04b771a0fec12827de748780b5b395b by L. E. Segovia.
Committed on 23/05/2021 at 02:34.
Pushed by lsegovia into branch 'master'.

Add support for SIP v5 bindings

SIP v5 and above rely on a PEP-0518 based tooling system to build
bindings (usually distutils). v4, as our currently supported generator,
is only a dummy tool -- it relies on the user to compile and link the
bindings.

This commit adds support for SIP v5.

- I've added a "sip-generate" tool, that differs from the standard
sip-build in that it only generates the binding glue; this relies on a
private, undocumented method of the sipbuild.Builder class.

- The cmake/modules directory now has a pyproject.toml skeleton
manifest, which is processed by the new add_sip_python_module_v5 macro.
It works identically to the v4 macro, but targets the sip-generate tool.
Compilation happens in the exact same was as we do with v4.

Key remarks:

- All the data must be now injected in the skeleton manifest (as opposed
to build flags in v4).
- SIP v5 makes use of protected Qt methods; for this reason, it supplies
a "protected-as-public" override, which I emulate in the
add_sip_python_module_v5 macro.
- Like v4, v5 also needs to be told the fully qualified name of the SIP
package (e.g. `import PyQt5.sip` -- PyQt5.sip is the value). Otherwise,
the native library will not find the package and the initialization will
fail.
- The initialization function changes, from "PyInit_pykrita" to
"PyInit_krita" (the innermost module name). This has been macro'd for
backwards compatibility.

CCMAIL: kimageshop@kde.org

M  +5    -0    cmake/modules/FindPyQt5.cmake
M  +5    -0    cmake/modules/FindPyQt5.py
M  +3    -3    cmake/modules/FindSIP.cmake
M  +7    -4    cmake/modules/FindSIP.py
M  +103  -6    cmake/modules/SIPMacros.cmake
A  +15   -0    cmake/modules/pyproject.toml.in
A  +24   -0    cmake/modules/sip-generate.py
M  +2    -3    plugins/extensions/pykrita/plugin/PykritaModule.cpp
M  +9    -1    plugins/extensions/pykrita/plugin/PykritaModule.h
M  +3    -0    plugins/extensions/pykrita/plugin/config.h.cmake
M  +3    -2    plugins/extensions/pykrita/plugin/utilities.cpp
M  +33   -25   plugins/extensions/pykrita/sip/CMakeLists.txt

https://invent.kde.org/graphics/krita/commit/5bb4874ad04b771a0fec12827de748780b5b395b
Comment 11 Dmitry Kazakov 2021-08-03 08:35:56 UTC
Git commit b263b56680f575a51bc9b6d9bb47070f3c1532f1 by Dmitry Kazakov, on behalf of L. E. Segovia.
Committed on 03/08/2021 at 08:35.
Pushed by dkazakov into branch 'krita/4.3'.

Add support for SIP v5 bindings

SIP v5 and above rely on a PEP-0518 based tooling system to build
bindings (usually distutils). v4, as our currently supported generator,
is only a dummy tool -- it relies on the user to compile and link the
bindings.

This commit adds support for SIP v5.

- I've added a "sip-generate" tool, that differs from the standard
sip-build in that it only generates the binding glue; this relies on a
private, undocumented method of the sipbuild.Builder class.

- The cmake/modules directory now has a pyproject.toml skeleton
manifest, which is processed by the new add_sip_python_module_v5 macro.
It works identically to the v4 macro, but targets the sip-generate tool.
Compilation happens in the exact same was as we do with v4.

Key remarks:

- All the data must be now injected in the skeleton manifest (as opposed
to build flags in v4).
- SIP v5 makes use of protected Qt methods; for this reason, it supplies
a "protected-as-public" override, which I emulate in the
add_sip_python_module_v5 macro.
- Like v4, v5 also needs to be told the fully qualified name of the SIP
package (e.g. `import PyQt5.sip` -- PyQt5.sip is the value). Otherwise,
the native library will not find the package and the initialization will
fail.
- The initialization function changes, from "PyInit_pykrita" to
"PyInit_krita" (the innermost module name). This has been macro'd for
backwards compatibility.

CCMAIL: kimageshop@kde.org
(cherry picked from commit 5bb4874ad04b771a0fec12827de748780b5b395b)

M  +8    -3    cmake/modules/FindPyQt5.cmake
M  +9    -3    cmake/modules/FindPyQt5.py
M  +3    -3    cmake/modules/FindSIP.cmake
M  +42   -12   cmake/modules/FindSIP.py
M  +103  -6    cmake/modules/SIPMacros.cmake
A  +15   -0    cmake/modules/pyproject.toml.in
A  +24   -0    cmake/modules/sip-generate.py
M  +5    -6    plugins/extensions/pykrita/plugin/PykritaModule.cpp
M  +11   -3    plugins/extensions/pykrita/plugin/PykritaModule.h
M  +4    -1    plugins/extensions/pykrita/plugin/config.h.cmake
M  +5    -4    plugins/extensions/pykrita/plugin/utilities.cpp
M  +33   -25   plugins/extensions/pykrita/sip/CMakeLists.txt

https://invent.kde.org/graphics/krita/commit/b263b56680f575a51bc9b6d9bb47070f3c1532f1