Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tcl/tk: upgrade from 8.6.12 -> 8.6.14 on Windows #313

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
22 changes: 15 additions & 7 deletions cpython-windows/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
"_lzma": ["xz"],
"_sqlite3": ["sqlite"],
"_ssl": ["openssl"],
"_tkinter": ["tcl-8612", "tk-8612", "tix"],
"_tkinter": ["tcl", "tk", "tix"],
"_uuid": ["uuid"],
"zlib": ["zlib"],
}
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -1303,6 +1299,18 @@ 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"

Expand Down
25 changes: 0 additions & 25 deletions pythonbuild/downloads.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,31 +341,6 @@
"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,
Expand Down
3 changes: 3 additions & 0 deletions src/validation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ const PE_ALLOWED_LIBRARIES: &[&str] = &[
"IPHLPAPI.DLL",
"KERNEL32.dll",
"msi.dll",
"msvcrt.dll",
"NETAPI32.dll",
"ole32.dll",
"OLEAUT32.dll",
Expand Down Expand Up @@ -135,6 +136,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.
Expand Down