All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/2] python-sip: fix compile error
@ 2023-12-12 16:01 Ralf Dragon
  2023-12-12 16:01 ` [Buildroot] [PATCH 2/2] python-qt5: add PyQt5.sip module Ralf Dragon
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Ralf Dragon @ 2023-12-12 16:01 UTC (permalink / raw)
  To: buildroot; +Cc: Ralf Dragon, gwenhael.goavec-merou, yann.morin.1998, asafka7

Without the patch, python-sip fails to compile with:

siplib.c: In function ‘sip_api_get_frame’:
siplib.c:13750:22: error: invalid use of undefined type ‘struct _frame’
13750 |         frame = frame->f_back;

This likely fixes bug 15201 [1].



[1] https://bugs.buildroot.org/show_bug.cgi?id=15201


Signed-off-by: Ralf Dragon <hypnotoad@lindra.de>
---
Backport to: 2023.02.x

 package/python-sip/0002-fixframe.patch | 55 ++++++++++++++++++++++++++
 1 file changed, 55 insertions(+)
 create mode 100644 package/python-sip/0002-fixframe.patch

diff --git a/package/python-sip/0002-fixframe.patch b/package/python-sip/0002-fixframe.patch
new file mode 100644
index 0000000000..befe76fc73
--- /dev/null
+++ b/package/python-sip/0002-fixframe.patch
@@ -0,0 +1,55 @@
+siplib: fix build with python >= 3.11
+
+With python 3.11, the PyFrameObject structure members have been
+removed from the public C API:
+
+https://docs.python.org/3.11/whatsnew/3.11.html#whatsnew311-c-api-porting
+https://docs.python.org/3.11/whatsnew/3.11.html#pyframeobject-3-11-hiding
+
+This patch migrates to the opaque PyFrameObject.
+
+Signed-off-by: Ralf Dragon <hypnotoad@lindra.de>
+Upstream: N/A as SIP v4 is no longer supported. 4.19.25 is the last release.
+
+--- host-python-sip-4.19.25.orig/siplib/sip.h
++++ host-python-sip-4.19.25/siplib/sip.h
+@@ -1799,7 +1799,7 @@
+     int (*api_get_time)(PyObject *, sipTimeDef *);
+     PyObject *(*api_from_time)(const sipTimeDef *);
+     int (*api_is_user_type)(const sipWrapperType *);
+-    struct _frame *(*api_get_frame)(int);
++    PyFrameObject *(*api_get_frame)(int);
+     int (*api_check_plugin_for_type)(const sipTypeDef *, const char *);
+     PyObject *(*api_unicode_new)(SIP_SSIZE_T, unsigned, int *, void **);
+     void (*api_unicode_write)(int, void *, int, unsigned);
+
+
+--- host-python-sip-4.19.25.orig/siplib/siplib.c
++++ host-python-sip-4.19.25/siplib/siplib.c
+@@ -448,7 +448,7 @@
+ static int sip_api_get_time(PyObject *obj, sipTimeDef *time);
+ static PyObject *sip_api_from_time(const sipTimeDef *time);
+ static int sip_api_is_user_type(const sipWrapperType *wt);
+-static struct _frame *sip_api_get_frame(int);
++static PyFrameObject *sip_api_get_frame(int);
+ static int sip_api_check_plugin_for_type(const sipTypeDef *td,
+         const char *name);
+ static PyObject *sip_api_unicode_new(SIP_SSIZE_T len, unsigned maxchar,
+@@ -13741,13 +13741,13 @@
+ /*
+  * Return a frame from the execution stack.
+  */
+-static struct _frame *sip_api_get_frame(int depth)
++static PyFrameObject *sip_api_get_frame(int depth)
+ {
+-    struct _frame *frame = PyEval_GetFrame();
++    PyFrameObject *frame = PyEval_GetFrame();
+ 
+     while (frame != NULL && depth > 0)
+     {
+-        frame = frame->f_back;
++        frame = PyFrame_GetBack(frame);
+         --depth;
+     }
+ 
+
-- 
2.39.2

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [Buildroot] [PATCH 2/2] python-qt5: add PyQt5.sip module
  2023-12-12 16:01 [Buildroot] [PATCH 1/2] python-sip: fix compile error Ralf Dragon
@ 2023-12-12 16:01 ` Ralf Dragon
  2023-12-17 22:07   ` Thomas Petazzoni via buildroot
  2024-03-10 13:25   ` Julien Olivain
  2023-12-17 22:03 ` [Buildroot] [PATCH 1/2] python-sip: fix compile error Thomas Petazzoni via buildroot
  2024-01-05 12:41 ` Peter Korsgaard
  2 siblings, 2 replies; 13+ messages in thread
From: Ralf Dragon @ 2023-12-12 16:01 UTC (permalink / raw)
  To: buildroot; +Cc: Ralf Dragon, gwenhael.goavec-merou, yann.morin.1998, asafka7

This fixes the following runtime error when importing PyQt5 in python:

from PyQt5.QtCore import *
ModuleNotFoundError: No module named 'PyQt5.sip'

Signed-off-by: Ralf Dragon <hypnotoad@lindra.de>
---
Backport to: 2023.02.x

 package/Config.in                              |  1 +
 package/python-pyqt5-sip/Config.in             |  6 ++++++
 package/python-pyqt5-sip/python-pyqt5-sip.hash |  4 ++++
 package/python-pyqt5-sip/python-pyqt5-sip.mk   | 15 +++++++++++++++
 package/python-pyqt5/Config.in                 |  1 +
 5 files changed, 27 insertions(+)
 create mode 100644 package/python-pyqt5-sip/Config.in
 create mode 100644 package/python-pyqt5-sip/python-pyqt5-sip.hash
 create mode 100644 package/python-pyqt5-sip/python-pyqt5-sip.mk

diff --git a/package/Config.in b/package/Config.in
index fcc09b07c4..2d6a077d16 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -1253,6 +1253,7 @@ menu "External python modules"
 	source "package/python-pyphen/Config.in"
 	source "package/python-pyqrcode/Config.in"
 	source "package/python-pyqt5/Config.in"
+	source "package/python-pyqt5-sip/Config.in"
 	source "package/python-pyratemp/Config.in"
 	source "package/python-pyroute2/Config.in"
 	source "package/python-pyrsistent/Config.in"
