Bug 2022252
Summary: | mercurial fails to build with Python 3.11: AttributeError: module 'inspect' has no attribute 'getargspec' | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Tomáš Hrnčiar <thrnciar> |
Component: | mercurial | Assignee: | Mads Kiilerich <mads> |
Status: | CLOSED RAWHIDE | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | unspecified | Docs Contact: | |
Priority: | unspecified | ||
Version: | 36 | CC: | jwatt, katzj, mads, mhroncok, ndbecker2, opohorel, pcahyna, pstodulk, sebastian.kisela, thrnciar |
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: | 2022-02-18 17:53:55 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: | 2016048 |
Description
Tomáš Hrnčiar
2021-11-11 07:58:01 UTC
Fixed upstream on the stable branch, probably to be released in 6.0 - https://www.mercurial-scm.org/repo/hg/rev/e35807332598 Thank you for the fix. Seems like there is another issue with mercurial and Python 3.11. AttributeError: module 'inspect' has no attribute 'getargspec' You can see full log here: https://download.copr.fedorainfracloud.org/results/@python/python3.11/fedora-rawhide-x86_64/03295004-mercurial/builder-live.log.gz (In reply to Tomáš Hrnčiar from comment #2) > AttributeError: module 'inspect' has no attribute 'getargspec' I a fix has been posted upstream - https://www.mercurial-scm.org/pipermail/mercurial-devel/2022-February/147743.html . Note that building the Mercurial package with the 3.11 included in f35 still will fail due to an incorrect %python3_sitearch, caused by: $ python3.11 -Ic "import sysconfig; print(sysconfig.get_path('platlib'))" /usr/local/lib64/python3.11/site-packages vs $ python3.10 -Ic "import sysconfig; print(sysconfig.get_path('platlib'))" /usr/lib64/python3.10/site-packages %python3_sitearch is correct, but it's evaluated as: $ RPM_BUILD_ROOT= python3.11 -Ic "import sysconfig; print(sysconfig.get_path('platlib'))" Ok, I see it is complicated. 00251-change-user-install-location.patch and the RPM_BUILD_ROOT usage in sysconfig is surprising to me. I would expect Python to default to the user default, and the RPM build environment more explicitly tweaking Python when building system packages. Dependency on "magic" environment variables makes packaging harder when we no longer can expect things to behave the same way when testing locally. But evidently, this dependency on RPM_BUILD_ROOT changed somehow. It matters for platlib on 3.11, but not on 3.10 . I just know that with "%define __python3 /usr/bin/python3.11" in my spec and running "fedpkg local" on f35, the build fails because %python3_sitearch is /usr/local/lib64/python3.11/site-packages. With 3.10 it is /usr/lib64/python3.10/site-packages and the package builds as usual. AFAICS, the problem is that RPM_BUILD_ROOT is set too late. It isn't set when the spec is preprocessed and /usr/lib/rpm/macros.d/macros.python3 invokes python to set %python3_sitearch. > Ok, I see it is complicated. It is very complex and complicated. I might need to summarize this somewhere. The starting point is the deprecation of distutils and https://bugs.python.org/issue43976 > But evidently, this dependency on RPM_BUILD_ROOT changed somehow. It matters for platlib on 3.11, but not on 3.10 . Yes, it matters on 3.10 on Fedora 36 as well, but we haven't dared to change the behavior on released Fedoras. > I just know that with "%define __python3 /usr/bin/python3.11" in my spec and running "fedpkg local" on f35, the build fails because %python3_sitearch is /usr/local/lib64/python3.11/site-packages. With 3.10 it is /usr/lib64/python3.10/site-packages and the package builds as usual... That can be fixed. In fact, I have not expected anybody to actually do "%define __python3 /usr/bin/python3.11" in Fedora 35. I can fix that by backporting https://src.fedoraproject.org/rpms/python-rpm-macros/pull-request/110 > That can be fixed. In fact, I have not expected anybody to actually do "%define __python3 /usr/bin/python3.11" in Fedora 35. I can fix that by backporting https://src.fedoraproject.org/rpms/python-rpm-macros/pull-request/110 https://src.fedoraproject.org/rpms/python-rpm-macros/pull-request/130 (In reply to Miro Hrončok from comment #6) > I can fix that by backporting > https://src.fedoraproject.org/rpms/python-rpm-macros/pull-request/110 Personally, I'm now aware and can do without it. It might be beneficial for others, but also risky. In principle, it seems like a good idea that f35 has all the dependencies of its python3.11 package. Even better if the f35 3.11 did things the same way as 3.10, without backporting new functionality to f35 after release. Nah, it's not risky. It changes nothing for f35's python3.10. It was even already backported to RHEL 9. This bug appears to have been reported against 'rawhide' during the Fedora 36 development cycle. Changing version to 36. (In reply to Tomáš Hrnčiar from comment #2) > Thank you for the fix. Seems like there is another issue with mercurial and > Python 3.11. > > AttributeError: module 'inspect' has no attribute 'getargspec' This has been fixed in Mercurial 6.0.3, which now is in f36 and rawhide. Please, can you confirm it works in your 3.11 environment? The package in copr is set to pick up all commits to rawhide: https://copr.fedorainfracloud.org/coprs/g/python/python3.11/package/mercurial/ Lates automated build (6.0.3-1) was successful, thank you! |