From 309e29f7a150203e28841f621b1eb1f487357707 Mon Sep 17 00:00:00 2001 From: Gregory Szorc Date: Sat, 24 Aug 2024 14:08:16 -0700 Subject: [PATCH 1/9] tcl/tk: upgrade from 8.6.12 -> 8.6.14 Let's stay modern. Should address #296. --- cpython-unix/build-cpython.sh | 2 +- cpython-unix/build.py | 4 ++-- pythonbuild/downloads.py | 24 ++++++++++++------------ 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/cpython-unix/build-cpython.sh b/cpython-unix/build-cpython.sh index e7ed8cb1..1f4d41dc 100755 --- a/cpython-unix/build-cpython.sh +++ b/cpython-unix/build-cpython.sh @@ -1083,7 +1083,7 @@ if [ -d "${TOOLS_PATH}/deps/lib/tcl8" ]; then # Copy tcl/tk/tix resources needed by tkinter. mkdir ${ROOT}/out/python/install/lib/tcl # Keep this list in sync with tcl_library_paths. - for source in ${TOOLS_PATH}/deps/lib/{itcl4.2.2,tcl8,tcl8.6,thread2.8.7,tk8.6}; do + for source in ${TOOLS_PATH}/deps/lib/{itcl4.2.4,tcl8,tcl8.6,thread2.8.9,tk8.6}; do cp -av $source ${ROOT}/out/python/install/lib/ done diff --git a/cpython-unix/build.py b/cpython-unix/build.py index 60935417..1757fe9f 100755 --- a/cpython-unix/build.py +++ b/cpython-unix/build.py @@ -893,10 +893,10 @@ def build_cpython( python_info["tcl_library_path"] = "install/lib" python_info["tcl_library_paths"] = [ - "itcl4.2.2", + "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 983efa04..aae75e01 100644 --- a/pythonbuild/downloads.py +++ b/pythonbuild/downloads.py @@ -309,10 +309,10 @@ "version": "5.38.2.2", }, "tcl": { - "url": "https://prdownloads.sourceforge.net/tcl/tcl8.6.12-src.tar.gz", - "size": 10353486, - "sha256": "26c995dd0f167e48b11961d891ee555f680c175f7173ff8cb829f4ebcde4c1a6", - "version": "8.6.12", + "url": "https://prdownloads.sourceforge.net/tcl/tcl8.6.14-src.tar.gz", + "size": 11627322, + "sha256": "5880225babf7954c58d4fb0f5cf6279104ce1cd6aa9b71e9a6322540e1c4de66", + "version": "8.6.14", "library_names": ["tcl8.6"], "licenses": ["TCL"], "license_file": "LICENSE.tcl.txt", @@ -326,19 +326,19 @@ "license_file": "LICENSE.tix.txt", }, "tk": { - "url": "https://prdownloads.sourceforge.net/tcl/tk8.6.12-src.tar.gz", - "size": 4515393, - "sha256": "12395c1f3fcb6bed2938689f797ea3cdf41ed5cb6c4766eec8ac949560310630", - "version": "8.6.12", + "url": "https://prdownloads.sourceforge.net/tcl/tk8.6.14-src.tar.gz", + "size": 4510695, + "sha256": "8ffdb720f47a6ca6107eac2dd877e30b0ef7fac14f3a84ebbd0b3612cee41a94", + "version": "8.6.14", "library_names": ["tk8.6"], "licenses": ["TCL"], "license_file": "LICENSE.tcl.txt", }, "tk-windows-bin": { - "url": "https://github.com/python/cpython-bin-deps/archive/e3c3e9a2856124aa32b608632a52742d479eb7a9.tar.gz", - "size": 6787654, - "sha256": "01ad9c663659224e075d487cbc33ea2fed7a225593965b79bed92ca7f79b676f", - "version": "8.6.12", + "url": "https://github.com/python/cpython-bin-deps/archive/c624cc881bd0e5071dec9de4b120cbe9985d8c14.tar.gz", + "size": 9497943, + "sha256": "9b8e77d55f40ceaedd140ccca0daa804f0d43346d5abfcead9b547b5590f82f8", + "version": "8.6.14", "git_commit": "e3c3e9a2856124aa32b608632a52742d479eb7a9", }, "uuid": { From 6a9e885eba425b4166b6efbf3f1ddacdfeac0915 Mon Sep 17 00:00:00 2001 From: Zanie Blue Date: Wed, 4 Sep 2024 12:59:57 -0500 Subject: [PATCH 2/9] Fix missing macOS framework for tcl/tk Required for missing `UTType` --- cpython-unix/extension-modules.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/cpython-unix/extension-modules.yml b/cpython-unix/extension-modules.yml index 1a195b04..968f8d81 100644 --- a/cpython-unix/extension-modules.yml +++ b/cpython-unix/extension-modules.yml @@ -689,6 +689,7 @@ _tkinter: - CoreGraphics - IOKit - QuartzCore + - UniformTypeIdentifiers _tokenize: minimum-python-version: "3.11" From b96ea576c78ef28119e9eb96a7c3d3d8d3a314c2 Mon Sep 17 00:00:00 2001 From: Zanie Blue Date: Wed, 4 Sep 2024 15:55:44 -0500 Subject: [PATCH 3/9] Fix `tk-windows-bin.git_commit` value --- cpython-windows/build.py | 2 +- pythonbuild/downloads.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cpython-windows/build.py b/cpython-windows/build.py index e410bf47..4c4305a7 100644 --- a/cpython-windows/build.py +++ b/cpython-windows/build.py @@ -566,7 +566,7 @@ def hack_project_files( rb'', ) - # We're still on the pre-built tk-windows-bin 8.6.12 which doesn't have a + # We're still on the pre-built tk-windows-bin 8.6.14 which doesn't have a # standalone zlib DLL. So remove references to it from 3.12+. if meets_python_minimum_version(python_version, "3.12"): static_replace_in_file( diff --git a/pythonbuild/downloads.py b/pythonbuild/downloads.py index aae75e01..0960f901 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 535b21deb5e6a3d8d9d04b1eb8238496e545a986 Mon Sep 17 00:00:00 2001 From: Zanie Blue Date: Wed, 4 Sep 2024 18:26:03 -0500 Subject: [PATCH 4/9] Allow `UniformTypeIdentifiers.framework` to be dynamically linked --- src/validation.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/validation.rs b/src/validation.rs index b8a27a06..f79d6c0c 100644 --- a/src/validation.rs +++ b/src/validation.rs @@ -394,6 +394,11 @@ static DARWIN_ALLOWED_DYLIBS: Lazy> = Lazy::new(|| { max_compatibility_version: "1.0.0".try_into().unwrap(), required: true, }, + MachOAllowedDylib { + name: "/System/Library/Frameworks/UniformTypeIdentifiers.framework/Versions/A/UniformTypeIdentifiers".to_string(), + max_compatibility_version: "1.0.0".try_into().unwrap(), + required: true, + }, MachOAllowedDylib { name: "/usr/lib/libedit.3.dylib".to_string(), max_compatibility_version: "2.0.0".try_into().unwrap(), From 2a19442ab91abd1cf1de441dc4d3d7b593cf23f2 Mon Sep 17 00:00:00 2001 From: Zanie Blue Date: Thu, 5 Sep 2024 07:41:05 -0500 Subject: [PATCH 5/9] Ban `uttype` weak symbol on Python 3.8 --- cpython-unix/build-cpython.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpython-unix/build-cpython.sh b/cpython-unix/build-cpython.sh index 1f4d41dc..a04677f1 100755 --- a/cpython-unix/build-cpython.sh +++ b/cpython-unix/build-cpython.sh @@ -473,7 +473,7 @@ if [ "${PYBUILD_PLATFORM}" = "macos" ]; then # symbol. if [ -n "${PYTHON_MEETS_MAXIMUM_VERSION_3_9}" ]; then if [ "${TARGET_TRIPLE}" != "aarch64-apple-darwin" ]; then - for symbol in clock_getres clock_gettime clock_settime faccessat fchmodat fchownat fdopendir fstatat futimens getentropy linkat mkdirat openat preadv pwritev readlinkat renameat symlinkat unlinkat utimensat; do + for symbol in clock_getres clock_gettime clock_settime faccessat fchmodat fchownat fdopendir fstatat futimens getentropy linkat mkdirat openat preadv pwritev readlinkat renameat symlinkat unlinkat utimensat uttype; do CONFIGURE_FLAGS="${CONFIGURE_FLAGS} ac_cv_func_${symbol}=no" done fi From 13c19bd5bba46953658b71c8363f833b95648dba Mon Sep 17 00:00:00 2001 From: Zanie Blue Date: Wed, 1 Jan 2025 15:54:15 -0600 Subject: [PATCH 6/9] 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 1757fe9f..5d4b5c9d 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 b209c0f9cc14aa29cc8d89e2b4b88f27baebe23a Mon Sep 17 00:00:00 2001 From: Zanie Blue Date: Mon, 13 Jan 2025 23:21:01 -0600 Subject: [PATCH 7/9] 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 f79d6c0c..d9018609 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 fc87b2d809c7e36393039e706acdd2a7e50e2097 Mon Sep 17 00:00:00 2001 From: Zanie Blue Date: Tue, 14 Jan 2025 12:18:39 -0600 Subject: [PATCH 8/9] Add 8612 versions of tcl/tk packages --- pythonbuild/downloads.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/pythonbuild/downloads.py b/pythonbuild/downloads.py index 0960f901..401bd171 100644 --- a/pythonbuild/downloads.py +++ b/pythonbuild/downloads.py @@ -341,6 +341,31 @@ "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": { "url": "https://sourceforge.net/projects/libuuid/files/libuuid-1.0.3.tar.gz", "size": 318256, From 85714a1e445344bc9a62820803d234640c3909a6 Mon Sep 17 00:00:00 2001 From: Zanie Blue Date: Tue, 14 Jan 2025 12:22:13 -0600 Subject: [PATCH 9/9] Use old tcl/tk on Windows --- cpython-windows/build.py | 8 ++++---- src/validation.rs | 6 ++++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/cpython-windows/build.py b/cpython-windows/build.py index 4c4305a7..4f833a4a 100644 --- a/cpython-windows/build.py +++ b/cpython-windows/build.py @@ -114,7 +114,7 @@ "_lzma": ["xz"], "_sqlite3": ["sqlite"], "_ssl": ["openssl"], - "_tkinter": ["tcl", "tk", "tix"], + "_tkinter": ["tcl-8612", "tk-8612", "tix"], "_uuid": ["uuid"], "zlib": ["zlib"], } @@ -355,7 +355,7 @@ def hack_props( sqlite_version = DOWNLOADS["sqlite"]["version"] xz_version = DOWNLOADS["xz"]["version"] zlib_version = DOWNLOADS["zlib"]["version"] - tcltk_commit = DOWNLOADS["tk-windows-bin"]["git_commit"] + tcltk_commit = DOWNLOADS["tk-windows-bin-8612"]["git_commit"] mpdecimal_version = DOWNLOADS["mpdecimal"]["version"] sqlite_path = td / ("sqlite-autoconf-%s" % sqlite_version) @@ -566,7 +566,7 @@ def hack_project_files( rb'', ) - # We're still on the pre-built tk-windows-bin 8.6.14 which doesn't have a + # We're still on the pre-built tk-windows-bin 8.6.12 which doesn't have a # standalone zlib DLL. So remove references to it from 3.12+. if meets_python_minimum_version(python_version, "3.12"): static_replace_in_file( @@ -1197,7 +1197,7 @@ def build_cpython( bzip2_archive = download_entry("bzip2", BUILD) sqlite_archive = download_entry("sqlite", BUILD) tk_bin_archive = download_entry( - "tk-windows-bin", BUILD, local_name="tk-windows-bin.tar.gz" + "tk-windows-bin-8612", BUILD, local_name="tk-windows-bin.tar.gz" ) xz_archive = download_entry("xz", BUILD) zlib_archive = download_entry("zlib", BUILD) diff --git a/src/validation.rs b/src/validation.rs index d9018609..fa19b4d3 100644 --- a/src/validation.rs +++ b/src/validation.rs @@ -99,7 +99,6 @@ const PE_ALLOWED_LIBRARIES: &[&str] = &[ "IPHLPAPI.DLL", "KERNEL32.dll", "msi.dll", - "msvcrt.dll", "NETAPI32.dll", "ole32.dll", "OLEAUT32.dll", @@ -239,7 +238,10 @@ static ELF_ALLOWED_LIBRARIES_BY_TRIPLE: Lazy