diff --git a/package/python-pyqt5-sip/Config.in b/package/python-pyqt5-sip/Config.in
new file mode 100644
index 0000000000..6f26271f70
--- /dev/null
+++ b/package/python-pyqt5-sip/Config.in
@@ -0,0 +1,6 @@
+config BR2_PACKAGE_PYTHON_PYQT5_SIP
+	bool "python-pyqt5-sip"
+	depends on BR2_PACKAGE_PYTHON_PYQT5
+	depends on BR2_PACKAGE_PYTHON_SIP
+	help
+	  This is the PyQt5.sip module which is needed to run PyQt5.
diff --git a/package/python-pyqt5-sip/python-pyqt5-sip.hash b/package/python-pyqt5-sip/python-pyqt5-sip.hash
new file mode 100644
index 0000000000..8039cdafd9
--- /dev/null
+++ b/package/python-pyqt5-sip/python-pyqt5-sip.hash
@@ -0,0 +1,4 @@
+# from https://pypi.org/project/PyQt5-sip/12.12.1
+
+sha256  8fdc6e0148abd12d977a1d3828e7b79aae958e83c6cb5adae614916d888a6b10  PyQt5_sip-12.12.1.tar.gz
+md5  c2117da3b4c0e081c1c5a9088b8a4d55  PyQt5_sip-12.12.1.tar.gz
diff --git a/package/python-pyqt5-sip/python-pyqt5-sip.mk b/package/python-pyqt5-sip/python-pyqt5-sip.mk
new file mode 100644
index 0000000000..3f689b9d47
--- /dev/null
+++ b/package/python-pyqt5-sip/python-pyqt5-sip.mk
@@ -0,0 +1,15 @@
+################################################################################
+#
+# python-SIP-QT5
+#
+################################################################################
+
+PYTHON_PYQT5_SIP_VERSION = 12.12.1
+PYTHON_PYQT5_SIP_SITE = https://files.pythonhosted.org/packages/c1/61/4055e7a0f36339964956ff415e36f4abf82561904cc49c021da32949fc55
+PYTHON_PYQT5_SIP_SOURCE = PyQt5_sip-$(PYTHON_PYQT5_SIP_VERSION).tar.gz
+PYTHON_PYQT5_SIP_LICENSE = MIT
+PYTHON_PYQT5_SIP_LICENSE_FILES = LICENSE
+PYTHON_PYQT5_SIP_SETUP_TYPE = setuptools
+PYTHON_PYQT5_SIP_DEPENDENCIES += python-sip
+
+$(eval $(python-package))
diff --git a/package/python-pyqt5/Config.in b/package/python-pyqt5/Config.in
index 9fa7676f98..c2a1976950 100644
--- a/package/python-pyqt5/Config.in
+++ b/package/python-pyqt5/Config.in
@@ -5,6 +5,7 @@ config BR2_PACKAGE_PYTHON_PYQT5
 	bool "python-pyqt5"
 	depends on BR2_PACKAGE_QT5
 	select BR2_PACKAGE_PYTHON_SIP
+	select BR2_PACKAGE_PYTHON_PYQT5_SIP
 	select BR2_PACKAGE_QT5BASE_GUI
 	help
 	  Python bindings for Qt 5
-- 
2.39.2

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [Buildroot] [PATCH 1/2] python-sip: fix compile error
  2023-12-12 16:01 [Buildroot] [PATCH 1/2] python-sip: fix compile error Ralf Dragon
  2023-12-12 16:01 ` [Buildroot] [PATCH 2/2] python-qt5: add PyQt5.sip module Ralf Dragon
@ 2023-12-17 22:03 ` Thomas Petazzoni via buildroot
  2024-01-05 12:41 ` Peter Korsgaard
  2 siblings, 0 replies; 13+ messages in thread
From: Thomas Petazzoni via buildroot @ 2023-12-17 22:03 UTC (permalink / raw)
  To: Ralf Dragon; +Cc: gwenhael.goavec-merou, yann.morin.1998, asafka7, buildroot

Hello Ralf,

Thanks for the patch! I have applied it, with some changes, see below.

On Tue, 12 Dec 2023 17:01:11 +0100
Ralf Dragon <hypnotoad@lindra.de> wrote:

> Without the patch, python-sip fails to compile with:
> 
> siplib.c: In function ‘sip_api_get_frame’:
> siplib.c:13750:22: error: invalid use of undefined type ‘struct _frame’
> 13750 |         frame = frame->f_back;
> 
> This likely fixes bug 15201 [1].
> 
> [1] https://bugs.buildroot.org/show_bug.cgi?id=15201

I am not sure it fixes this bug. This bug is more about upgrading
python-sip, which indeed would be very nice to do as SIP 4.x is no
longer maintained, as you pointed out.

However, your patch fixes
http://autobuild.buildroot.net/results/7b01739e7514e48c06182bc1804b32497ce2e414/
for sure, so I've used that in the commit log.

> diff --git a/package/python-sip/0002-fixframe.patch b/package/python-sip/0002-fixframe.patch
> new file mode 100644
> index 0000000000..befe76fc73
> --- /dev/null
> +++ b/package/python-sip/0002-fixframe.patch
> @@ -0,0 +1,55 @@
> +siplib: fix build with python >= 3.11
> +
> +With python 3.11, the PyFrameObject structure members have been
> +removed from the public C API:
> +
> +https://docs.python.org/3.11/whatsnew/3.11.html#whatsnew311-c-api-porting
> +https://docs.python.org/3.11/whatsnew/3.11.html#pyframeobject-3-11-hiding
> +
> +This patch migrates to the opaque PyFrameObject.
> +
> +Signed-off-by: Ralf Dragon <hypnotoad@lindra.de>
> +Upstream: N/A as SIP v4 is no longer supported. 4.19.25 is the last release.

I reformatted this patch using "git format-patch" to be like patch
0001. I also slightly improved the commit log.

See the final commit:

  https://gitlab.com/buildroot.org/buildroot/-/commit/3ef6884e6d59744d83649170822a4829eed146fc

Thanks a lot!

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [Buildroot] [PATCH 2/2] python-qt5: add PyQt5.sip module
  2023-12-12 16:01 ` [Buildroot] [PATCH 2/2] python-qt5: add PyQt5.sip module Ralf Dragon
@ 2023-12-17 22:07   ` Thomas Petazzoni via buildroot
  2023-12-18 18:22     ` Ralf Dragon
                       ` (2 more replies)
  2024-03-10 13:25   ` Julien Olivain
  1 sibling, 3 replies; 13+ messages in thread
