Skip to content

Commit

Permalink
windows: don't attempt to copy libffi DLL during static builds
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
indygreg committed Aug 23, 2020
1 parent 8c754e4 commit 3aa4306
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions cpython-windows/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -672,6 +672,12 @@ def copy_link_to_lib(p: pathlib.Path):
</Target>
"""

LIBFFI_PROPS_REMOVE_RULES = b"""
<Target Name="_CopyLIBFFIDLL" Inputs="@(_LIBFFIDLL)" Outputs="@(_LIBFFIDLL->'$(OutDir)%(Filename)%(Extension)')" AfterTargets="Build">
<Copy SourceFiles="@(_LIBFFIDLL)" DestinationFolder="$(OutDir)" />
</Target>
"""


def hack_props(
td: pathlib.Path,
Expand Down Expand Up @@ -793,6 +799,10 @@ def hack_props(
b"<AdditionalDependencies>libffi.lib;%(AdditionalDependencies)</AdditionalDependencies>",
)

static_replace_in_file(
libffi_props, LIBFFI_PROPS_REMOVE_RULES.strip().replace(b"\n", b"\r\n"), b""
)


def hack_project_files(
td: pathlib.Path,
Expand Down

0 comments on commit 3aa4306

Please sign in to comment.