From 00dc9bcdcee91157e13cf2cb0a4093f67e16641e Mon Sep 17 00:00:00 2001 From: Zanie Blue Date: Tue, 11 Feb 2025 16:47:25 -0600 Subject: [PATCH 01/10] tcl/tk: upgrade from 8.6.12 -> 8.6.14 Let's stay modern. Should address #296. --- cpython-unix/build.py | 2 +- pythonbuild/downloads.py | 25 ------------------------- 2 files changed, 1 insertion(+), 26 deletions(-) diff --git a/cpython-unix/build.py b/cpython-unix/build.py index da66ba4e..5851acaa 100755 --- a/cpython-unix/build.py +++ b/cpython-unix/build.py @@ -896,7 +896,7 @@ def build_cpython( "itcl4.2.4", "tcl8", "tcl8.6", - "thread2.8.7", + "thread2.8.79", "tk8.6", ] diff --git a/pythonbuild/downloads.py b/pythonbuild/downloads.py index aff18afd..ea08c327 100644 --- a/pythonbuild/downloads.py +++ b/pythonbuild/downloads.py @@ -339,31 +339,6 @@ "size": 9497943, "sha256": "9b8e77d55f40ceaedd140ccca0daa804f0d43346d5abfcead9b547b5590f82f8", "version": "8.6.14", - "git_commit": "c624cc881bd0e5071dec9de4b120cbe9985d8c14", - }, - "tcl-8612": { - "url": "https://prdownloads.sourceforge.net/tcl/tcl8.6.12-src.tar.gz", - "size": 10353486, - "sha256": "26c995dd0f167e48b11961d891ee555f680c175f7173ff8cb829f4ebcde4c1a6", - "version": "8.6.12", - "library_names": ["tcl8.6"], - "licenses": ["TCL"], - "license_file": "LICENSE.tcl.txt", - }, - "tk-8612": { - "url": "https://prdownloads.sourceforge.net/tcl/tk8.6.12-src.tar.gz", - "size": 4515393, - "sha256": "12395c1f3fcb6bed2938689f797ea3cdf41ed5cb6c4766eec8ac949560310630", - "version": "8.6.12", - "library_names": ["tk8.6"], - "licenses": ["TCL"], - "license_file": "LICENSE.tcl.txt", - }, - "tk-windows-bin-8612": { - "url": "https://github.com/python/cpython-bin-deps/archive/e3c3e9a2856124aa32b608632a52742d479eb7a9.tar.gz", - "size": 6787654, - "sha256": "01ad9c663659224e075d487cbc33ea2fed7a225593965b79bed92ca7f79b676f", - "version": "8.6.12", "git_commit": "e3c3e9a2856124aa32b608632a52742d479eb7a9", }, "uuid": { From 64b30294d51a8529ec7b221dc998d66b9df912f5 Mon Sep 17 00:00:00 2001 From: Zanie Blue Date: Tue, 11 Feb 2025 16:48:16 -0600 Subject: [PATCH 02/10] Fix `tk-windows-bin.git_commit` value --- pythonbuild/downloads.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pythonbuild/downloads.py b/pythonbuild/downloads.py index ea08c327..c420aad2 100644 --- a/pythonbuild/downloads.py +++ b/pythonbuild/downloads.py @@ -339,7 +339,7 @@ "size": 9497943, "sha256": "9b8e77d55f40ceaedd140ccca0daa804f0d43346d5abfcead9b547b5590f82f8", "version": "8.6.14", - "git_commit": "e3c3e9a2856124aa32b608632a52742d479eb7a9", + "git_commit": "c624cc881bd0e5071dec9de4b120cbe9985d8c14", }, "uuid": { "url": "https://sourceforge.net/projects/libuuid/files/libuuid-1.0.3.tar.gz", From f5d0a23ead7f7b41a7961366618358c996ca20bd Mon Sep 17 00:00:00 2001 From: Zanie Blue Date: Wed, 4 Sep 2024 18:51:29 -0500 Subject: [PATCH 03/10] Attempt to remove the `zlib1.dll` from tcltk builds --- cpython-windows/build.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cpython-windows/build.py b/cpython-windows/build.py index 638a2c78..5d4bfdad 100644 --- a/cpython-windows/build.py +++ b/cpython-windows/build.py @@ -436,6 +436,13 @@ def hack_props( rb"%s\$(ArchName)\" % tcltk_path, ) + try: + static_replace_in_file( + tcltkprops_path, rb"zlib1.dll", rb"" + ) + except NoSearchStringError: + pass + # We want to statically link against OpenSSL. This requires using our own # OpenSSL build. This requires some hacking of various files. openssl_props = pcbuild_path / "openssl.props" From b625afc7212e7fe5d8094eb3af2ae1af10a16aa0 Mon Sep 17 00:00:00 2001 From: Zanie Blue Date: Wed, 1 Jan 2025 15:54:15 -0600 Subject: [PATCH 04/10] Revert accidental typo --- cpython-unix/build.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpython-unix/build.py b/cpython-unix/build.py index 5851acaa..da66ba4e 100755 --- a/cpython-unix/build.py +++ b/cpython-unix/build.py @@ -896,7 +896,7 @@ def build_cpython( "itcl4.2.4", "tcl8", "tcl8.6", - "thread2.8.79", + "thread2.8.7", "tk8.6", ] From c52ba1f2c842eb66b656a6db871eefd289f31b6f Mon Sep 17 00:00:00 2001 From: Zanie Blue Date: Wed, 1 Jan 2025 15:54:32 -0600 Subject: [PATCH 05/10] Revert "Attempt to remove the `zlib1.dll` from tcltk builds" This reverts commit 97b944863bac338eff82c4b8e61a3bb8ac1a7fa0. --- cpython-windows/build.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/cpython-windows/build.py b/cpython-windows/build.py index 5d4bfdad..638a2c78 100644 --- a/cpython-windows/build.py +++ b/cpython-windows/build.py @@ -436,13 +436,6 @@ def hack_props( rb"%s\$(ArchName)\" % tcltk_path, ) - try: - static_replace_in_file( - tcltkprops_path, rb"zlib1.dll", rb"" - ) - except NoSearchStringError: - pass - # We want to statically link against OpenSSL. This requires using our own # OpenSSL build. This requires some hacking of various files. openssl_props = pcbuild_path / "openssl.props" From e9b0ea64058555e2faf42485f69d63d4a81ed409 Mon Sep 17 00:00:00 2001 From: Zanie Blue Date: Mon, 13 Jan 2025 15:02:41 -0600 Subject: [PATCH 06/10] Delete `x86_64-w64-mingw32-nmakehlp.exe` from tcltk --- cpython-windows/build.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cpython-windows/build.py b/cpython-windows/build.py index 638a2c78..9c031176 100644 --- a/cpython-windows/build.py +++ b/cpython-windows/build.py @@ -1303,6 +1303,12 @@ 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 = DOWNLOADS["tk-windows-bin"]["git_commit"] + tcltk_path = td / ("cpython-bin-deps-%s" % tcltk_commit) + tcltk_arch = {"amd64": "amd64", "x86": "win32"}[arch] + (tcltk_path / tcltk_arch / "lib" / "nmake" / "x86_64-w64-mingw32-nmakehlp.exe").unlink() + cpython_source_path = td / ("Python-%s" % python_version) pcbuild_path = cpython_source_path / "PCbuild" From 688151472f694f26b19a5e165f2f9aea39a27807 Mon Sep 17 00:00:00 2001 From: Zanie Blue Date: Mon, 13 Jan 2025 15:06:44 -0600 Subject: [PATCH 07/10] Allow bundled zlib1 --- src/validation.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/validation.rs b/src/validation.rs index 4bb28de0..017ebbb8 100644 --- a/src/validation.rs +++ b/src/validation.rs @@ -135,6 +135,8 @@ const PE_ALLOWED_LIBRARIES: &[&str] = &[ "sqlite3.dll", "tcl86t.dll", "tk86t.dll", + // Bundled with tk + "zlib1.dll", ]; // CPython 3.14 uses tcl/tk 8.6.14+ which includes a bundled zlib and dynamically links to msvcrt. From b307429e5a75adef3b599bb05ce96003984ce4e6 Mon Sep 17 00:00:00 2001 From: Zanie Blue Date: Mon, 13 Jan 2025 23:20:52 -0600 Subject: [PATCH 08/10] Reformat --- cpython-windows/build.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cpython-windows/build.py b/cpython-windows/build.py index 9c031176..087f3fc9 100644 --- a/cpython-windows/build.py +++ b/cpython-windows/build.py @@ -1307,7 +1307,13 @@ def build_cpython( tcltk_commit = DOWNLOADS["tk-windows-bin"]["git_commit"] tcltk_path = td / ("cpython-bin-deps-%s" % tcltk_commit) tcltk_arch = {"amd64": "amd64", "x86": "win32"}[arch] - (tcltk_path / tcltk_arch / "lib" / "nmake" / "x86_64-w64-mingw32-nmakehlp.exe").unlink() + ( + tcltk_path + / tcltk_arch + / "lib" + / "nmake" + / "x86_64-w64-mingw32-nmakehlp.exe" + ).unlink() cpython_source_path = td / ("Python-%s" % python_version) pcbuild_path = cpython_source_path / "PCbuild" From e829b83d09f4ae633be6e2622c8e9b62abff0562 Mon Sep 17 00:00:00 2001 From: Zanie Blue Date: Mon, 13 Jan 2025 23:21:01 -0600 Subject: [PATCH 09/10] Add `msvcrt.dll` to allowed libraries --- src/validation.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/validation.rs b/src/validation.rs index 017ebbb8..d4c1f889 100644 --- a/src/validation.rs +++ b/src/validation.rs @@ -99,6 +99,7 @@ const PE_ALLOWED_LIBRARIES: &[&str] = &[ "IPHLPAPI.DLL", "KERNEL32.dll", "msi.dll", + "msvcrt.dll", "NETAPI32.dll", "ole32.dll", "OLEAUT32.dll", From c349f9b91c06d70329bf4f8b7810457436194a56 Mon Sep 17 00:00:00 2001 From: Zanie Blue Date: Tue, 11 Feb 2025 16:49:35 -0600 Subject: [PATCH 10/10] Drop 8612 special case --- cpython-windows/build.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/cpython-windows/build.py b/cpython-windows/build.py index 087f3fc9..394e6578 100644 --- a/cpython-windows/build.py +++ b/cpython-windows/build.py @@ -114,7 +114,7 @@ "_lzma": ["xz"], "_sqlite3": ["sqlite"], "_ssl": ["openssl"], - "_tkinter": ["tcl-8612", "tk-8612", "tix"], + "_tkinter": ["tcl", "tk", "tix"], "_uuid": ["uuid"], "zlib": ["zlib"], } @@ -362,7 +362,7 @@ def hack_props( if meets_python_minimum_version(python_version, "3.14"): tcltk_commit = DOWNLOADS["tk-windows-bin"]["git_commit"] else: - tcltk_commit = DOWNLOADS["tk-windows-bin-8612"]["git_commit"] + tcltk_commit = DOWNLOADS["tk-windows-bin"]["git_commit"] sqlite_path = td / ("sqlite-autoconf-%s" % sqlite_version) bzip2_path = td / ("bzip2-%s" % bzip2_version) @@ -1138,10 +1138,6 @@ 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": - name = name.replace("-8612", "") - download_entry = DOWNLOADS[name] # This will raise if no license metadata defined. This is @@ -1230,7 +1226,7 @@ def build_cpython( ) else: tk_bin_archive = download_entry( - "tk-windows-bin-8612", BUILD, local_name="tk-windows-bin.tar.gz" + "tk-windows-bin", BUILD, local_name="tk-windows-bin.tar.gz" ) # CPython 3.13+ no longer uses a bundled `mpdecimal` version so we build it