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

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
4 changes: 2 additions & 2 deletions cpython-unix/build-cpython.sh
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,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
Expand Down Expand Up @@ -1034,7 +1034,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

Expand Down
2 changes: 1 addition & 1 deletion cpython-unix/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -886,7 +886,7 @@ 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",
Expand Down
1 change: 1 addition & 0 deletions cpython-unix/extension-modules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -688,6 +688,7 @@ _tkinter:
- CoreGraphics
- IOKit
- QuartzCore
- UniformTypeIdentifiers

_tokenize:
minimum-python-version: "3.11"
Expand Down
21 changes: 12 additions & 9 deletions cpython-windows/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -566,15 +566,6 @@ def hack_project_files(
rb'<ClCompile Include="$(opensslIncludeDir)\openssl\applink.c">',
)

# 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(
pcbuild_path / "_tkinter.vcxproj",
rb'<_TclTkDLL Include="$(tcltkdir)\bin\$(tclZlibDllName)" />',
rb"",
)

# We don't need to produce python_uwp.exe and its *w variant. Or the
# python3.dll, pyshellext, or pylauncher.
# Cut them from the build to save time and so their presence doesn't
Expand Down Expand Up @@ -1280,6 +1271,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
26 changes: 13 additions & 13 deletions pythonbuild/downloads.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,10 +310,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",
Expand All @@ -327,20 +327,20 @@
"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",
"git_commit": "e3c3e9a2856124aa32b608632a52742d479eb7a9",
"url": "https://github.com/python/cpython-bin-deps/archive/c624cc881bd0e5071dec9de4b120cbe9985d8c14.tar.gz",
"size": 9497943,
"sha256": "9b8e77d55f40ceaedd140ccca0daa804f0d43346d5abfcead9b547b5590f82f8",
"version": "8.6.14",
"git_commit": "c624cc881bd0e5071dec9de4b120cbe9985d8c14",
},
"uuid": {
"url": "https://sourceforge.net/projects/libuuid/files/libuuid-1.0.3.tar.gz",
Expand Down
8 changes: 8 additions & 0 deletions src/validation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ const PE_ALLOWED_LIBRARIES: &[&str] = &[
"IPHLPAPI.DLL",
"KERNEL32.dll",
"msi.dll",
"msvcrt.dll",
"NETAPI32.dll",
"ole32.dll",
"OLEAUT32.dll",
Expand Down Expand Up @@ -134,6 +135,8 @@ const PE_ALLOWED_LIBRARIES: &[&str] = &[
"sqlite3.dll",
"tcl86t.dll",
"tk86t.dll",
// Bundled with tk
"zlib1.dll",
];

static GLIBC_MAX_VERSION_BY_TRIPLE: Lazy<HashMap<&'static str, version_compare::Version<'static>>> =
Expand Down Expand Up @@ -388,6 +391,11 @@ static DARWIN_ALLOWED_DYLIBS: Lazy<Vec<MachOAllowedDylib>> = 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(),
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know how to determine this version.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Run otool -L on the binary requiring this library. This prints the compatibility version that is embedded in the Mach-O library dependency data.

required: true,
},
MachOAllowedDylib {
name: "/usr/lib/libedit.3.dylib".to_string(),
max_compatibility_version: "2.0.0".try_into().unwrap(),
Expand Down
Loading