@@ -1184,7 +1184,9 @@ def build_openssl_for_arch(
1184
1184
shutil .copyfile (source , dest )
1185
1185
1186
1186
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
+ ):
1188
1190
"""Build OpenSSL from sources using the Perl executable specified."""
1189
1191
1190
1192
# First ensure the dependencies are in place.
@@ -1230,7 +1232,6 @@ def build_openssl(perl_path: pathlib.Path, arch: str, profile: str):
1230
1232
else :
1231
1233
shutil .copytree (root_64 / "install" / "64" , install / "openssl" / "amd64" )
1232
1234
1233
- dest_archive = BUILD / ("openssl-windows-%s-%s.tar" % (arch , profile ))
1234
1235
with dest_archive .open ("wb" ) as fh :
1235
1236
create_tar_from_directory (fh , install )
1236
1237
@@ -1596,7 +1597,9 @@ def find_additional_dependencies(project: pathlib.Path):
1596
1597
return res
1597
1598
1598
1599
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
+ ):
1600
1603
static = profile == "static"
1601
1604
pgo = "-pgo" in profile
1602
1605
@@ -1622,11 +1625,6 @@ def build_cpython(python_entry_name: str, arch: str, profile, libffi_archive=Non
1622
1625
setuptools_archive = download_entry ("setuptools" , BUILD )
1623
1626
pip_archive = download_entry ("pip" , BUILD )
1624
1627
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
-
1630
1628
if arch == "amd64" :
1631
1629
build_platform = "x64"
1632
1630
build_directory = "amd64"
@@ -1644,7 +1642,7 @@ def build_cpython(python_entry_name: str, arch: str, profile, libffi_archive=Non
1644
1642
for a in (
1645
1643
python_archive ,
1646
1644
bzip2_archive ,
1647
- openssl_bin_archive ,
1645
+ openssl_archive ,
1648
1646
pip_archive ,
1649
1647
sqlite_archive ,
1650
1648
tk_bin_archive ,
@@ -2018,25 +2016,38 @@ def main():
2018
2016
with log_path .open ("wb" ) as log_fh :
2019
2017
LOG_FH [0 ] = log_fh
2020
2018
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"
2022
2025
2023
2026
# 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 ():
2026
2029
perl_path = fetch_strawberry_perl () / "perl" / "bin" / "perl.exe"
2027
2030
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
+ )
2029
2034
2030
2035
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
+ )
2032
2039
if not libffi_archive .exists ():
2033
2040
build_libffi (args .python , arch , pathlib .Path (args .sh ), libffi_archive )
2034
2041
else :
2035
2042
libffi_archive = None
2036
2043
2037
2044
LOG_PREFIX [0 ] = "cpython"
2038
2045
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 ,
2040
2051
)
2041
2052
2042
2053
compress_python_archive (
0 commit comments