Skip to content

Commit aa5e4ca

Browse files
committed
windows: rename openssl and libffi artifact archives
We incorporate the target triple, just like we now do on UNIX.
1 parent 9832551 commit aa5e4ca

File tree

1 file changed

+26
-15
lines changed

1 file changed

+26
-15
lines changed

cpython-windows/build.py

Lines changed: 26 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1184,7 +1184,9 @@ def build_openssl_for_arch(
11841184
shutil.copyfile(source, dest)
11851185

11861186

1187-
def build_openssl(perl_path: pathlib.Path, arch: str, profile: str):
1187+
def build_openssl(
1188+
perl_path: pathlib.Path, arch: str, profile: str, dest_archive: pathlib.Path
1189+
):
11881190
"""Build OpenSSL from sources using the Perl executable specified."""
11891191

11901192
# First ensure the dependencies are in place.
@@ -1230,7 +1232,6 @@ def build_openssl(perl_path: pathlib.Path, arch: str, profile: str):
12301232
else:
12311233
shutil.copytree(root_64 / "install" / "64", install / "openssl" / "amd64")
12321234

1233-
dest_archive = BUILD / ("openssl-windows-%s-%s.tar" % (arch, profile))
12341235
with dest_archive.open("wb") as fh:
12351236
create_tar_from_directory(fh, install)
12361237

@@ -1596,7 +1597,9 @@ def find_additional_dependencies(project: pathlib.Path):
15961597
return res
15971598

15981599

1599-
def build_cpython(python_entry_name: str, arch: str, profile, libffi_archive=None):
1600+
def build_cpython(
1601+
python_entry_name: str, arch: str, profile, openssl_archive, libffi_archive=None
1602+
):
16001603
static = profile == "static"
16011604
pgo = "-pgo" in profile
16021605

@@ -1622,11 +1625,6 @@ def build_cpython(python_entry_name: str, arch: str, profile, libffi_archive=Non
16221625
setuptools_archive = download_entry("setuptools", BUILD)
16231626
pip_archive = download_entry("pip", BUILD)
16241627

1625-
if static:
1626-
openssl_bin_archive = BUILD / ("openssl-windows-%s-static.tar" % arch)
1627-
else:
1628-
openssl_bin_archive = BUILD / ("openssl-windows-%s-shared.tar" % arch)
1629-
16301628
if arch == "amd64":
16311629
build_platform = "x64"
16321630
build_directory = "amd64"
@@ -1644,7 +1642,7 @@ def build_cpython(python_entry_name: str, arch: str, profile, libffi_archive=Non
16441642
for a in (
16451643
python_archive,
16461644
bzip2_archive,
1647-
openssl_bin_archive,
1645+
openssl_archive,
16481646
pip_archive,
16491647
sqlite_archive,
16501648
tk_bin_archive,
@@ -2018,25 +2016,38 @@ def main():
20182016
with log_path.open("wb") as log_fh:
20192017
LOG_FH[0] = log_fh
20202018

2021-
arch = "x86" if os.environ.get("Platform") == "x86" else "amd64"
2019+
if os.environ.get("Platform") == "x86":
2020+
target_triple = "i686-pc-windows-msvc"
2021+
arch = "x86"
2022+
else:
2023+
target_triple = "x86_64-pc-windows-msvc"
2024+
arch = "amd64"
20222025

20232026
# TODO need better dependency checking.
2024-
openssl_out = BUILD / ("openssl-windows-%s-%s.tar" % (arch, args.profile))
2025-
if not openssl_out.exists():
2027+
openssl_archive = BUILD / ("openssl-%s-%s.tar" % (target_triple, args.profile))
2028+
if not openssl_archive.exists():
20262029
perl_path = fetch_strawberry_perl() / "perl" / "bin" / "perl.exe"
20272030
LOG_PREFIX[0] = "openssl"
2028-
build_openssl(perl_path, arch, profile=args.profile)
2031+
build_openssl(
2032+
perl_path, arch, profile=args.profile, dest_archive=openssl_archive
2033+
)
20292034

20302035
if "3.7" not in args.python:
2031-
libffi_archive = BUILD / ("libffi-windows-%s-%s.tar" % (arch, args.profile))
2036+
libffi_archive = BUILD / (
2037+
"libffi-%s-%s.tar" % (target_triple, args.profile)
2038+
)
20322039
if not libffi_archive.exists():
20332040
build_libffi(args.python, arch, pathlib.Path(args.sh), libffi_archive)
20342041
else:
20352042
libffi_archive = None
20362043

20372044
LOG_PREFIX[0] = "cpython"
20382045
tar_path = build_cpython(
2039-
args.python, arch, profile=args.profile, libffi_archive=libffi_archive
2046+
args.python,
2047+
arch,
2048+
profile=args.profile,
2049+
openssl_archive=openssl_archive,
2050+
libffi_archive=libffi_archive,
20402051
)
20412052

20422053
compress_python_archive(

0 commit comments

Comments
 (0)