@@ -1448,8 +1448,7 @@ def build_openssl_for_arch(
1448
1448
configure = "VC-WIN64-ARM"
1449
1449
prefix = "arm64" # TODO check it ???
1450
1450
else :
1451
- print ("invalid architecture: %s" % arch )
1452
- sys .exit (1 )
1451
+ raise Exception ("unhandled architecture: %s" % arch )
1453
1452
1454
1453
# The official CPython OpenSSL builds hack ms/uplink.c to change the
1455
1454
# ``GetModuleHandle(NULL)`` invocation to load things from _ssl.pyd
@@ -1549,7 +1548,7 @@ def build_openssl(
1549
1548
jom_archive = jom_archive ,
1550
1549
)
1551
1550
else :
1552
- raise ValueError ("unhandled arch : %s" % arch )
1551
+ raise Exception ("unhandled architecture : %s" % arch )
1553
1552
1554
1553
install = td / "out"
1555
1554
@@ -1660,9 +1659,14 @@ def build_libffi(
1660
1659
if arch == "x86" :
1661
1660
args .append ("-x86" )
1662
1661
artifacts_path = ffi_source_path / "i686-pc-cygwin"
1663
- else :
1662
+ elif arch == "arm64" :
1663
+ args .append ("-arm64" )
1664
+ artifacts_path = ffi_source_path / "aarch64-w64-cygwin"
1665
+ elif arch == "amd64" :
1664
1666
args .append ("-x64" )
1665
1667
artifacts_path = ffi_source_path / "x86_64-w64-cygwin"
1668
+ else :
1669
+ raise Exception ("unhandled architecture: %s" % arch )
1666
1670
1667
1671
subprocess .run (args , env = env , check = True )
1668
1672
@@ -2024,7 +2028,7 @@ def build_cpython(
2024
2028
build_platform = "arm64"
2025
2029
build_directory = "arm64"
2026
2030
else :
2027
- raise ValueError ("unhandled arch : %s" % arch )
2031
+ raise Exception ("unhandled architecture : %s" % arch )
2028
2032
2029
2033
with tempfile .TemporaryDirectory (prefix = "python-build-" ) as td :
2030
2034
td = pathlib .Path (td )
@@ -2051,7 +2055,7 @@ def build_cpython(
2051
2055
# We need all the OpenSSL library files in the same directory to appease
2052
2056
# install rules.
2053
2057
if not static :
2054
- openssl_arch = {"amd64" : "amd64" , "x86" : "win32" }[arch ]
2058
+ openssl_arch = {"amd64" : "amd64" , "x86" : "win32" }[arch ] # TODO
2055
2059
openssl_root = td / "openssl" / openssl_arch
2056
2060
openssl_bin_path = openssl_root / "bin"
2057
2061
openssl_lib_path = openssl_root / "lib"
@@ -2459,9 +2463,11 @@ def main():
2459
2463
elif os .environ .get ("Platform" ) == "arm64" :
2460
2464
target_triple = "aarch64-pc-windows-msvc"
2461
2465
arch = "arm64"
2462
- else :
2466
+ elif os . environ . get ( "Platform" ) == "x64" :
2463
2467
target_triple = "x86_64-pc-windows-msvc"
2464
2468
arch = "amd64"
2469
+ else :
2470
+ raise Exception ("unhandled architecture: %s" % os .environ .get ("Platform" ))
2465
2471
2466
2472
# TODO need better dependency checking.
2467
2473
openssl_archive = BUILD / ("openssl-%s-%s.tar" % (target_triple , args .profile ))
0 commit comments