-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
bpo-35947: Update windows to the current version of libffi #11797
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
Hello, and thanks for your contribution! I'm a bot set up to make sure that the project can legally accept your contribution by verifying you have signed the PSF contributor agreement (CLA). Our records indicate we have not received your CLA. For legal reasons we need you to sign this before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue. If you have recently signed the CLA, please wait at least one business day You can check yourself to see if the CLA has been received. Thanks again for your contribution, we look forward to reviewing it! |
Right now the build is failing on Windows because we haven't tagged the libffi sources. I'd rather not do that until we have it all working, so for now, can you change the Once we're ready to merge, we can tag the libffi sources and update the reference here. |
There are some configured headers missing from cpython-source-deps |
The CI build is now blocked by a missing fficonfig.h. |
I moved the configured headers to modules/_ctypes/libffi_msvc so that they are not part of the libffi snapshot but generated from the snapshot, and manually edited. I think this is all working now |
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.
Just a few minor comments and I'm not qualified to review the ctypes change, otherwise 🎉 😄
Misc/NEWS.d/next/Windows/2019-02-11-14-53-17.bpo-35947.9vI4hP.rst
Outdated
Show resolved
Hide resolved
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase And if you don't make the requested changes, you will be poked with soft cushions! |
Moved configured files to cpython-source-deps as requested, and fixed quotes. |
It's merged. You can close/reopen to trigger CI again. |
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.
One final thing.
@zooba Does |
@zware Works for me. I'd also like to have the update process documented somewhere (possibly just as a |
Ok, I've gone ahead and pushed the tag. |
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.
And now just an update to the new tag and this is good to go as far as I'm concerned.
Thank you for finally finishing this off!
The configured file was hand-edited to merge changes from the original PR and generated configured header. I don't know how to document this. The sysv_intel.S and ffi.c changes for x86 changes were merged into libffi libffi/libffi#468. However I still need to figure out why autoconf is not working for msvc x86 when building libffi with cygwin. Once that works we could potentially check in configured files for each CPU type based on the output of the autoconf build step instead of having one merged fficonfig.h Does the documentation step need to be done before these changes can be merged? Or can there be a seperate issue to follow up on? |
@paulmon Let's put rough notes about the update process into the readme.txt file. Do you have logs for the Cygwin failure? Technically that isn't required for us to merge this, but if we can figure it out relatively easily then I'd prefer to figure it out. |
Which readme.txt? PCBuild/readme.txt or cpython-sources-dep/master/readme.rst? or some other file? |
While I was working on the libffi autoconf for arm32 I learned how to build the libffi-7.dll from libffi sources. The changes to _ctypes.vcxproj will require pre-building libffi*.dll (see prepare_libffi.bat) and populating libffi-bin-3.3.0-rc0-r1 before they _ctypes will build, which reminds me I need to update get_externals.bat to get the prebuilt libffi*.dll still. Also the win32 changes got merged into libffi/master so you should be able to take a new snapshot and build libffi-bin-3.3.0-rc0-r1 from unpatched sources. arm32 changes for libffi are in a PR that is still waiting for attention. |
PCbuild/pyproject.props
Outdated
#define FIELD3 $(Field3Value) | ||
#define MS_DLL_ID "$(SysWinVer)" | ||
#define PYTHON_DLL_NAME "$(TargetName)$(TargetExt)" | ||
Lines='/* This file created by pyproject.props /t:GeneratePythonNtRcH */%0D%0A |
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.
After I installed VS 2019 to test something else this wouldn't build anymore without the %0D%0A after each line. I reported the issue. Let me know if you want to do something different here.
If VS 2019 is installed then build.bat finds the new msbuild.exe which causes a build error. Setting the MSBUILD environment variable back to the VS 2017 msbuild.exe is a better workaround than changing the project. I have reported the build problem and am following up on it: https://developercommunity.visualstudio.com/content/problem/487337/writelinestofile-doesnt-write-new-lines.html |
@paulmon I got a successful build of libffi - it's on cpython-bin-deps. Please switch your version name to just Make sure you sync your code too - I pushed some batch file changes to your branch. |
@zooba Looks good. |
@zware In case you want to review again, feel free (not sure exactly what's changed since your last one). Otherwise I'll try and get through this today and get it merged. |
The Ubuntu failure on Azure Pipelines has been happening randomly all day. I wonder if a test was updated that's changing permissions on the temp folder? (They run in random order) |
Like the change for PC/layout, there's a Otherwise, I think the rest looks fine. |
The Pipelines failure is due to an unrelated Linux issue, so ignoring that check to merge. |
Thanks again @paulmon for seeing this through! It's been a goal for a few years now, it's nice to see it finally happen :) |
This removes libffi_msvc and replaces it with the current version of libffi.
This builds on #3806
All test_ctypes tests pass on x86, and x64. Both debug and retail.
I also ran python -m test -j3 and there were no differences in test results before and after these changes.
https://bugs.python.org/issue35947