Skip to content

Commit 4f5efbc

Browse files
committed
windows: remove conditional building of libffi
This code existed to support CPython 3.7, which provided its own libffi. We always build libffi after CPython 3.8 so the code is unconditional.
1 parent 2ab0f47 commit 4f5efbc

File tree

1 file changed

+6
-17
lines changed

1 file changed

+6
-17
lines changed

cpython-windows/build.py

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -695,11 +695,7 @@ def copy_link_to_lib(p: pathlib.Path):
695695

696696

697697
def hack_props(
698-
td: pathlib.Path,
699-
pcbuild_path: pathlib.Path,
700-
arch: str,
701-
static: bool,
702-
building_libffi: bool,
698+
td: pathlib.Path, pcbuild_path: pathlib.Path, arch: str, static: bool,
703699
):
704700
# TODO can we pass props into msbuild.exe?
705701

@@ -804,7 +800,7 @@ def hack_props(
804800

805801
libffi_props = pcbuild_path / "libffi.props"
806802

807-
if static and building_libffi:
803+
if static:
808804
# For some reason the built .lib doesn't have the -7 suffix in
809805
# static build mode. This is possibly a side-effect of CPython's
810806
# libffi build script not officially supporting static-only builds.
@@ -824,19 +820,14 @@ def hack_project_files(
824820
cpython_source_path: pathlib.Path,
825821
build_directory: str,
826822
static: bool,
827-
building_libffi: bool,
828823
honor_allow_missing_preprocessor: bool,
829824
):
830825
"""Hacks Visual Studio project files to work with our build."""
831826

832827
pcbuild_path = cpython_source_path / "PCbuild"
833828

834829
hack_props(
835-
td,
836-
pcbuild_path,
837-
build_directory,
838-
static=static,
839-
building_libffi=building_libffi,
830+
td, pcbuild_path, build_directory, static=static,
840831
)
841832

842833
# Our SQLite directory is named weirdly. This throws off version detection
@@ -907,7 +898,7 @@ def hack_project_files(
907898
# hack pythoncore as a one-off to add the dependency. Ideally we would
908899
# handle this when hacking the extension's project. But it is easier to
909900
# do here.
910-
if static and building_libffi:
901+
if static:
911902
libffi_path = td / "libffi" / "libffi.lib"
912903
try:
913904
# Python 3.9 version
@@ -1907,7 +1898,7 @@ def build_cpython(
19071898
arch: str,
19081899
profile,
19091900
openssl_archive,
1910-
libffi_archive=None,
1901+
libffi_archive,
19111902
):
19121903
static = "static" in profile
19131904
pgo = "-pgo" in profile
@@ -1965,8 +1956,7 @@ def build_cpython(
19651956
for f in fs:
19661957
f.result()
19671958

1968-
if libffi_archive:
1969-
extract_tar_to_directory(libffi_archive, td)
1959+
extract_tar_to_directory(libffi_archive, td)
19701960

19711961
# We need all the OpenSSL library files in the same directory to appease
19721962
# install rules.
@@ -2006,7 +1996,6 @@ def build_cpython(
20061996
cpython_source_path,
20071997
build_directory,
20081998
static=static,
2009-
building_libffi=libffi_archive is not None,
20101999
honor_allow_missing_preprocessor=python_entry_name == "cpython-3.8",
20112000
)
20122001
hack_source_files(cpython_source_path, static=static)

0 commit comments

Comments
 (0)