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
bpo-45847: Port _tkinter to PY_STDLIB_MOD #31698
Conversation
Resolved in commit a8313a1 Now we've got problems on FreeBSD (14.0): $ grep -A5 "cc.*tcl" config.log
configure:12411: cc -o conftest -I/usr/local/include/tcl8.6 -I/usr/local/include/tk8.6 conftest.c -L/usr/local/lib -ltk86 -ltkstub86 -ltcl86 -ltclstub86 >&5
In file included from conftest.c:111:
/usr/local/include/tk8.6/tk.h:99:13: fatal error: 'X11/Xlib.h' file not found
# include <X11/Xlib.h>
^~~~~~~~~~~~
1 error generated.
$ pkg-config --libs --cflags tcl86 tk86
-I/usr/local/include/tcl8.6 -I/usr/local/include/tk8.6 -L/usr/local/lib -ltk86 -ltkstub86 -ltcl86 -ltclstub86 Proposed solution: add special case for FreeBSD in 72cf592 |
configure.ac
Outdated
#if defined(TK_HEX_VERSION) | ||
# if TK_HEX_VERSION < 0x08040200 | ||
# error "Tk older than 8.4.2 not supported" | ||
# endif | ||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Drop this and keep the ones below?
If you want to schedule another build, you need to add the " |
Non-Windows buildbot status embedded below (updating this post at irregular intervals) TL;DR: macOS and RHEL7 buildbots did no longer build _tkinter (change in behaviour). There were some other issues which have been addressed:
Buildbot status
|
Sparked by Ronald's comment on Discourse: We could add a hack for macOS... I added this on my macOS 12 install, and it works for me. Not sure how it would fare on older installs, though. --- a/configure.ac
+++ b/configure.ac
@@ -3515,8 +3515,21 @@ for _QUERY in \
done
AS_VAR_IF([found_tcltk], [no], [
- TCLTK_CFLAGS=${TCLTK_CFLAGS-""}
- TCLTK_LIBS=${TCLTK_LIBS-""}
+ AS_CASE([$ac_sys_system],
+ [Darwin*], [
+ TCLTK_CFLAGS=${TCLTK_CFLAGS-"\
+ -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Tcl.framework/Headers \
+ -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/Tk.framework/Headers \
+ -F/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks \
+ "}
+ TCLTK_LIBS=${TCLTK_LIBS-"\
+ -Wl,-F,/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks,-framework,Tcl,-framework,Tk
+ "}
+ ], [
+ TCLTK_CFLAGS=${TCLTK_CFLAGS-""}
+ TCLTK_LIBS=${TCLTK_LIBS-""}
+ ]
+ )
])
dnl FreeBSD has an X11 dependency which is not implicitly resolved. I'm not sure if it's worth it adding a more complex hack, or if it's worth it adding this hack in the first place. |
Based on comments from Ned and Ronald, I'm dropping adding any hack for macOS; those building on macOS will have to install MacPorts or Homebrew, and explicitly or implicitly pass this information to |
PKG_CHECK_EXISTS does not print any output, so we can run the pk-config query loop quietly until we get a hit; then we'll run PKG_CHECK_MODULES to fetch the needed compiler and linker options.
Updated to reduce configure noise. |
We can now remove |
- macosx_sdk_specified (removed in this PR) - find_library_functions (removed in python#5242)
@tiran, do you want another round through the buildbots after I pulled Serhiy's changes? Apart from that, are you fine with this PR as it stands? |
Thanks for the PR! I'd like to review and play with it a bit but I likely won't be able to do so before Monday. If you don't hear anything by then, go ahead. |
@ned-deily would you still like to review this? |
LGTM, thanks for doing this. Considering the history and complexity, I'm sure some problems will pop up that, at a minimum, will require more documentation, including the devguide with regard to installing dependencies. I did leave a comment about explicitly documenting the removal of the previous configure
options. Also FTR, the macOS installer build script at the moment still depends on those current configure options; I will rework that area prior to the next 3.11 alpha.
Ready to go |
Great, thank you for reviewing! @tiran, can you land this? :) |
Love it! Your PR removes a lot of complicated code from |
--with-tclk-*
options fromconfigure
_tkinter
dependencies (Tcl/Tk, X11)TCLTK_CFLAGS
andTCLTK_LIBS
https://bugs.python.org/issue45847
Automerge-Triggered-By: GH:tiran