Hide Forgot
libvirt-python fails to build with Python 3.10.0a2.
Traceback (most recent call last):
File "/builddir/build/BUILD/libvirt-python-6.9.0/sanitytest.py", line 5, in <module>
import lxml.etree
ImportError: /usr/lib64/python3.10/site-packages/lxml/etree.cpython-310-x86_64-linux-gnu.so: undefined symbol: _PyGen_Send
This seem to be related to.
It might be fixed with this patch that works for numpy. Upstream has decided to solve this differently, but until that happens, we are using this patch in our Copr (for other packages).
For the build logs, see:
For all our attempts to build libvirt-python.
That stack trace shows the problem is in the lxml.etree module, not libvirt, so re-assigning.
Yes, sorry for the confusion. There was a mid air collision while I was updating the bugzilla.
The above error was fixed in libxml, but libvirt-python rebuild leads to another error:
libvirt-lxc-override.c:67:5: warning: â€˜PyEval_ThreadsInitializedâ€™ is deprecated [-Wdeprecated-declarations]
67 | LIBVIRT_BEGIN);
| ^~~~~~~~~~~~~~~~~~~~~~~~~
libvirt-lxc-override.c:69:5: warning: â€˜PyEval_ThreadsInitializedâ€™ is deprecated [-Wdeprecated-declarations]
69 | LIBVIRT_END);
You can see full log here:
bpo-39877: Deprecated PyEval_InitThreads() and PyEval_ThreadsInitialized(). Calling PyEval_InitThreads() now does nothing.
Reassigning back to libvirt-python
Those messages, while important to fix, are merely warnings so don't cause the build to fail.
The real problem shown in the logs is the test suite failure:
running test
/usr/bin/python3 sanitytest.py build/lib.linux-x86_64-3.1 /usr/share/libvirt/api/libvirt-api.xml
Traceback (most recent call last):
File "/builddir/build/BUILD/libvirt-python-6.9.0/sanitytest.py", line 11, in <module>
import libvirt
ModuleNotFoundError: No module named 'libvirt'
error: command '/usr/bin/python3' failed with exit
It looks like we're truncating the version number to 3.1 when passing the build directory.
From setup.py:
plat_specifier = ".%s-%s" % (self.plat_name, sys.version[0:3])
I believe this is the cause. It evals to 3.1 on Python 3.10.
Fixes proposed upstream in
I've patched this in our copr to unblock testing the depended packages. Let me know if I should submit a PR.
It'll get fixed in the next monthly rebase of libvirt around Dec 1st
That'll work nicely, thanks Daniel.