From: Thomas Petazzoni via buildroot @ 2023-12-17 22:07 UTC (permalink / raw)
  To: Ralf Dragon
  Cc: Julien Olivain, gwenhael.goavec-merou, yann.morin.1998, asafka7,
	buildroot

Hello Ralf,

On Tue, 12 Dec 2023 17:01:12 +0100
Ralf Dragon <hypnotoad@lindra.de> wrote:

> This fixes the following runtime error when importing PyQt5 in python:
> 
> from PyQt5.QtCore import *
> ModuleNotFoundError: No module named 'PyQt5.sip'

So it means that python-pyqt5 requires this new python-pyqt5-sip
package? How come has python-pyqt5 ever worked?

> diff --git a/package/python-pyqt5-sip/Config.in b/package/python-pyqt5-sip/Config.in
> new file mode 100644
> index 0000000000..6f26271f70
> --- /dev/null
> +++ b/package/python-pyqt5-sip/Config.in
> @@ -0,0 +1,6 @@
> +config BR2_PACKAGE_PYTHON_PYQT5_SIP
> +	bool "python-pyqt5-sip"
> +	depends on BR2_PACKAGE_PYTHON_PYQT5
> +	depends on BR2_PACKAGE_PYTHON_SIP

But, but, according to what you described above, it seems like
python-pyqt5 needs python-pyqt5-sip, but here you have a
python-pyqt5-sip -> python-pyqt5 dependency.

So with your patch applied, it's still possible to enable only
python-pyqt5, so we would still have the failure you're mentioning in
your commit log.

Could you clarify?

Also, it would very, very good to add a runtime test case in
support/testing/ for this, as such Python issues are only visible at
runtime. I have added Julien Olivain in Cc, who can probably help with
this, as he is our resident expert in writing support/testing tests :-)

> diff --git a/package/python-pyqt5-sip/python-pyqt5-sip.hash b/package/python-pyqt5-sip/python-pyqt5-sip.hash
> new file mode 100644
> index 0000000000..8039cdafd9
> --- /dev/null
> +++ b/package/python-pyqt5-sip/python-pyqt5-sip.hash
> @@ -0,0 +1,4 @@
> +# from https://pypi.org/project/PyQt5-sip/12.12.1
> +

Empty line not needed.

> +sha256  8fdc6e0148abd12d977a1d3828e7b79aae958e83c6cb5adae614916d888a6b10  PyQt5_sip-12.12.1.tar.gz
> +md5  c2117da3b4c0e081c1c5a9088b8a4d55  PyQt5_sip-12.12.1.tar.gz
> diff --git a/package/python-pyqt5-sip/python-pyqt5-sip.mk b/package/python-pyqt5-sip/python-pyqt5-sip.mk
> new file mode 100644
> index 0000000000..3f689b9d47
> --- /dev/null
> +++ b/package/python-pyqt5-sip/python-pyqt5-sip.mk
> @@ -0,0 +1,15 @@
> +################################################################################
> +#
> +# python-SIP-QT5

Should be all lower-case.

> +#
> +################################################################################
> +
> +PYTHON_PYQT5_SIP_VERSION = 12.12.1
> +PYTHON_PYQT5_SIP_SITE = https://files.pythonhosted.org/packages/c1/61/4055e7a0f36339964956ff415e36f4abf82561904cc49c021da32949fc55
> +PYTHON_PYQT5_SIP_SOURCE = PyQt5_sip-$(PYTHON_PYQT5_SIP_VERSION).tar.gz
> +PYTHON_PYQT5_SIP_LICENSE = MIT
> +PYTHON_PYQT5_SIP_LICENSE_FILES = LICENSE
> +PYTHON_PYQT5_SIP_SETUP_TYPE = setuptools
> +PYTHON_PYQT5_SIP_DEPENDENCIES += python-sip

No +=, just =.

> +
> +$(eval $(python-package))
> diff --git a/package/python-pyqt5/Config.in b/package/python-pyqt5/Config.in
> index 9fa7676f98..c2a1976950 100644
> --- a/package/python-pyqt5/Config.in
> +++ b/package/python-pyqt5/Config.in
> @@ -5,6 +5,7 @@ config BR2_PACKAGE_PYTHON_PYQT5
>  	bool "python-pyqt5"
>  	depends on BR2_PACKAGE_QT5
>  	select BR2_PACKAGE_PYTHON_SIP
> +	select BR2_PACKAGE_PYTHON_PYQT5_SIP

Ah, so python-pyqt5 now selects python-pyqt5-sip, and python-pyqt5-sip
also selects python-pyqt5. This sounds like a circular dependency.

Could you perhaps give a bit more background, so that we can provide
some better guidance on how to resolve this issue properly?

