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
update internal libffi copy to 3.2.1 #67274
Comments
Link to the file: Link to the changes: |
some issues:
|
I think Matthias is referring to bpo-20160, but as far as I could tell libffi is multiple versions ahead of the version in Python and already has the fixes. I was told to wait for it to be submitted/accepted upstream, so I've been waiting :) |
you should actively drive upstream integration, and ping patches if they are not addressed. |
As I mentioned on the other post, libffi's current version bears no relation to what we have in CPython, so the patches don't apply. I'm not planning on rewriting CPython patches so that they will apply to libffi, nor do I intend to replace our current version of it with libffi's latest. There's nothing to send upstream. |
Will this also fix http://bugs.python.org/issue23042 ? |
@steve.dower, so, can I abandon this issue? |
I'm not entirely familiar with our layout of libffi, but I don't think your patch will affect Windows at all. If your intent was to update the version used in Windows builds, then you may as well abandon it. I'm not the one to ask about other platforms - apparently we need new ctypes maintainers... |
@steve.dower, so no problems, because my patch won't affect Windows. |
Ping |
bpo-23042 is fixed now. libffi 3.2.1 apparently has the same issue, so the bpo-23042 patch would probably have to be reapplied (slightly modified, though). Seeing that libffi has had a major compilation problem breaking it on at least FreeBSD and most probably a lot of other x86 based systems as well, I don't really have much confidence in the libffi maintenance, so the usual "latest is the greatest" may not be the best approach. Are there any issue *we* have with libffi which an update to 3.2.1 would solve ? |
There are these Ubuntu-specific compiler warnings: which Berker says have been fixed in upstream libffi: https://bugs.python.org/issue25077#msg266068 |
Correct, here is the actual commit: libffi/libffi@4a677a4 I have also sent a patch to upstream libffi for https://github.com/python/cpython/blob/master/Modules/_ctypes/libffi.diff#L161: libffi/libffi@1e82e1c But both of them will be released in libffi 4.0. Note that the current master branch of libffi doesn't seem to be compiled with a C89 compiler (see libffi/libffi#218 for details). See also https://mail.python.org/pipermail/python-dev/2016-June/144816.html for discussion about C99 support in CPython. |
+1 for this. Cross-compile CPython for ARM with clang fails in _ctypes due to https://llvm.org/bugs/show_bug.cgi?id=20595. This bug is already fixed in libffi. By the way, I can't apply libffi.patch to the default branch. Some hunks are rejcted. Is there something wrong? bpo-26942 may also be relevant. I did't test it as I'm not sure how to update CPython's internal libffi. |
Oops the proglem of clang on ARM is not completely fixed in libffi 3.2.1. This commit [1] fixes only one [1] libffi/libffi@6eff9ff#diff-c6400d42bf23866ded49558ca9a54205R220 |
I have entered bpo-27627 for this problem. |
Forgive me for asking a question that may have already been asked, or beaten to death, but what is preventing Python from requiring libffi as an external/required dependency, rather than keeping it and taking on the burden of fixes/backporting in lieu of updates or pending releases from upstream? Historically (at least the last ~2-3 years), libffi in Python has been plagued with, at least:
I know at least FreeBSD currently requires --sytem-libffi for i386 systems in certain versions due to bpo-22521 (bpo-23042) and there are currently 50 open issues matching libffi (granted not all of them will be root-caused by libffi internal). I note that number to highlight the maintenance requirement. |
See msg243261, I think. On linux and freebsd we could theoretically leave that to the distros, but on OSX we have to deal with it ourselves. |
OSX and Windows are both exempt from this discussion. Each has its own private copy of an ancient version of libffi: Modules/_ctypes/libffi_osx/ and Modules/_ctypes/libffy_msvc/. I would be in favor of switching to --with-system-ffi by default for 3.6 and deprecating building with the bundled full copy of libffi (Modules/_ctypes/libffi/), to be removed in 3.7. OSX would also default to --with-system-ffi, but would still fall back to its private copy when a system copy isn't available. It seems like most Linux and BSD distributions would be better off with system-ffi. I'm not sure how cross-builds would have to deal with things in 3.7, but they already have to deal with dependencies like openssl, bz2, and lzma; adding libffi to that mix shouldn't be that big of a deal. Adding Ned to confirm that building OSX installers wouldn't be affected as long as we don't touch Modules/_ctypes/libffi_osx/ and there's not a system copy of libffi available. |
We should be able to make things work for OS X installer builds one way or another so don't let that be a factor. |
I'm closing this as superseded by bpo-27976, which deprecates building with the bundled libffi. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: