From 2350279c36ada3d0d0a0aa151984c0ed930897bc Mon Sep 17 00:00:00 2001 From: Zanie Blue Date: Mon, 14 Apr 2025 18:54:43 -0500 Subject: [PATCH 01/18] Add ARM64 builds for Windows Co-authored-by: Adrian Antkowiak --- ci-runners.yaml | 5 ++++ ci-targets.yaml | 17 +++++++++++++ cpython-windows/build.py | 53 ++++++++++++++++++++++++++++++++++------ 3 files changed, 68 insertions(+), 7 deletions(-) diff --git a/ci-runners.yaml b/ci-runners.yaml index aeb0e5ca..27a3b84e 100644 --- a/ci-runners.yaml +++ b/ci-runners.yaml @@ -35,3 +35,8 @@ windows-latest: arch: x86_64 platform: windows free: true + +windows-11-arm: + arch: aarch64 + platform: windows + free: false diff --git a/ci-targets.yaml b/ci-targets.yaml index 70078e87..20b5be53 100644 --- a/ci-targets.yaml +++ b/ci-targets.yaml @@ -384,3 +384,20 @@ windows: - options: - freethreaded+pgo minimum-python-version: "3.13" + + aarch64-pc-windows-msvc: + arch: aarch64 + vcvars: vcvarsamd64_arm64.bat + python_versions: + - "3.9" + - "3.10" + - "3.11" + - "3.12" + - "3.13" + - "3.14" + build_options: + - pgo + build_options_conditional: + - options: + - freethreaded+pgo + minimum-python-version: "3.13" diff --git a/cpython-windows/build.py b/cpython-windows/build.py index 7e4d78ac..4ba735af 100644 --- a/cpython-windows/build.py +++ b/cpython-windows/build.py @@ -444,6 +444,8 @@ def hack_props( suffix = b"-x64" elif arch == "win32": suffix = b"" + elif arch == "arm64": + suffix = b"" else: raise Exception("unhandled architecture: %s" % arch) @@ -708,9 +710,11 @@ def build_openssl_for_arch( elif arch == "amd64": configure = "VC-WIN64A" prefix = "64" + elif arch == "arm64": + configure = "VC-WIN64-ARM" + prefix = "arm64" else: - print("invalid architecture: %s" % arch) - sys.exit(1) + raise Exception("unhandled architecture: %s" % arch) # The official CPython OpenSSL builds hack ms/uplink.c to change the # ``GetModuleHandle(NULL)`` invocation to load things from _ssl.pyd @@ -758,6 +762,12 @@ def build_openssl_for_arch( log("copying %s to %s" % (source, dest)) shutil.copyfile(source, dest) + # Copy `applink.c` to the include directory. + source_applink = source_root / "ms" / "applink.c" + dest_applink = install_root / "include" / "openssl" / "applink.c" + log("copying %s to %s" % (source_applink, dest_applink)) + shutil.copyfile(source_applink, dest_applink) + def build_openssl( entry: str, @@ -779,6 +789,7 @@ def build_openssl( root_32 = td / "x86" root_64 = td / "x64" + root_arm64 = td / "arm64" if arch == "x86": root_32.mkdir() @@ -802,13 +813,28 @@ def build_openssl( root_64, jom_archive=jom_archive, ) + elif arch == "arm64": + root_arm64.mkdir() + build_openssl_for_arch( + perl_path, + "arm64", + openssl_archive, + openssl_version, + nasm_archive, + root_arm64, + jom_archive=jom_archive, + ) else: - raise ValueError("unhandled arch: %s" % arch) + raise Exception("unhandled architecture: %s" % arch) install = td / "out" if arch == "x86": shutil.copytree(root_32 / "install" / "32", install / "openssl" / "win32") + elif arch == "arm64": + shutil.copytree( + root_arm64 / "install" / "arm64", install / "openssl" / "arm64" + ) else: shutil.copytree(root_64 / "install" / "64", install / "openssl" / "amd64") @@ -879,9 +905,14 @@ def build_libffi( if arch == "x86": args.append("-x86") artifacts_path = ffi_source_path / "i686-pc-cygwin" - else: + elif arch == "arm64": + args.append("-arm64") + artifacts_path = ffi_source_path / "aarch64-w64-cygwin" + elif arch == "amd64": args.append("-x64") artifacts_path = ffi_source_path / "x86_64-w64-cygwin" + else: + raise Exception("unhandled architecture: %s" % arch) subprocess.run(args, env=env, check=True) @@ -1259,8 +1290,11 @@ def build_cpython( elif arch == "x86": build_platform = "win32" build_directory = "win32" + elif arch == "arm64": + build_platform = "arm64" + build_directory = "arm64" else: - raise ValueError("unhandled arch: %s" % arch) + raise Exception("unhandled architecture: %s" % arch) tempdir_opts = ( {"ignore_cleanup_errors": True} if sys.version_info >= (3, 12) else {} @@ -1293,7 +1327,7 @@ def build_cpython( # We need all the OpenSSL library files in the same directory to appease # install rules. - openssl_arch = {"amd64": "amd64", "x86": "win32"}[arch] + openssl_arch = {"amd64": "amd64", "x86": "win32", "arm64": "arm64"}[arch] openssl_root = td / "openssl" / openssl_arch openssl_bin_path = openssl_root / "bin" openssl_lib_path = openssl_root / "lib" @@ -1749,9 +1783,14 @@ def main() -> None: if os.environ.get("Platform") == "x86": target_triple = "i686-pc-windows-msvc" arch = "x86" - else: + elif os.environ.get("Platform") == "arm64": + target_triple = "aarch64-pc-windows-msvc" + arch = "arm64" + elif os.environ.get("Platform") == "x64": target_triple = "x86_64-pc-windows-msvc" arch = "amd64" + else: + raise Exception("unhandled architecture: %s" % os.environ.get("Platform")) # TODO need better dependency checking. From 068e2b9d682bac11faf294386ba36ca03ba34a93 Mon Sep 17 00:00:00 2001 From: Zanie Blue Date: Tue, 15 Apr 2025 19:33:17 -0500 Subject: [PATCH 02/18] Add `arm64` to `collect_python_build_artifacts` --- cpython-windows/build.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cpython-windows/build.py b/cpython-windows/build.py index 4ba735af..6d43e999 100644 --- a/cpython-windows/build.py +++ b/cpython-windows/build.py @@ -1074,6 +1074,8 @@ def find_additional_dependencies(project: pathlib.Path): abi_platform = "win_amd64" elif arch == "win32": abi_platform = "win32" + elif arch == "arm64": + abi_platform = "arm64" else: raise ValueError("unhandled arch: %s" % arch) From 2711fb9a5b998e03e56f4784c74c705f8fa1e9ad Mon Sep 17 00:00:00 2001 From: Zanie Blue Date: Tue, 15 Apr 2025 19:38:46 -0500 Subject: [PATCH 03/18] Use the newer tcl-tk bin for arm64 builds --- cpython-windows/build.py | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/cpython-windows/build.py b/cpython-windows/build.py index 6d43e999..0cf84828 100644 --- a/cpython-windows/build.py +++ b/cpython-windows/build.py @@ -359,7 +359,7 @@ def hack_props( mpdecimal_version = DOWNLOADS["mpdecimal"]["version"] - if meets_python_minimum_version(python_version, "3.14"): + if meets_python_minimum_version(python_version, "3.14") or arch == "arm64": tcltk_commit = DOWNLOADS["tk-windows-bin"]["git_commit"] else: tcltk_commit = DOWNLOADS["tk-windows-bin-8612"]["git_commit"] @@ -486,6 +486,7 @@ def hack_project_files( cpython_source_path: pathlib.Path, build_directory: str, python_version: str, + arch: str, ): """Hacks Visual Studio project files to work with our build.""" @@ -583,9 +584,10 @@ def hack_project_files( # have a standalone zlib DLL, so we remove references to it. For Python # 3.14+, we're using tk-windows-bin 8.6.14 which includes a prebuilt zlib # DLL, so we skip this patch there. - if meets_python_minimum_version( - python_version, "3.12" - ) and meets_python_maximum_version(python_version, "3.13"): + # On arm64, we use the new version of tk-windows-bin for all versions. + if meets_python_minimum_version(python_version, "3.12") and ( + meets_python_maximum_version(python_version, "3.13") or arch == "arm64" + ): static_replace_in_file( pcbuild_path / "_tkinter.vcxproj", rb'<_TclTkDLL Include="$(tcltkdir)\bin\$(tclZlibDllName)" />', @@ -1175,8 +1177,8 @@ def find_additional_dependencies(project: pathlib.Path): if name == "openssl": name = openssl_entry - # On 3.14+, we use the latest tcl/tk version - if ext == "_tkinter" and python_majmin == "314": + # On 3.14+ and aarch64, we use the latest tcl/tk version + if ext == "_tkinter" and (python_majmin == "314" or arch == "arm64"): name = name.replace("-8612", "") download_entry = DOWNLOADS[name] @@ -1259,9 +1261,11 @@ def build_cpython( setuptools_wheel = download_entry("setuptools", BUILD) pip_wheel = download_entry("pip", BUILD) - # On CPython 3.14+, we use the latest tcl/tk version which has additional runtime - # dependencies, so we are conservative and use the old version elsewhere. - if meets_python_minimum_version(python_version, "3.14"): + # On CPython 3.14+, we use the latest tcl/tk version which has additional + # runtime dependencies, so we are conservative and use the old version + # elsewhere. The old version isn't built for arm64, so we use the new + # version there too + if meets_python_minimum_version(python_version, "3.14") or arch == "arm64": tk_bin_archive = download_entry( "tk-windows-bin", BUILD, local_name="tk-windows-bin.tar.gz" ) @@ -1364,6 +1368,7 @@ def build_cpython( cpython_source_path, build_directory, python_version=python_version, + arch=arch, ) if pgo: From cab84a5ddc2dbb2fc8e8526382ec42e6e9d4a2ee Mon Sep 17 00:00:00 2001 From: Zanie Blue Date: Wed, 16 Apr 2025 08:46:49 -0500 Subject: [PATCH 04/18] Add recognized triple --- src/validation.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/validation.rs b/src/validation.rs index 747cdaed..e5accb4f 100644 --- a/src/validation.rs +++ b/src/validation.rs @@ -33,6 +33,7 @@ use { const RECOGNIZED_TRIPLES: &[&str] = &[ "aarch64-apple-darwin", "aarch64-apple-ios", + "aarch64-pc-windows-msvc", "aarch64-unknown-linux-gnu", "armv7-unknown-linux-gnueabi", "armv7-unknown-linux-gnueabihf", From 8e9d8fb446d07ced6f26e7069553f566703c2986 Mon Sep 17 00:00:00 2001 From: Zanie Blue Date: Wed, 16 Apr 2025 08:49:20 -0500 Subject: [PATCH 05/18] All Tcl/Tk patch to fail --- cpython-windows/build.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/cpython-windows/build.py b/cpython-windows/build.py index 0cf84828..44c9a2ae 100644 --- a/cpython-windows/build.py +++ b/cpython-windows/build.py @@ -588,11 +588,14 @@ def hack_project_files( if meets_python_minimum_version(python_version, "3.12") and ( meets_python_maximum_version(python_version, "3.13") or arch == "arm64" ): - static_replace_in_file( - pcbuild_path / "_tkinter.vcxproj", - rb'<_TclTkDLL Include="$(tcltkdir)\bin\$(tclZlibDllName)" />', - rb"", - ) + try: + static_replace_in_file( + pcbuild_path / "_tkinter.vcxproj", + rb'<_TclTkDLL Include="$(tcltkdir)\bin\$(tclZlibDllName)" />', + rb"", + ) + except NoSearchStringError: + pass # We don't need to produce python_uwp.exe and its *w variant. Or the # python3.dll, pyshellext, or pylauncher. From 6cf34b114506365e8131ee869464349516f9f4a3 Mon Sep 17 00:00:00 2001 From: Zanie Blue Date: Wed, 16 Apr 2025 08:49:45 -0500 Subject: [PATCH 06/18] Update abi platform --- cpython-windows/build.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpython-windows/build.py b/cpython-windows/build.py index 44c9a2ae..5bffede7 100644 --- a/cpython-windows/build.py +++ b/cpython-windows/build.py @@ -1080,7 +1080,7 @@ def find_additional_dependencies(project: pathlib.Path): elif arch == "win32": abi_platform = "win32" elif arch == "arm64": - abi_platform = "arm64" + abi_platform = "win__arm64" else: raise ValueError("unhandled arch: %s" % arch) From 5525586f2bd910c3ea167eaf604a23e29641126c Mon Sep 17 00:00:00 2001 From: Zanie Blue Date: Wed, 16 Apr 2025 09:01:30 -0500 Subject: [PATCH 07/18] Disable 3.9 / 3.10 --- ci-targets.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ci-targets.yaml b/ci-targets.yaml index 20b5be53..c7b4bd12 100644 --- a/ci-targets.yaml +++ b/ci-targets.yaml @@ -389,8 +389,9 @@ windows: arch: aarch64 vcvars: vcvarsamd64_arm64.bat python_versions: - - "3.9" - - "3.10" + # On 3.9 / 3.10, `_tkinter` is failing to be included in the build + # - "3.9" + # - "3.10" - "3.11" - "3.12" - "3.13" From f1a8cf2fd9eaba4061e0c9be056f922ef10e1617 Mon Sep 17 00:00:00 2001 From: Zanie Blue Date: Wed, 16 Apr 2025 11:31:28 -0500 Subject: [PATCH 08/18] Add platformt ag entry --- src/validation.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/validation.rs b/src/validation.rs index e5accb4f..d73ad7e0 100644 --- a/src/validation.rs +++ b/src/validation.rs @@ -497,6 +497,7 @@ static PLATFORM_TAG_BY_TRIPLE: Lazy> = Lazy: [ ("aarch64-apple-darwin", "macosx-11.0-arm64"), ("aarch64-apple-ios", "iOS-aarch64"), + ("aarch64-pc-windows-msvc", "win-arm64"), ("aarch64-unknown-linux-gnu", "linux-aarch64"), ("armv7-unknown-linux-gnueabi", "linux-arm"), ("armv7-unknown-linux-gnueabihf", "linux-arm"), From 431fa58954e966dcc9beacd39c302f95a7222d81 Mon Sep 17 00:00:00 2001 From: Zanie Blue Date: Wed, 16 Apr 2025 12:52:14 -0500 Subject: [PATCH 09/18] Update validation for arm64 --- src/validation.rs | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/validation.rs b/src/validation.rs index d73ad7e0..aa6cc07f 100644 --- a/src/validation.rs +++ b/src/validation.rs @@ -18,7 +18,7 @@ use { macho::{LoadCommandVariant, MachHeader, Nlist}, pe::{ImageNtHeaders, PeFile, PeFile32, PeFile64}, }, - Endianness, FileKind, Object, SectionIndex, SymbolScope, + Architecture, Endianness, FileKind, Object, SectionIndex, SymbolScope, }, once_cell::sync::Lazy, std::{ @@ -118,6 +118,7 @@ const PE_ALLOWED_LIBRARIES: &[&str] = &[ "libcrypto-1_1.dll", "libcrypto-1_1-x64.dll", "libcrypto-3.dll", + "libcrypto-3-arm64.dll", "libcrypto-3-x64.dll", "libffi-8.dll", "libssl-1_1.dll", @@ -138,8 +139,9 @@ const PE_ALLOWED_LIBRARIES: &[&str] = &[ "tk86t.dll", ]; -// CPython 3.14 uses tcl/tk 8.6.14+ which includes a bundled zlib and dynamically links to msvcrt. +// CPython 3.14 and ARM64 use tcl/tk 8.6.14+ which includes a bundled zlib and dynamically links to msvcrt. const PE_ALLOWED_LIBRARIES_314: &[&str] = &["msvcrt.dll", "zlib1.dll"]; +const PE_ALLOWED_LIBRARIES_ARM64: &[&str] = &["msvcrt.dll", "zlib1.dll"]; static GLIBC_MAX_VERSION_BY_TRIPLE: Lazy>> = Lazy::new(|| { @@ -1371,15 +1373,17 @@ fn validate_pe<'data, Pe: ImageNtHeaders>( let lib = String::from_utf8(lib.to_vec())?; match python_major_minor { - "3.9" | "3.10" | "3.11" | "3.12" | "3.13" => {} + "3.11" | "3.12" | "3.13" if pe.architecture() == Architecture::Aarch64 => { + if PE_ALLOWED_LIBRARIES_ARM64.contains(&lib.as_str()) { + continue; + } + } "3.14" => { if PE_ALLOWED_LIBRARIES_314.contains(&lib.as_str()) { continue; } } - _ => { - panic!("unhandled Python version: {}", python_major_minor); - } + _ => {} } if !PE_ALLOWED_LIBRARIES.contains(&lib.as_str()) { From 0f956d4064cc904872295849612eedc5c13446a4 Mon Sep 17 00:00:00 2001 From: Zanie Blue Date: Wed, 16 Apr 2025 13:51:38 -0500 Subject: [PATCH 10/18] Allow arm64 libssl --- src/validation.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/validation.rs b/src/validation.rs index aa6cc07f..4473c98f 100644 --- a/src/validation.rs +++ b/src/validation.rs @@ -124,6 +124,7 @@ const PE_ALLOWED_LIBRARIES: &[&str] = &[ "libssl-1_1.dll", "libssl-1_1-x64.dll", "libssl-3.dll", + "libssl-3-arm64.dll", "libssl-3-x64.dll", "python3.dll", "python39.dll", From 3bbca754c5e2a25090ea74e758136c2cac9fd57d Mon Sep 17 00:00:00 2001 From: Zanie Blue Date: Wed, 16 Apr 2025 13:52:22 -0500 Subject: [PATCH 11/18] Fix double underscore --- cpython-windows/build.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpython-windows/build.py b/cpython-windows/build.py index 5bffede7..df925ddf 100644 --- a/cpython-windows/build.py +++ b/cpython-windows/build.py @@ -1080,7 +1080,7 @@ def find_additional_dependencies(project: pathlib.Path): elif arch == "win32": abi_platform = "win32" elif arch == "arm64": - abi_platform = "win__arm64" + abi_platform = "win_arm64" else: raise ValueError("unhandled arch: %s" % arch) From 858f2b6053cbf8ef0e5c18103f0c35c7b6825223 Mon Sep 17 00:00:00 2001 From: Zanie Blue Date: Wed, 16 Apr 2025 14:08:45 -0500 Subject: [PATCH 12/18] Add timeout to jobs --- .github/workflows/windows.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index a7535c68..ad8bbfe3 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -92,6 +92,7 @@ jobs: fi build: + timeout-minutes: 60 needs: - generate-matrix - pythonbuild From 865a8c536f56c20a926a3764b6f2f86bbe7d2315 Mon Sep 17 00:00:00 2001 From: Zanie Blue Date: Mon, 13 Jan 2025 15:02:41 -0600 Subject: [PATCH 13/18] Delete `x86_64-w64-mingw32-nmakehlp.exe` from tcltk --- cpython-windows/build.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/cpython-windows/build.py b/cpython-windows/build.py index df925ddf..490ccf7e 100644 --- a/cpython-windows/build.py +++ b/cpython-windows/build.py @@ -1268,14 +1268,10 @@ def build_cpython( # runtime dependencies, so we are conservative and use the old version # elsewhere. The old version isn't built for arm64, so we use the new # version there too - if meets_python_minimum_version(python_version, "3.14") or arch == "arm64": - tk_bin_archive = download_entry( - "tk-windows-bin", BUILD, local_name="tk-windows-bin.tar.gz" - ) - else: - tk_bin_archive = download_entry( - "tk-windows-bin-8612", BUILD, local_name="tk-windows-bin.tar.gz" - ) + tk_bin_entry = "tk-windows-bin" if meets_python_minimum_version(python_version, "3.14") or arch == "arm64" else "tk-windows-bin-8612" + tk_bin_archive = download_entry( + tk_bin_entry, BUILD, local_name="tk-windows-bin.tar.gz" + ) # CPython 3.13+ no longer uses a bundled `mpdecimal` version so we build it if meets_python_minimum_version(python_version, "3.13"): @@ -1350,6 +1346,11 @@ def build_cpython( log("copying %s to %s" % (source, dest)) shutil.copyfile(source, dest) + # Delete the tk nmake helper, it's not needed and links msvc + tcltk_commit: str = DOWNLOADS[tk_bin_entry]["git_commit"] + tcltk_path = td / ("cpython-bin-deps-%s" % tcltk_commit) + (tcltk_path / build_directory / "lib" / "nmake" / "x86_64-w64-mingw32-nmakehlp.exe").unlink() + cpython_source_path = td / ("Python-%s" % python_version) pcbuild_path = cpython_source_path / "PCbuild" From ca3a44af26a6b8ffc69ddf0f5a09c08ca6da6be0 Mon Sep 17 00:00:00 2001 From: Zanie Blue Date: Thu, 17 Apr 2025 12:54:22 -0500 Subject: [PATCH 14/18] Patch tcltk toggle? --- cpython-windows/build.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cpython-windows/build.py b/cpython-windows/build.py index 490ccf7e..c35e6643 100644 --- a/cpython-windows/build.py +++ b/cpython-windows/build.py @@ -499,6 +499,14 @@ def hack_project_files( python_version, ) + # `--include-tcltk` is forced off on arm64, undo that + # See https://github.com/python/cpython/pull/132650 + static_replace_in_file( + cpython_source_path / "PC" / "layout" / "main.py", + rb'if ns.arch in ("arm32", "arm64"):', + rb'if ns.arch == "arm32":', + ) + # Our SQLite directory is named weirdly. This throws off version detection # in the project file. Replace the parsing logic with a static string. sqlite3_version = DOWNLOADS["sqlite"]["actual_version"].encode("ascii") From 3af7e149ec760a57b802dd46cc40a78fd9ab2b01 Mon Sep 17 00:00:00 2001 From: Zanie Blue Date: Fri, 18 Apr 2025 21:25:30 -0500 Subject: [PATCH 15/18] Allow `api-ms-win-crt-private-l1-1-0.dll` --- src/validation.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/validation.rs b/src/validation.rs index 4473c98f..415f2d30 100644 --- a/src/validation.rs +++ b/src/validation.rs @@ -140,8 +140,13 @@ const PE_ALLOWED_LIBRARIES: &[&str] = &[ "tk86t.dll", ]; -// CPython 3.14 and ARM64 use tcl/tk 8.6.14+ which includes a bundled zlib and dynamically links to msvcrt. -const PE_ALLOWED_LIBRARIES_314: &[&str] = &["msvcrt.dll", "zlib1.dll"]; +// CPython 3.14 and ARM64 use a newer version of tcl/tk (8.6.14+) which includes a bundled zlib that +// dynamically links some system libraries +const PE_ALLOWED_LIBRARIES_314: &[&str] = &[ + "zlib1.dll", + "api-ms-win-crt-private-l1-1-0.dll", // zlib loads this library on arm64, 3.14+ + "msvcrt.dll", // zlib loads this library +]; const PE_ALLOWED_LIBRARIES_ARM64: &[&str] = &["msvcrt.dll", "zlib1.dll"]; static GLIBC_MAX_VERSION_BY_TRIPLE: Lazy>> = From a9748a964ea6a85ccaa4e035b863a8e9c179c8f4 Mon Sep 17 00:00:00 2001 From: Zanie Blue Date: Fri, 18 Apr 2025 21:26:16 -0500 Subject: [PATCH 16/18] Enable 3.9 and 3.10 again? --- ci-targets.yaml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ci-targets.yaml b/ci-targets.yaml index c7b4bd12..20b5be53 100644 --- a/ci-targets.yaml +++ b/ci-targets.yaml @@ -389,9 +389,8 @@ windows: arch: aarch64 vcvars: vcvarsamd64_arm64.bat python_versions: - # On 3.9 / 3.10, `_tkinter` is failing to be included in the build - # - "3.9" - # - "3.10" + - "3.9" + - "3.10" - "3.11" - "3.12" - "3.13" From 1bef02138ef0a1a1a6f2023c606b352f741e40cc Mon Sep 17 00:00:00 2001 From: Zanie Blue Date: Mon, 21 Apr 2025 09:07:30 -0500 Subject: [PATCH 17/18] Revert "Enable 3.9 and 3.10 again?" This reverts commit a9748a964ea6a85ccaa4e035b863a8e9c179c8f4. --- ci-targets.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ci-targets.yaml b/ci-targets.yaml index 20b5be53..c7b4bd12 100644 --- a/ci-targets.yaml +++ b/ci-targets.yaml @@ -389,8 +389,9 @@ windows: arch: aarch64 vcvars: vcvarsamd64_arm64.bat python_versions: - - "3.9" - - "3.10" + # On 3.9 / 3.10, `_tkinter` is failing to be included in the build + # - "3.9" + # - "3.10" - "3.11" - "3.12" - "3.13" From 4e98498d09222a8a380c860491debc15a330098b Mon Sep 17 00:00:00 2001 From: Zanie Blue Date: Mon, 21 Apr 2025 09:10:04 -0500 Subject: [PATCH 18/18] Use consistency exception type --- cpython-windows/build.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/cpython-windows/build.py b/cpython-windows/build.py index c35e6643..72d62c9d 100644 --- a/cpython-windows/build.py +++ b/cpython-windows/build.py @@ -1090,7 +1090,7 @@ def find_additional_dependencies(project: pathlib.Path): elif arch == "arm64": abi_platform = "win_arm64" else: - raise ValueError("unhandled arch: %s" % arch) + raise Exception("unhandled architecture: %s" % arch) if freethreaded: abi_tag = ".cp%st-%s" % (python_majmin, abi_platform) @@ -1276,7 +1276,11 @@ def build_cpython( # runtime dependencies, so we are conservative and use the old version # elsewhere. The old version isn't built for arm64, so we use the new # version there too - tk_bin_entry = "tk-windows-bin" if meets_python_minimum_version(python_version, "3.14") or arch == "arm64" else "tk-windows-bin-8612" + tk_bin_entry = ( + "tk-windows-bin" + if meets_python_minimum_version(python_version, "3.14") or arch == "arm64" + else "tk-windows-bin-8612" + ) tk_bin_archive = download_entry( tk_bin_entry, BUILD, local_name="tk-windows-bin.tar.gz" ) @@ -1357,7 +1361,13 @@ def build_cpython( # Delete the tk nmake helper, it's not needed and links msvc tcltk_commit: str = DOWNLOADS[tk_bin_entry]["git_commit"] tcltk_path = td / ("cpython-bin-deps-%s" % tcltk_commit) - (tcltk_path / build_directory / "lib" / "nmake" / "x86_64-w64-mingw32-nmakehlp.exe").unlink() + ( + tcltk_path + / build_directory + / "lib" + / "nmake" + / "x86_64-w64-mingw32-nmakehlp.exe" + ).unlink() cpython_source_path = td / ("Python-%s" % python_version) pcbuild_path = cpython_source_path / "PCbuild"