[Buildroot] [PATCH 2/2] python-qt5: add PyQt5.sip module

Thomas Petazzoni thomas.petazzoni at bootlin.com
Mon Dec 18 19:51:56 UTC 2023


Hello Ralf,

On Mon, 18 Dec 2023 19:22:14 +0100
Ralf Dragon <hypnotoad at 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



More information about the buildroot mailing list