Bug 1897112
Summary: | libvirt-python fails to build with Python 3.10: setup.py test truncates Python version to 3.1 | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Tomáš Hrnčiar <thrnciar> |
Component: | libvirt-python | Assignee: | Daniel Berrangé <berrange> |
Status: | CLOSED RAWHIDE | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | unspecified | Docs Contact: | |
Priority: | unspecified | ||
Version: | rawhide | CC: | berrange, mhroncok, thrnciar, veillard |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | If docs needed, set a value | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2021-02-02 16:53:40 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: | |||
Bug Depends On: | |||
Bug Blocks: | 1890881 |
Description
Tomáš Hrnčiar
2020-11-12 10:46:53 UTC
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_ALLOW_THREADS; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/python3.10/Python.h:146, from libvirt-lxc-override.c:17: /usr/include/python3.10/ceval.h:121:36: note: declared here 121 | Py_DEPRECATED(3.9) PyAPI_FUNC(int) PyEval_ThreadsInitialized(void); | ^~~~~~~~~~~~~~~~~~~~~~~~~ libvirt-lxc-override.c:69:5: warning: ‘PyEval_ThreadsInitialized’ is deprecated [-Wdeprecated-declarations] 69 | LIBVIRT_END_ALLOW_THREADS; | ^~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/python3.10/Python.h:146, from libvirt-lxc-override.c:17: /usr/include/python3.10/ceval.h:121:36: note: declared here 121 | Py_DEPRECATED(3.9) PyAPI_FUNC(int) PyEval_ThreadsInitialized(void); You can see full log here: https://download.copr.fedorainfracloud.org/results/@python/python3.10/fedora-rawhide-x86_64/01766717-libvirt-python/builder-live.log.gz https://docs.python.org/3.10/whatsnew/changelog.html#id48 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 https://gitlab.com/libvirt/libvirt-python/-/merge_requests/30 I've patched this in our copr to unblock testing the depended packages. Let me know if I should submit a PR. https://copr.fedorainfracloud.org/coprs/g/python/python3.10/build/1770405/ It'll get fixed in the next monthly rebase of libvirt around Dec 1st That'll work nicely, thanks Daniel. |