Thanks a lot!

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [Buildroot] [PATCH 2/2] python-qt5: add PyQt5.sip module
  2023-12-17 22:07   ` Thomas Petazzoni via buildroot
@ 2023-12-18 18:22     ` Ralf Dragon
  2023-12-18 19:51       ` Thomas Petazzoni via buildroot
  2023-12-18 18:58     ` Ralf Dragon
  2024-01-10 19:21     ` Julien Olivain
  2 siblings, 1 reply; 13+ messages in thread
From: Ralf Dragon @ 2023-12-18 18:22 UTC (permalink / raw)
  To: Thomas Petazzoni
  Cc: Julien Olivain, gwenhael.goavec-merou, yann.morin.1998, asafka7,
	buildroot


[-- Attachment #1.1: Type: text/plain, Size: 2146 bytes --]

Hello Thomas,

> So it means that python-pyqt5 requires this new python-pyqt5-sip
> package? How come has python-pyqt5 ever worked?

It worked for our community firmware [1] in a buildroot release from 1-2 
years ago. When we switched to the 2023 release, we had problems, but I 
could not imagine that it was a problem for everyone. I think that 5.11 
changed the location of the sip module to PyQt5.sip [2] and required 
building that in a new module (the build instructions [3] do not say 
since which release that was needed):

[1] https://cfw.ftcommunity.de/ftcommunity-TXT/en
[2] 
https://www.riverbankcomputing.com/static/Docs/PyQt5/incompatibilities.html#pyqt-v5-11
[3] 
https://www.riverbankcomputing.com/static/Docs/PyQt5/installation.html#building-the-sip-module

> But, but, according to what you described above, it seems like
> python-pyqt5 needs python-pyqt5-sip, but here you have a
> python-pyqt5-sip -> python-pyqt5 dependency.
> So with your patch applied, it's still possible to enable only
> python-pyqt5, so we would still have the failure you're mentioning in
> your commit log.
>
> Could you clarify?

Both can be compiled independently (when I wrote the patch, I assumed 
that PyQt5.sip can only be compiled when PyQt5 is available, but it 
really seems only to depend on the sip library). During runtime, PyQt5 
does not work without PyQt5.sip, but it seems that PyQt5.sip can be used 
without PyQt5. That is also how it is modeled in Debian 12.

So correctly it would be: python-pyqt5 needs python-pyqt5-sip during 
runtime. I would model that with "select", not "depends on", or?

> Also, it would very, very good to add a runtime test case in
> support/testing/ for this, as such Python issues are only visible at
> runtime. I have added Julien Olivain in Cc, who can probably help with
> this, as he is our resident expert in writing support/testing tests :-)

Just python3 -c "import PyQt5" would probably be enough to reproduce 
this error.

I will push another patch with the dependency clarified and the other 
comments.

Is it possible that both patches get integrated into the 2023 lts branch?

Thanks,

Ralf


[-- Attachment #1.2: Type: text/html, Size: 3896 bytes --]

[-- Attachment #2: Type: text/plain, Size: 150 bytes --]

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [Buildroot] [PATCH 2/2] python-qt5: add PyQt5.sip module
  2023-12-17 22:07   ` Thomas Petazzoni via buildroot
  2023-12-18 18:22     ` Ralf Dragon
@ 2023-12-18 18:58     ` Ralf Dragon
  2024-01-10 19:21     ` Julien Olivain
  2 siblings, 0 replies; 13+ messages in thread
From: Ralf Dragon @ 2023-12-18 18:58 UTC (permalink / raw)
  To: Thomas Petazzoni
  Cc: Julien Olivain, gwenhael.goavec-merou, yann.morin.1998, asafka7,
	buildroot

[-- Attachment #1: Type: text/plain, Size: 64 bytes --]

Dear Thomas,

attached is an updated clean patch.

Best,

Ralf


[-- Attachment #2: 0002-python-qt5-add-PyQt5.sip-module.patch --]
[-- Type: text/x-patch, Size: 3553 bytes --]

From 9ec3b38b1e1f0f06c0561adbb48aa7e106d36975 Mon Sep 17 00:00:00 2001
From: Ralf Dragon <hypnotoad@lindra.de>
Date: Thu, 23 Nov 2023 18:23:59 +0100
Subject: [PATCH 2/2] python-qt5: add PyQt5.sip module

This fixes the following runtime error when importing PyQt5 in python:

from PyQt5.QtCore import *
ModuleNotFoundError: No module named 'PyQt5.sip'

Signed-off-by: Ralf Dragon <hypnotoad@lindra.de>
---
 package/Config.in                              |  1 +
 package/python-pyqt5-sip/Config.in             |  5 +++++
 package/python-pyqt5-sip/python-pyqt5-sip.hash |  3 +++
 package/python-pyqt5-sip/python-pyqt5-sip.mk   | 15 +++++++++++++++
 package/python-pyqt5/Config.in                 |  1 +
 5 files changed, 25 insertions(+)
 create mode 100644 package/python-pyqt5-sip/Config.in
 create mode 100644 package/python-pyqt5-sip/python-pyqt5-sip.hash
 create mode 100644 package/python-pyqt5-sip/python-pyqt5-sip.mk

diff --git a/package/Config.in b/package/Config.in
index fcc09b07c4..2d6a077d16 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -1253,6 +1253,7 @@ menu "External python modules"
 	source "package/python-pyphen/Config.in"
 	source "package/python-pyqrcode/Config.in"
 	source "package/python-pyqt5/Config.in"
+	source "package/python-pyqt5-sip/Config.in"
 	source "package/python-pyratemp/Config.in"
 	source "package/python-pyroute2/Config.in"
 	source "package/python-pyrsistent/Config.in"
diff --git a/package/python-pyqt5-sip/Config.in b/package/python-pyqt5-sip/Config.in
new file mode 100644
index 0000000000..1e58818a1e
--- /dev/null
+++ b/package/python-pyqt5-sip/Config.in
@@ -0,0 +1,5 @@
+config BR2_PACKAGE_PYTHON_PYQT5_SIP
+	bool "python-pyqt5-sip"
+	depends on BR2_PACKAGE_PYTHON_SIP
+	help
+	  This is the PyQt5.sip module which is needed to run PyQt5.
diff --git a/package/python-pyqt5-sip/python-pyqt5-sip.hash b/package/python-pyqt5-sip/python-pyqt5-sip.hash
new file mode 100644
index 0000000000..a55c74ed8f
--- /dev/null
+++ b/package/python-pyqt5-sip/python-pyqt5-sip.hash
@@ -0,0 +1,3 @@
+# from https://pypi.org/project/PyQt5-sip/12.12.1
+sha256  8fdc6e0148abd12d977a1d3828e7b79aae958e83c6cb5adae614916d888a6b10  PyQt5_sip-12.12.1.tar.gz
+md5  c2117da3b4c0e081c1c5a9088b8a4d55  PyQt5_sip-12.12.1.tar.gz
diff --git a/package/python-pyqt5-sip/python-pyqt5-sip.mk b/package/python-pyqt5-sip/python-pyqt5-sip.mk
new file mode 100644
index 0000000000..f2d50c2e03
--- /dev/null
+++ b/package/python-pyqt5-sip/python-pyqt5-sip.mk
@@ -0,0 +1,15 @@
+################################################################################
+#
+# python-pyqt5-sip
+#
+################################################################################
+
+PYTHON_PYQT5_SIP_VERSION = 12.12.1
+PYTHON_PYQT5_SIP_SITE = https://files.pythonhosted.org/packages/c1/61/4055e7a0f36339964956ff415e36f4abf82561904cc49c021da32949fc55
+PYTHON_PYQT5_SIP_SOURCE = PyQt5_sip-$(PYTHON_PYQT5_SIP_VERSION).tar.gz
+PYTHON_PYQT5_SIP_LICENSE = MIT
+PYTHON_PYQT5_SIP_LICENSE_FILES = LICENSE
+PYTHON_PYQT5_SIP_SETUP_TYPE = setuptools
+PYTHON_PYQT5_SIP_DEPENDENCIES = python-sip
+
+$(eval $(python-package))
diff --git a/package/python-pyqt5/Config.in b/package/python-pyqt5/Config.in
index 9fa7676f98..c2a1976950 100644
--- a/package/python-pyqt5/Config.in
+++ b/package/python-pyqt5/Config.in
@@ -5,6 +5,7 @@ config BR2_PACKAGE_PYTHON_PYQT5
 	bool "python-pyqt5"
 	depends on BR2_PACKAGE_QT5
 	select BR2_PACKAGE_PYTHON_SIP
+	select BR2_PACKAGE_PYTHON_PYQT5_SIP
 	select BR2_PACKAGE_QT5BASE_GUI
 	help
 	  Python bindings for Qt 5
-- 
2.39.2


[-- Attachment #3: Type: text/plain, Size: 150 bytes --]

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [Buildroot] [PATCH 2/2] python-qt5: add PyQt5.sip module
  2023-12-18 18:22     ` Ralf Dragon
