-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cryptography does not build with python and fails at trying to build _openssl.c #6929
Comments
Can you provide instructions to reproduce this from a clean environment (e.g. a dockerfile)? It sounds like this has something to do with how you've built openssl. |
I did not explicitely use a dockerfile. Steps to reproduce. In docker, docker run -it archlinux tail -f /dev/null After that make and make install Next, I clone cpython, and I uncomment static linking of openssl against cpython/Lib/Setup file. then i do cd cpython After that, You will see the above error. |
This looks like a new regression in Python and was probably introduced in PR python/cpython#31528 |
It should be fixed by: python/cpython#31668
Oh right, I broke the limited API targeting Python older than Python 3.5. Sadly, we only test the limited C API 3.5 and 3.11 currently in Python.
What's the default limited C API version targeted by cffi? |
I'm not positive, I think it's 3.4? |
Going to close this as it's an upstream python bug that's now been fixed. |
I fixed the regression in Python commit python/cpython@0b63215 which is part of the just released Python 3.11 alpha6. The regression was never part of any Python release thanks to this bug report, so thanks! |
Thanks for the fix, and thanks to @tiran for flagging that it was an upstream issue! |
If you're filing a bug (as opposed to a feature request), please try the
following things:
https://cryptography.io/en/latest/faq.html
setuptools
andpip
cryptography
installed if you aren't using the binary wheels.
If none of that works, please make sure to include the following information in
your bug report:
cryptography
,cffi
,pip
, andsetuptools
you're using
cryptography
Please do not report security issues on Github! Follow the instructions in our
documentation for reporting security issues:
https://cryptography.io/en/latest/security.html
Here, python3.11 is built with static linking against openssl and hashlib.
When building with python3.11 (also happens with python3.10), the build fails due to:
The error is becuase Py_LIMITED_API is defined and hence, PyModuleDef_Slot will not be defined. Somehow, the Py_LIMITED_API version is being defined as lesser than 3.5 somewhere in the toolchain or the source. I had to
edit /usr/local/include/python3.11/moduleobject.h :
from struct PyModuleDef_slot to
typedef struct PyModuleDef_slot PyModuleDef_slot to compile cryptography.
OpenSSL version is 1.1.1m
cpython - 3.11a5+
The text was updated successfully, but these errors were encountered: