Skip to content

Commit e2e8eee

Browse files
committed
unix: link tkinter against QuartzCore framework on macOS
tk 8.6.12 introduced a dependency on this framework. While CPython's build system didn't complain, if we attempt to relink the object files without pulling in the QuartzCore framework we get an error for missing symbols like kCAGravityBottomLeft and kCAGravityTopLeft. This fixes a bug introduced by commit ebba5b0.
1 parent fc5a128 commit e2e8eee

File tree

4 files changed

+8
-3
lines changed

4 files changed

+8
-3
lines changed

cpython-unix/static-modules.3.10.macos

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ _testimportmultiple _testimportmultiple.c
3434
_testinternalcapi _testinternalcapi.c -DPy_BUILD_CORE_MODULE
3535
_testmultiphase _testmultiphase.c
3636
# CoreFoundation isn't a directory dependency but is a dependency of libtcl and libtk.
37-
_tkinter _tkinter.c tkappinit.c -DWITH_APPINIT -framework AppKit -framework ApplicationServices -framework Carbon -framework CoreFoundation -framework CoreServices -framework CoreGraphics -framework IOKit -ltcl8.6 -ltk8.6
37+
_tkinter _tkinter.c tkappinit.c -DWITH_APPINIT -framework AppKit -framework ApplicationServices -framework Carbon -framework CoreFoundation -framework CoreServices -framework CoreGraphics -framework IOKit -framework QuartzCore -ltcl8.6 -ltk8.6
3838
_uuid _uuidmodule.c -luuid
3939
_xxsubinterpreters _xxsubinterpretersmodule.c
4040
_xxtestfuzz _xxtestfuzz/_xxtestfuzz.c _xxtestfuzz/fuzzer.c

cpython-unix/static-modules.3.8.macos

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ _scproxy _scproxy.c -framework SystemConfiguration -framework CoreFoundation
2929
_sqlite3 _sqlite/cache.c _sqlite/connection.c _sqlite/cursor.c _sqlite/microprotocols.c _sqlite/module.c _sqlite/prepare_protocol.c _sqlite/row.c _sqlite/statement.c _sqlite/util.c -IModules/_sqlite -DMODULE_NAME=\"sqlite3\" -DSQLITE_OMIT_LOAD_EXTENSION=1 -lsqlite3
3030
_ssl _ssl.c -lssl -lcrypto
3131
# CoreFoundation isn't a directory dependency but is a dependency of libtcl and libtk.
32-
_tkinter _tkinter.c tkappinit.c -DWITH_APPINIT -framework AppKit -framework ApplicationServices -framework Carbon -framework CoreFoundation -framework CoreServices -framework CoreGraphics -framework IOKit -ltcl8.6 -ltk8.6
32+
_tkinter _tkinter.c tkappinit.c -DWITH_APPINIT -framework AppKit -framework ApplicationServices -framework Carbon -framework CoreFoundation -framework CoreServices -framework CoreGraphics -framework IOKit -framework QuartzCore -ltcl8.6 -ltk8.6
3333
_uuid _uuidmodule.c -luuid
3434
pyexpat pyexpat.c expat/xmlparse.c expat/xmlrole.c expat/xmltok.c -DHAVE_EXPAT_CONFIG_H=1 -DXML_POOR_ENTROPY=1 -DUSE_PYEXPAT_CAPI -IModules/expat
3535
readline readline.c -ledit -lncurses

cpython-unix/static-modules.3.9.macos

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ _testimportmultiple _testimportmultiple.c
3434
_testinternalcapi _testinternalcapi.c -DPy_BUILD_CORE_MODULE
3535
_testmultiphase _testmultiphase.c
3636
# CoreFoundation isn't a directory dependency but is a dependency of libtcl and libtk.
37-
_tkinter _tkinter.c tkappinit.c -DWITH_APPINIT -framework AppKit -framework ApplicationServices -framework Carbon -framework CoreFoundation -framework CoreServices -framework CoreGraphics -framework IOKit -ltcl8.6 -ltk8.6
37+
_tkinter _tkinter.c tkappinit.c -DWITH_APPINIT -framework AppKit -framework ApplicationServices -framework Carbon -framework CoreFoundation -framework CoreServices -framework CoreGraphics -framework IOKit -framework QuartzCore -ltcl8.6 -ltk8.6
3838
_uuid _uuidmodule.c -luuid
3939
_xxsubinterpreters _xxsubinterpretersmodule.c
4040
_xxtestfuzz _xxtestfuzz/_xxtestfuzz.c _xxtestfuzz/fuzzer.c

src/validation.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,11 @@ static DARWIN_ALLOWED_DYLIBS: Lazy<Vec<MachOAllowedDylib>> = Lazy::new(|| {
290290
max_compatibility_version: "1.0.0".try_into().unwrap(),
291291
required: true,
292292
},
293+
MachOAllowedDylib {
294+
name: "/System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore".to_string(),
295+
max_compatibility_version: "1.2.0".try_into().unwrap(),
296+
required: true,
297+
},
293298
MachOAllowedDylib {
294299
name: "/System/Library/Frameworks/SystemConfiguration.framework/Versions/A/SystemConfiguration".to_string(),
295300
max_compatibility_version: "1.0.0".try_into().unwrap(),

0 commit comments

Comments
 (0)