Bug 2021808
Summary: | python-crypto fails to build with Python 3.11: fatal error: longintrepr.h: No such file or directory | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Tomáš Hrnčiar <thrnciar> |
Component: | python-crypto | Assignee: | Paul Howarth <paul> |
Status: | CLOSED RAWHIDE | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | unspecified | Docs Contact: | |
Priority: | unspecified | ||
Version: | rawhide | CC: | athmanem, mhroncok, paul, thrnciar |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | python-crypto-2.6.1-37.fc36 | Doc Type: | If docs needed, set a value |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2021-11-23 15:47:00 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-10 09:17:14 UTC
It's builing OK now. There's another problem coming up for Python 3.12: this module uses the deprecated distutils that will be going away in 3.12 and its use of distutils isn't covered by the migration guide so I don't know how to fix that. $ rg distutils setup.py 39:from distutils import core 40:from distutils.ccompiler import new_compiler 41:from distutils.core import Extension, Command 42:from distutils.command.build import build 43:from distutils.command.build_ext import build_ext 59: from distutils.command.build_py import build_py_2to3 as build_py 62: from distutils.command.build_py import build_py lib/Crypto/Util/number.py 44: # from distutils.sysconfig import get_config_var lib/Crypto/SelfTest/PublicKey/test_DSA.py 226: from distutils.sysconfig import get_config_var lib/Crypto/SelfTest/PublicKey/test_RSA.py 396: from distutils.sysconfig import get_config_var The runtime change is easy: distutils.sysconfig import get_config_var -> sysconfig.get_config_var The setup.py changes might require more fiddling, but generally: from distutils import core is used for: core.setup -> use setuptools.setup core.setup_keywords -> remove the check, only used to support pre-2.3 Python from distutils.ccompiler import new_compiler -> from setuptools.command.build_ext import new_compiler from distutils.core import Extension, Command -> form setuptools import Extension, Command from distutils.command.build import build -> appears unused? from distutils.command.build_ext import build_ext -> from setuptools.command.build_ext import build_ext from distutils.command.build_py import build_py_2to3 -> drop this entirely and make the code Python 3 compatible at once by calling the 2to3 tool while it still exists? from distutils.command.build_py import build_py -> from setuptools.command.build_py import build_py Thanks, that seems to have worked for me (python-crypto-2.6.1-38.fc36). There's just this: writing byte-compilation script '/tmp/tmp6oe3lj52.py' /usr/bin/python3 -Wignore:The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives:DeprecationWarning /tmp/tmp6oe3lj52.py removing /tmp/tmp6oe3lj52.py That looks like something that will need fixing in whatever generates the byte-compilation script, right? No idea where is this coming from. Looks like setuptools still uses distutils internally: writing byte-compilation script '/tmp/tmp3uz0_qn4.py' Traceback (most recent call last): File "/builddir/build/BUILD/pycrypto-2.6.1/setup.py", line 386, in <module> setup(**kw) File "/usr/lib/python3.10/site-packages/setuptools/__init__.py", line 153, in setup return distutils.core.setup(**attrs) File "/usr/lib64/python3.10/distutils/core.py", line 148, in setup dist.run_commands() File "/usr/lib64/python3.10/distutils/dist.py", line 966, in run_commands self.run_command(cmd) File "/usr/lib64/python3.10/distutils/dist.py", line 985, in run_command cmd_obj.run() File "/usr/lib/python3.10/site-packages/setuptools/command/install.py", line 61, in run return orig.install.run(self) File "/usr/lib64/python3.10/distutils/command/install.py", line 580, in run self.run_command(cmd_name) File "/usr/lib64/python3.10/distutils/cmd.py", line 313, in run_command self.distribution.run_command(command) File "/usr/lib64/python3.10/distutils/dist.py", line 985, in run_command cmd_obj.run() File "/usr/lib/python3.10/site-packages/setuptools/command/install_lib.py", line 15, in run self.byte_compile(outfiles) File "/usr/lib64/python3.10/distutils/command/install_lib.py", line 136, in byte_compile byte_compile(files, optimize=self.optimize, File "/usr/lib64/python3.10/distutils/util.py", line 389, in byte_compile raise RuntimeError('Raising exception to see how we got here') RuntimeError: Raising exception to see how we got here I got that from hacking an exception into distutils.util where it's about to write a byte-compilation script (on regular rawhide, not the Python 3.11 version, as I expect they're the same in this respect). If I add SETUPTOOLS_USE_DISTUTILS=local then that message no longer appears, and I guess the plan is for that to be the default for Python 3.12. |