@ 2023-12-18 19:51       ` Thomas Petazzoni via buildroot
       [not found]         ` <f329f198-4cb1-4e61-8e47-0653cab03893@lindra.de>
  0 siblings, 1 reply; 13+ messages in thread
From: Thomas Petazzoni via buildroot @ 2023-12-18 19:51 UTC (permalink / raw)
  To: Ralf Dragon
  Cc: Julien Olivain, gwenhael.goavec-merou, yann.morin.1998, asafka7,
	buildroot

Hello Ralf,

On Mon, 18 Dec 2023 19:22:14 +0100
Ralf Dragon <hypnotoad@lindra.de> wrote:

> > So it means that python-pyqt5 requires this new python-pyqt5-sip
> > package? How come has python-pyqt5 ever worked?  
> 
> It worked for our community firmware [1] in a buildroot release from 1-2 
> years ago. When we switched to the 2023 release, we had problems, but I 
> could not imagine that it was a problem for everyone. I think that 5.11 
> changed the location of the sip module to PyQt5.sip [2] and required 
> building that in a new module (the build instructions [3] do not say 
> since which release that was needed):
> 
> [1] https://cfw.ftcommunity.de/ftcommunity-TXT/en
> [2] 
> https://www.riverbankcomputing.com/static/Docs/PyQt5/incompatibilities.html#pyqt-v5-11
> [3] 
> https://www.riverbankcomputing.com/static/Docs/PyQt5/installation.html#building-the-sip-module

Thanks for the additional research. However, we need a bit better than
"I think". Indeed, we need to understand for sure since when things got
broken, so that we understand how this fix should be backported.

> > But, but, according to what you described above, it seems like
> > python-pyqt5 needs python-pyqt5-sip, but here you have a
> > python-pyqt5-sip -> python-pyqt5 dependency.
> > So with your patch applied, it's still possible to enable only
> > python-pyqt5, so we would still have the failure you're mentioning in
> > your commit log.
> >
> > Could you clarify?  
> 
> Both can be compiled independently (when I wrote the patch, I assumed 
> that PyQt5.sip can only be compiled when PyQt5 is available, but it 
> really seems only to depend on the sip library). During runtime, PyQt5 
> does not work without PyQt5.sip, but it seems that PyQt5.sip can be used 
> without PyQt5. That is also how it is modeled in Debian 12.
> 
> So correctly it would be: python-pyqt5 needs python-pyqt5-sip during 
> runtime. I would model that with "select", not "depends on", or?

python-pyqt5 should then "select BR2_PACKAGE_PYTHON_PYQT5_SIP" with a
"# runtime" comment, but it should not have python-pyqt5-sip in its
<pkg>_DEPENDENCIES.

> > Also, it would very, very good to add a runtime test case in
> > support/testing/ for this, as such Python issues are only visible at
> > runtime. I have added Julien Olivain in Cc, who can probably help with
> > this, as he is our resident expert in writing support/testing tests :-)  
> 
> Just python3 -c "import PyQt5" would probably be enough to reproduce 
> this error.

This would already be a good test case indeed.

> I will push another patch with the dependency clarified and the other 
> comments.
> 
> Is it possible that both patches get integrated into the 2023 lts branch?

Yes, if we understand when things got broken exactly, as discussed
above.

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [Buildroot] [PATCH 2/2] python-qt5: add PyQt5.sip module
       [not found]         ` <f329f198-4cb1-4e61-8e47-0653cab03893@lindra.de>
@ 2023-12-19 19:36           ` Ralf Dragon
  2024-01-02 21:48           ` Ralf Dragon
  1 sibling, 0 replies; 13+ messages in thread
From: Ralf Dragon @ 2023-12-19 19:36 UTC (permalink / raw)
  To: Thomas Petazzoni
  Cc: Julien Olivain, gwenhael.goavec-merou, yann.morin.1998, asafka7,
	buildroot


Hi Thomas,

 > Thanks for the additional research. However, we need a bit better than
 > "I think". Indeed, we need to understand for sure since when things got
 > broken, so that we understand how this fix should be backported.

PyQt 5.13 did not mention this module yet in their installation 
instructions [1], but for the sake of backporting it is apparently not 
needed to know when the incompatibility happened:

Not ok are: 2023.02.8, 2023.02.7 and 2023.02.3 (PyQt 5.15)
Ok is: 2021.11.3  (PyQt 5.7)

In between these, the only commit touching PyQt's hash is b36ce7e which 
does this PyQt upgrade in one step. So all LTS branches which have this 
commit are probably affected. (For completeness: 51c22b4ba905f8 and 
7e346f494c1507648f6 also touch the directory but they look both less 
suspicious.)

Unfortunately I don't have the setup to build and test these branches in 
an automated way. Maybe the author of the PyQt5 upgrade could clarify 
whether he used this PyQt5 in practice.

Best,
Ralf


[1] 
https://web.archive.org/web/20190717063706/https://www.riverbankcomputing.com/static/Docs/PyQt5/installation.html#building-the-sip-module
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [Buildroot] [PATCH 2/2] python-qt5: add PyQt5.sip module
       [not found]         ` <f329f198-4cb1-4e61-8e47-0653cab03893@lindra.de>
  2023-12-19 19:36           ` Ralf Dragon
@ 2024-01-02 21:48           ` Ralf Dragon
  1 sibling, 0 replies; 13+ messages in thread
From: Ralf Dragon @ 2024-01-02 21:48 UTC (permalink / raw)
  To: Thomas Petazzoni
  Cc: Julien Olivain, gwenhael.goavec-merou, yann.morin.1998, asafka7,
	buildroot

