@@ -359,7 +359,7 @@ def hack_props(
359
359
360
360
mpdecimal_version = DOWNLOADS ["mpdecimal" ]["version" ]
361
361
362
- if meets_python_minimum_version (python_version , "3.14" ):
362
+ if meets_python_minimum_version (python_version , "3.14" ) or arch == "arm64" :
363
363
tcltk_commit = DOWNLOADS ["tk-windows-bin" ]["git_commit" ]
364
364
else :
365
365
tcltk_commit = DOWNLOADS ["tk-windows-bin-8612" ]["git_commit" ]
@@ -486,6 +486,7 @@ def hack_project_files(
486
486
cpython_source_path : pathlib .Path ,
487
487
build_directory : str ,
488
488
python_version : str ,
489
+ arch : str ,
489
490
):
490
491
"""Hacks Visual Studio project files to work with our build."""
491
492
@@ -583,9 +584,10 @@ def hack_project_files(
583
584
# have a standalone zlib DLL, so we remove references to it. For Python
584
585
# 3.14+, we're using tk-windows-bin 8.6.14 which includes a prebuilt zlib
585
586
# DLL, so we skip this patch there.
586
- if meets_python_minimum_version (
587
- python_version , "3.12"
588
- ) and meets_python_maximum_version (python_version , "3.13" ):
587
+ # On arm64, we use the new version of tk-windows-bin for all versions.
588
+ if meets_python_minimum_version (python_version , "3.12" ) and (
589
+ meets_python_maximum_version (python_version , "3.13" ) or arch == "arm64"
590
+ ):
589
591
static_replace_in_file (
590
592
pcbuild_path / "_tkinter.vcxproj" ,
591
593
rb'<_TclTkDLL Include="$(tcltkdir)\bin\$(tclZlibDllName)" />' ,
@@ -1175,8 +1177,8 @@ def find_additional_dependencies(project: pathlib.Path):
1175
1177
if name == "openssl" :
1176
1178
name = openssl_entry
1177
1179
1178
- # On 3.14+, we use the latest tcl/tk version
1179
- if ext == "_tkinter" and python_majmin == "314" :
1180
+ # On 3.14+ and aarch64 , we use the latest tcl/tk version
1181
+ if ext == "_tkinter" and ( python_majmin == "314" or arch == "arm64" ) :
1180
1182
name = name .replace ("-8612" , "" )
1181
1183
1182
1184
download_entry = DOWNLOADS [name ]
@@ -1259,9 +1261,11 @@ def build_cpython(
1259
1261
setuptools_wheel = download_entry ("setuptools" , BUILD )
1260
1262
pip_wheel = download_entry ("pip" , BUILD )
1261
1263
1262
- # On CPython 3.14+, we use the latest tcl/tk version which has additional runtime
1263
- # dependencies, so we are conservative and use the old version elsewhere.
1264
- if meets_python_minimum_version (python_version , "3.14" ):
1264
+ # On CPython 3.14+, we use the latest tcl/tk version which has additional
1265
+ # runtime dependencies, so we are conservative and use the old version
1266
+ # elsewhere. The old version isn't built for arm64, so we use the new
1267
+ # version there too
1268
+ if meets_python_minimum_version (python_version , "3.14" ) or arch == "arm64" :
1265
1269
tk_bin_archive = download_entry (
1266
1270
"tk-windows-bin" , BUILD , local_name = "tk-windows-bin.tar.gz"
1267
1271
)
@@ -1364,6 +1368,7 @@ def build_cpython(
1364
1368
cpython_source_path ,
1365
1369
build_directory ,
1366
1370
python_version = python_version ,
1371
+ arch = arch ,
1367
1372
)
1368
1373
1369
1374
if pgo :
0 commit comments