Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 12 additions & 29 deletions cpython-windows/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
"_lzma": ["xz"],
"_sqlite3": ["sqlite"],
"_ssl": ["openssl"],
"_tkinter": ["tcl-8612", "tk-8612", "tix"],
"_tkinter": ["tcl", "tk", "tix"],
"_uuid": ["uuid"],
"zlib": ["zlib"],
"_zstd": ["zstd"],
Expand Down Expand Up @@ -370,10 +370,7 @@ def hack_props(

mpdecimal_version = DOWNLOADS["mpdecimal"]["version"]

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"]
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 @@ -1220,10 +1217,6 @@ def find_additional_dependencies(project: pathlib.Path):
if name == "zlib":
name = zlib_entry

# 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]

# This will raise if no license metadata defined. This is
Expand Down Expand Up @@ -1307,17 +1300,8 @@ 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. 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_archive = download_entry(
tk_bin_entry, BUILD, local_name="tk-windows-bin.tar.gz"
"tk-windows-bin", BUILD, local_name="tk-windows-bin.tar.gz"
)

# On CPython 3.14+, zstd is included
Expand Down Expand Up @@ -1401,16 +1385,15 @@ def build_cpython(
shutil.copyfile(source, dest)

# Delete the tk nmake helper, it's not needed and links msvc
if tk_bin_entry == "tk-windows-bin":
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_commit: str = DOWNLOADS["tk-windows-bin"]["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"
Expand Down
25 changes: 0 additions & 25 deletions pythonbuild/downloads.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,31 +344,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 @@ -101,6 +101,7 @@ const PE_ALLOWED_LIBRARIES: &[&str] = &[
"IPHLPAPI.DLL",
"KERNEL32.dll",
"msi.dll",
"msvcrt.dll",
"NETAPI32.dll",
"ole32.dll",
"OLEAUT32.dll",
Expand Down Expand Up @@ -139,6 +140,8 @@ const PE_ALLOWED_LIBRARIES: &[&str] = &[
"sqlite3.dll",
"tcl86t.dll",
"tk86t.dll",
// Bundled with tk
"zlib1.dll",
];

// CPython 3.14 and ARM64 use a newer version of tcl/tk (8.6.14+) which includes a bundled zlib that
Expand Down
Loading