[-- Attachment #1: Type: text/plain, Size: 290 bytes --]

Hi Thomas,

here is an updated patch which reflects everything that we discussed. 
The new package has no dependency which looks quite particular in this 
part of the code base, but indeed it only depends on Python which is 
available for setuptools-based packets.

Thank you!

Best,
Ralf


[-- Attachment #2: 0001-python-pyqt5-sip-add-PyQt5.sip-module.patch --]
[-- Type: text/x-patch, Size: 4199 bytes --]

From 80685182d67a35056cc6fc72719fd74f5d1c32e8 Mon Sep 17 00:00:00 2001
From: Ralf Dragon <hypnotoad@lindra.de>
Date: Thu, 23 Nov 2023 18:23:59 +0100
Subject: [PATCH 1/1] python-pyqt5-sip: add PyQt5.sip module

This fixes the following runtime error when importing PyQt5 in python:

from PyQt5.QtCore import *
ModuleNotFoundError: No module named 'PyQt5.sip'

The official documentation [1] mentions that this module is needed
during PyQt5 runtime. It is currently compiled without any
dependencies to Qt or PyQt5, but it seems quite useless without it.
The module was introduced together with PyQt 5.11 [2].

The problem was likely triggered by the atomic upgrade from 5.7 to
5.15 in b36ce7e. This commit is part of the 2022 and 2023 LTS
branches.

[1] https://www.riverbankcomputing.com/static/Docs/PyQt5/installation.html#building-and-installing-from-source
[2] https://www.riverbankcomputing.com/static/Docs/PyQt5/incompatibilities.html#pyqt-v5-11

Signed-off-by: Ralf Dragon <hypnotoad@lindra.de>
---
Backport to: 2023.02.x
(2022 LTS branches are probably also affected but I could not test any, 2021.11.3 is fine)
---
 package/Config.in                              |  1 +
 package/python-pyqt5-sip/Config.in             |  4 ++++
 package/python-pyqt5-sip/python-pyqt5-sip.hash |  4 ++++
 package/python-pyqt5-sip/python-pyqt5-sip.mk   | 14 ++++++++++++++
 package/python-pyqt5/Config.in                 |  1 +
 5 files changed, 24 insertions(+)
 create mode 100644 package/python-pyqt5-sip/Config.in
 create mode 100644 package/python-pyqt5-sip/python-pyqt5-sip.hash
 create mode 100644 package/python-pyqt5-sip/python-pyqt5-sip.mk

diff --git a/package/Config.in b/package/Config.in
index d5d89c50aa..7b130fc173 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -1268,6 +1268,7 @@ menu "External python modules"
 	source "package/python-pyphen/Config.in"
 	source "package/python-pyqrcode/Config.in"
 	source "package/python-pyqt5/Config.in"
+	source "package/python-pyqt5-sip/Config.in"
 	source "package/python-pyratemp/Config.in"
 	source "package/python-pyroute2/Config.in"
 	source "package/python-pyrsistent/Config.in"
diff --git a/package/python-pyqt5-sip/Config.in b/package/python-pyqt5-sip/Config.in
new file mode 100644
index 0000000000..f7be60c8ec
--- /dev/null
+++ b/package/python-pyqt5-sip/Config.in
@@ -0,0 +1,4 @@
+config BR2_PACKAGE_PYTHON_PYQT5_SIP
+	bool "python-pyqt5-sip"
+	help
+	  This is the PyQt5.sip module which is needed to run PyQt5.
diff --git a/package/python-pyqt5-sip/python-pyqt5-sip.hash b/package/python-pyqt5-sip/python-pyqt5-sip.hash
new file mode 100644
index 0000000000..8039cdafd9
--- /dev/null
+++ b/package/python-pyqt5-sip/python-pyqt5-sip.hash
@@ -0,0 +1,4 @@
+# from https://pypi.org/project/PyQt5-sip/12.12.1
+
+sha256  8fdc6e0148abd12d977a1d3828e7b79aae958e83c6cb5adae614916d888a6b10  PyQt5_sip-12.12.1.tar.gz
+md5  c2117da3b4c0e081c1c5a9088b8a4d55  PyQt5_sip-12.12.1.tar.gz
diff --git a/package/python-pyqt5-sip/python-pyqt5-sip.mk b/package/python-pyqt5-sip/python-pyqt5-sip.mk
new file mode 100644
index 0000000000..051fa4e77d
--- /dev/null
+++ b/package/python-pyqt5-sip/python-pyqt5-sip.mk
@@ -0,0 +1,14 @@
+################################################################################
+#
+# python-SIP-QT5
+#
+################################################################################
+
+PYTHON_PYQT5_SIP_VERSION = 12.12.1
+PYTHON_PYQT5_SIP_SITE = https://files.pythonhosted.org/packages/c1/61/4055e7a0f36339964956ff415e36f4abf82561904cc49c021da32949fc55
+PYTHON_PYQT5_SIP_SOURCE = PyQt5_sip-$(PYTHON_PYQT5_SIP_VERSION).tar.gz
+PYTHON_PYQT5_SIP_LICENSE = MIT
+PYTHON_PYQT5_SIP_LICENSE_FILES = LICENSE
+PYTHON_PYQT5_SIP_SETUP_TYPE = setuptools
+
+$(eval $(python-package))
diff --git a/package/python-pyqt5/Config.in b/package/python-pyqt5/Config.in
index 9fa7676f98..0b37f14317 100644
--- a/package/python-pyqt5/Config.in
+++ b/package/python-pyqt5/Config.in
@@ -5,6 +5,7 @@ config BR2_PACKAGE_PYTHON_PYQT5
 	bool "python-pyqt5"
 	depends on BR2_PACKAGE_QT5
 	select BR2_PACKAGE_PYTHON_SIP
+	select BR2_PACKAGE_PYTHON_PYQT5_SIP # runtime
 	select BR2_PACKAGE_QT5BASE_GUI
 	help
 	  Python bindings for Qt 5
-- 
2.39.2


[-- Attachment #3: Type: text/plain, Size: 150 bytes --]

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [Buildroot] [PATCH 1/2] python-sip: fix compile error
  2023-12-12 16:01 [Buildroot] [PATCH 1/2] python-sip: fix compile error Ralf Dragon
  2023-12-12 16:01 ` [Buildroot] [PATCH 2/2] python-qt5: add PyQt5.sip module Ralf Dragon
  2023-12-17 22:03 ` [Buildroot] [PATCH 1/2] python-sip: fix compile error Thomas Petazzoni via buildroot
@ 2024-01-05 12:41 ` Peter Korsgaard
  2 siblings, 0 replies; 13+ messages in thread
From: Peter Korsgaard @ 2024-01-05 12:41 UTC (permalink / raw)
  To: Ralf Dragon; +Cc: gwenhael.goavec-merou, yann.morin.1998, asafka7, buildroot

>>>>> "Ralf" == Ralf Dragon <hypnotoad@lindra.de> writes:

 > Without the patch, python-sip fails to compile with:
 > siplib.c: In function ‘sip_api_get_frame’:
 > siplib.c:13750:22: error: invalid use of undefined type ‘struct _frame’
 > 13750 |         frame = frame->f_back;

 > This likely fixes bug 15201 [1].



 > [1] https://bugs.buildroot.org/show_bug.cgi?id=15201


 > Signed-off-by: Ralf Dragon <hypnotoad@lindra.de>
 > ---
 > Backport to: 2023.02.x

Committed to 2023.02.x and 2023.11.x, thanks.

-- 
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [Buildroot] [PATCH 2/2] python-qt5: add PyQt5.sip module
  2023-12-17 22:07   ` Thomas Petazzoni via buildroot
  2023-12-18 18:22     ` Ralf Dragon
  2023-12-18 18:58     ` Ralf Dragon
@ 2024-01-10 19:21     ` Julien Olivain
  2024-01-10 19:58       ` Thomas Petazzoni via buildroot
  2 siblings, 1 reply; 13+ messages in thread
From: Julien Olivain @ 2024-01-10 19:21 UTC (permalink / raw)
  To: Thomas Petazzoni
  Cc: Ralf Dragon, gwenhael.goavec-merou, yann.morin.1998, asafka7, buildroot

Hi Thomas, Ralf, All,

On 17/12/2023 23:07, Thomas Petazzoni wrote:
> Hello Ralf,

[...]

> Also, it would very, very good to add a runtime test case in
> support/testing/ for this, as such Python issues are only visible at
> runtime. I have added Julien Olivain in Cc, who can probably help with
> this, as he is our resident expert in writing support/testing tests :-)

I was able to craft a full PyQt5 runtime test, using the Kernel
VKMS (as we used in some other graphical tests), and using the
Qt QPA eglfs, which runs application directly on kms/drm.

I'll post an early version soon, at least to get some early comments.

Best regards,

Julien.
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [Buildroot] [PATCH 2/2] python-qt5: add PyQt5.sip module
  2024-01-10 19:21     ` Julien Olivain
@ 2024-01-10 19:58       ` Thomas Petazzoni via buildroot
  0 siblings, 0 replies; 13+ messages in thread
From: Thomas Petazzoni via buildroot @ 2024-01-10 19:58 UTC (permalink / raw)
  To: Julien Olivain
  Cc: Ralf Dragon, gwenhael.goavec-merou, yann.morin.1998, asafka7, buildroot

On Wed, 10 Jan 2024 20:21:48 +0100
Julien Olivain <ju.o@free.fr> wrote:

> > Also, it would very, very good to add a runtime test case in
> > support/testing/ for this, as such Python issues are only visible at
> > runtime. I have added Julien Olivain in Cc, who can probably help with
> > this, as he is our resident expert in writing support/testing tests :-)  
> 
> I was able to craft a full PyQt5 runtime test, using the Kernel
> VKMS (as we used in some other graphical tests), and using the
> Qt QPA eglfs, which runs application directly on kms/drm.
> 
> I'll post an early version soon, at least to get some early comments.

Excellent, looking forward to it!

Thomas
-- 
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [Buildroot] [PATCH 2/2] python-qt5: add PyQt5.sip module
  2023-12-12 16:01 ` [Buildroot] [PATCH 2/2] python-qt5: add PyQt5.sip module Ralf Dragon
  2023-12-17 22:07   ` Thomas Petazzoni via buildroot
@ 2024-03-10 13:25   ` Julien Olivain
  1 sibling, 0 replies; 13+ messages in thread
From: Julien Olivain @ 2024-03-10 13:25 UTC (permalink / raw)
  To: Ralf Dragon; +Cc: gwenhael.goavec-merou, yann.morin.1998, asafka7, buildroot

Hi Ralf, All,

Thanks for this patch.  I have few comments on it.

There was an improved version of this patch, sent as an
attachment here:
https://lists.buildroot.org/pipermail/buildroot/2023-December/681200.html
This may be the reason why this series got forgotten. For sending
updated patches, see:
https://nightly.buildroot.org/manual.html#_patch_revision_changelog

I am commenting this earlier patch revision. I believe my comments also
applies to the other version.

First, I think this patch could be split in two, in the same series:
1. the introduction of the new package python-pyqt5-sip (alone)
    The commit log should describe what the package is and why it is 
needed.
2. The runtime fix for python-pyqt5
    The commit log should describe what is broken, when the problem was 
introduced.
    (see examples later)

In order to follow the Buildroot convention, the first patch one-line
title could be changed to:
"package/python-pyqt5-sip: new package"

On 12/12/2023 17:01, Ralf Dragon wrote:
> This fixes the following runtime error when importing PyQt5 in python:
> 
> from PyQt5.QtCore import *
> ModuleNotFoundError: No module named 'PyQt5.sip'

You could also add a quick package description and the reason you would 
like
to add the package in the commit log, for example:
"""
The sip extension module provides support for the PyQt5 package.

This package is needed at runtime by python-pyqt5 version >= 5.11.
"""


> Signed-off-by: Ralf Dragon <hypnotoad@lindra.de>
> ---
> Backport to: 2023.02.x
> 
>  package/Config.in                              |  1 +
>  package/python-pyqt5-sip/Config.in             |  6 ++++++
>  package/python-pyqt5-sip/python-pyqt5-sip.hash |  4 ++++
>  package/python-pyqt5-sip/python-pyqt5-sip.mk   | 15 +++++++++++++++
>  package/python-pyqt5/Config.in                 |  1 +
>  5 files changed, 27 insertions(+)
>  create mode 100644 package/python-pyqt5-sip/Config.in
>  create mode 100644 package/python-pyqt5-sip/python-pyqt5-sip.hash
>  create mode 100644 package/python-pyqt5-sip/python-pyqt5-sip.mk
> 
> diff --git a/package/Config.in b/package/Config.in
> index fcc09b07c4..2d6a077d16 100644
> --- a/package/Config.in
> +++ b/package/Config.in
> @@ -1253,6 +1253,7 @@ menu "External python modules"
>  	source "package/python-pyphen/Config.in"
>  	source "package/python-pyqrcode/Config.in"
>  	source "package/python-pyqt5/Config.in"
> +	source "package/python-pyqt5-sip/Config.in"
>  	source "package/python-pyratemp/Config.in"
>  	source "package/python-pyroute2/Config.in"
>  	source "package/python-pyrsistent/Config.in"
> diff --git a/package/python-pyqt5-sip/Config.in 
> b/package/python-pyqt5-sip/Config.in
> new file mode 100644
> index 0000000000..6f26271f70
> --- /dev/null
> +++ b/package/python-pyqt5-sip/Config.in
> @@ -0,0 +1,6 @@
> +config BR2_PACKAGE_PYTHON_PYQT5_SIP
> +	bool "python-pyqt5-sip"
> +	depends on BR2_PACKAGE_PYTHON_PYQT5
> +	depends on BR2_PACKAGE_PYTHON_SIP
> +	help
> +	  This is the PyQt5.sip module which is needed to run PyQt5.
> diff --git a/package/python-pyqt5-sip/python-pyqt5-sip.hash 
> b/package/python-pyqt5-sip/python-pyqt5-sip.hash
> new file mode 100644
> index 0000000000..8039cdafd9
> --- /dev/null
> +++ b/package/python-pyqt5-sip/python-pyqt5-sip.hash
> @@ -0,0 +1,4 @@
> +# from https://pypi.org/project/PyQt5-sip/12.12.1
> +
> +sha256  
> 8fdc6e0148abd12d977a1d3828e7b79aae958e83c6cb5adae614916d888a6b10  
> PyQt5_sip-12.12.1.tar.gz
> +md5  c2117da3b4c0e081c1c5a9088b8a4d55  PyQt5_sip-12.12.1.tar.gz

Can you add here hashes for the 3 license files?
See also comment in the .mk file. You can then check with a
"make python-pyqt5-sip-legal-info" or "make legal-info".

> diff --git a/package/python-pyqt5-sip/python-pyqt5-sip.mk 
> b/package/python-pyqt5-sip/python-pyqt5-sip.mk
> new file mode 100644
> index 0000000000..3f689b9d47
> --- /dev/null
> +++ b/package/python-pyqt5-sip/python-pyqt5-sip.mk
> @@ -0,0 +1,15 @@
> +################################################################################
> +#
> +# python-SIP-QT5
> +#
> +################################################################################
> +
> +PYTHON_PYQT5_SIP_VERSION = 12.12.1

There is now a v12.13.0 available. See:
https://pypi.org/project/PyQt5-sip/

Since this patch will likely need a v2, could you see if you can 
updating to
this new version?

> +PYTHON_PYQT5_SIP_SITE = 
> https://files.pythonhosted.org/packages/c1/61/4055e7a0f36339964956ff415e36f4abf82561904cc49c021da32949fc55
> +PYTHON_PYQT5_SIP_SOURCE = PyQt5_sip-$(PYTHON_PYQT5_SIP_VERSION).tar.gz
> +PYTHON_PYQT5_SIP_LICENSE = MIT

License seems to be:
"SIP or GPL-2.0 or GPL-3.0"
Where is the source of this MIT license? (I grep'ed "MIT" in the
sources and was not able to any occurrence of it).

> +PYTHON_PYQT5_SIP_LICENSE_FILES = LICENSE

The package also contains the license files:
LICENSE-GPL2 and LICENSE-GPL3.
Can you add those here? (see also comment in the .hash file).

> +PYTHON_PYQT5_SIP_SETUP_TYPE = setuptools
> +PYTHON_PYQT5_SIP_DEPENDENCIES += python-sip
> +
> +$(eval $(python-package))
> diff --git a/package/python-pyqt5/Config.in 
> b/package/python-pyqt5/Config.in
> index 9fa7676f98..c2a1976950 100644
> --- a/package/python-pyqt5/Config.in
> +++ b/package/python-pyqt5/Config.in
> @@ -5,6 +5,7 @@ config BR2_PACKAGE_PYTHON_PYQT5
>  	bool "python-pyqt5"
>  	depends on BR2_PACKAGE_QT5
>  	select BR2_PACKAGE_PYTHON_SIP
> +	select BR2_PACKAGE_PYTHON_PYQT5_SIP

This line could go in a separate "python-pyqt5 fix" patch. Could you
also flag this dependency as "runtime"?

	select BR2_PACKAGE_PYTHON_PYQT5_SIP # runtime

The commit log of this second patch should describe issue, for example:
"""
Commit b36ce7eda0 "package/python-pyqt5: bump to version 5.15.6"
updated PyQt5 from version 5.7 to 5.15.6. This commit forgot to
take into account an upstream incompatible change about a PyQt5
SIP module. See [1]. Without this pyqt5-sip module, pyqt5 is failing
to load at runtime.

The issue can be reproduced with the command:

     python3 -c 'from PyQt5.QtCore import *'

This commit fixes the issue by adding this missing runtime dependency.

Fixes:

     ModuleNotFoundError: No module named 'PyQt5.sip'

[1] 
https://www.riverbankcomputing.com/static/Docs/PyQt5/incompatibilities.html#pyqt-v5-11
"""

>  	select BR2_PACKAGE_QT5BASE_GUI
>  	help
>  	  Python bindings for Qt 5
> --
> 2.39.2
> 
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot

Best regards,

Julien.
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2024-03-10 13:25 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-12 16:01 [Buildroot] [PATCH 1/2] python-sip: fix compile error Ralf Dragon
2023-12-12 16:01 ` [Buildroot] [PATCH 2/2] python-qt5: add PyQt5.sip module Ralf Dragon
2023-12-17 22:07   ` Thomas Petazzoni via buildroot
2023-12-18 18:22     ` Ralf Dragon
2023-12-18 19:51       ` Thomas Petazzoni via buildroot
     [not found]         ` <f329f198-4cb1-4e61-8e47-0653cab03893@lindra.de>
2023-12-19 19:36           ` Ralf Dragon
2024-01-02 21:48           ` Ralf Dragon
2023-12-18 18:58     ` Ralf Dragon
2024-01-10 19:21     ` Julien Olivain
2024-01-10 19:58       ` Thomas Petazzoni via buildroot
2024-03-10 13:25   ` Julien Olivain
2023-12-17 22:03 ` [Buildroot] [PATCH 1/2] python-sip: fix compile error Thomas Petazzoni via buildroot
2024-01-05 12:41 ` Peter Korsgaard

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.