Skip to content

Commit 3aa4306

Browse files
committed
windows: don't attempt to copy libffi DLL during static builds
Without this, the build fails. This may have regressed as part of upgrading Python 3.8. But I'm unsure why, as I don't see an obvious diff in the CPython source code that would trigger it.
1 parent 8c754e4 commit 3aa4306

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

cpython-windows/build.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -672,6 +672,12 @@ def copy_link_to_lib(p: pathlib.Path):
672672
</Target>
673673
"""
674674

675+
LIBFFI_PROPS_REMOVE_RULES = b"""
676+
<Target Name="_CopyLIBFFIDLL" Inputs="@(_LIBFFIDLL)" Outputs="@(_LIBFFIDLL->'$(OutDir)%(Filename)%(Extension)')" AfterTargets="Build">
677+
<Copy SourceFiles="@(_LIBFFIDLL)" DestinationFolder="$(OutDir)" />
678+
</Target>
679+
"""
680+
675681

676682
def hack_props(
677683
td: pathlib.Path,
@@ -793,6 +799,10 @@ def hack_props(
793799
b"<AdditionalDependencies>libffi.lib;%(AdditionalDependencies)</AdditionalDependencies>",
794800
)
795801

802+
static_replace_in_file(
803+
libffi_props, LIBFFI_PROPS_REMOVE_RULES.strip().replace(b"\n", b"\r\n"), b""
804+
)
805+
796806

797807
def hack_project_files(
798808
td: pathlib.Path,

0 commit comments

Comments
 (0)