-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
closes bpo-44751: Move crypt.h include from public header to _cryptmodule #27394
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
Conversation
@@ -4,6 +4,9 @@ | |||
#include "Python.h" | |||
|
|||
#include <sys/types.h> | |||
#ifdef HAVE_CRYPT_H | |||
#include <crypt.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to #define _GNU_SOURCE
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think no because it's defined by pyconfig.h which is included by Python.h. I'm going to try a build on my Linux box to confirm.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I compiled Python 3.7 on my Debian 9 box with this patch (because that was easiest), and crypt.crypt()
works without segfaulting and links crypt_r
and there are no warnings in the build log. From inspection, pyconfig.h does define _GNU_SOURCE and does get pulled in by Python.h.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, great.
@geofft: Status check is done, and it's a success ❌ . |
@geofft: Status check is done, and it's a success ✅ . |
Sorry, I can't merge this PR. Reason: |
@geofft: Status check is done, and it's a success ✅ . |
Thank you! I'm not sure why |
backport python/cpython#27394 to 3.9.6 Android Pycryptodome builds fail due to crypt.h inclusion (not respecting undef HAVE_CRYPT_H)
backport python/cpython#27394 to 3.9.6 Android Pycryptodome builds fail due to crypt.h inclusion (not respecting undef HAVE_CRYPT_H)
backport python/cpython#27394 to 3.9.6 Android Pycryptodome builds fail due to crypt.h inclusion (not respecting undef HAVE_CRYPT_H)
backport python/cpython#27394 to 3.9.6 Android Pycryptodome builds fail due to crypt.h inclusion (not respecting undef HAVE_CRYPT_H)
Could you backport this fix to at least 3.9 and 3.10 branches? |
Thanks @geofft for the PR 🌮🎉.. I'm working now to backport this PR to: 3.10. |
GH-28636 is a backport of this pull request to the 3.10 branch. |
…dule (pythonGH-27394) Automerge-Triggered-By: GH:benjaminp (cherry picked from commit 196998e) Co-authored-by: Geoffrey Thomas <[email protected]>
Thanks @geofft for the PR 🌮🎉.. I'm working now to backport this PR to: 3.9. |
GH-28638 is a backport of this pull request to the 3.9 branch. |
…dule (pythonGH-27394) Automerge-Triggered-By: GH:benjaminp (cherry picked from commit 196998e) Co-authored-by: Geoffrey Thomas <[email protected]>
…dule (GH-27394) Automerge-Triggered-By: GH:benjaminp (cherry picked from commit 196998e) Co-authored-by: Geoffrey Thomas <[email protected]>
…dule (GH-27394) (GH-28636) Automerge-Triggered-By: GH:benjaminp (cherry picked from commit 196998e) Co-authored-by: Geoffrey Thomas <[email protected]>
backport python/cpython#27394 to 3.9.6 Android Pycryptodome builds fail due to crypt.h inclusion (not respecting undef HAVE_CRYPT_H)
backport python/cpython#27394 to 3.9.6 Android Pycryptodome builds fail due to crypt.h inclusion (not respecting undef HAVE_CRYPT_H)
backport python/cpython#27394 to 3.9.6 Android Pycryptodome builds fail due to crypt.h inclusion (not respecting undef HAVE_CRYPT_H)
crypt is sadly still needed for packages using python-config:
Not sure why python-config leaks all those internals in the first place. |
I think that was fixed separately in #28881 (but not backported). But agreed, I'm not really sure either, and it leads to a lot of applications linking unnecessarily against extra bits. This whole thing bit us quite hard downstream when changing to libxcrypt and getting build orders right during the migration, as things were requesting it when they didn't actually need it. |
Ah, thanks. I'm going to backport that then. Yeah, I guess for static builds it makes sense the way it is, but usually that is hidden behind a "--static" flag. |
FWIW, we've backported it in Gentoo safely and nothing exploded, so it should be okay for MSYS2 too. What I think we really need/want is for packages to start using pkg-config for this, which does The Right Thing. I've considered making python-config fatal for some tests runs locally to try weed them out, but worried about the huge amount of work.
|
This PR is closed. If there is still a bug, please open a new issue at bugs.python.org ;-) |
Will it be backported to 3.8 and 3.7? |
Those branches accept almost only security fixes, so unfortunately probably no. |
No, you have to backport this change downstream manually (yourself). Python 3.7 and 3.8 no longer accept bugfixes: https://devguide.python.org/#status-of-python-branches |
backport python/cpython#27394 to 3.9.6 Android Pycryptodome builds fail due to crypt.h inclusion (not respecting undef HAVE_CRYPT_H)
…dule (pythonGH-27394) Automerge-Triggered-By: GH:benjaminp (cherry picked from commit 196998e)
…dule (pythonGH-27394) Automerge-Triggered-By: GH:benjaminp (cherry picked from commit 196998e)
https://bugs.python.org/issue44751
Automerge-Triggered-By: GH:benjaminp