This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Cannot compile with libffi from source on Windows
Type: Stage: resolved
Components: Build, Windows Versions: Python 3.9, Python 3.8
process
Status: closed Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: AWhetter, paul.moore, steve.dower, tim.golden, zach.ware
Priority: normal Keywords:

Created on 2019-12-02 23:38 by AWhetter, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Messages (3)
msg357736 - (view) Author: Ashley Whetter (AWhetter) * Date: 2019-12-02 23:38
get_externals.bat downloads and extracts libffi to a versioned directory (much like the other external libraries). See https://github.com/python/cpython/blob/v3.8.0/PCbuild/get_externals.bat#L55
However the binary release is downloaded to an unversioned directory. See https://github.com/python/cpython/blob/v3.8.0/PCbuild/get_externals.bat#L79
The visual studio project looks for the unversioned directory (https://github.com/python/cpython/blob/v3.8.0/PCbuild/python.props#L62), and so the binaries are always used.

So it is possible to build from source, but you have to move libffi yourself after running `get_externals_bat --libffi-src`. I think the fix here is to make get_externals.bat and visual studio always use a versioned directory.
msg357739 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2019-12-03 00:16
The intent is that you'd build from source and then copy the binaries into the libffi directory (the *real* intent is that very few people should have to build libffi from source).

Can you tell us a bit more about what you were trying to achieve when you ran into this?
msg357741 - (view) Author: Ashley Whetter (AWhetter) * Date: 2019-12-03 00:50
Ah you're right. I was trying to install in the same way as previous versions. I didn't realise that calling prepare_*.bat was a separate step now.
Sorry about that.
History
Date User Action Args
2022-04-11 14:59:23adminsetgithub: 83138
2019-12-03 00:50:48AWhettersetstatus: open -> closed

messages: + msg357741
stage: resolved
2019-12-03 00:16:42steve.dowersetmessages: + msg357739
2019-12-02 23:38:33AWhettercreate