-
-
Notifications
You must be signed in to change notification settings - Fork 30.9k
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
854b70e
to
8c8b74d
Compare
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 |
8af1b25
to
72cf592
Compare
(I squeezed 46e43dcaa599d3fe906cdb3ebd591151af856372, 5156b5764a368578e5eb55da471b74e80e5aa479, and 8af1b258d04b042038e0cc0e5fccfd35aad659af into 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?
🤖 New build scheduled with the buildbot fleet by @erlend-aasland for commit ea426ef 🤖 If you want to schedule another build, you need to add the ":hammer: test-with-buildbots" label again. |
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 |
@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? |
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.
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 |
(cherry picked from commit 269e726) Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@protonmail.com>
files from centos7 (tk-devel-8.5.13-6.el7.x86_64 and tcl-devel-8.5.13-8.el7.x86_64) doesn't contain files for pkg-config, so tcl for debug version of python you get
I'll try to set manually flags TCLTK_CFLAGS and TCLTK_LIBS, but it seems strage. on python3.10 all works well without additional things. |
@sharewax Python 3.11 requires pkg-config to detect and configure tkinter. The CentOS 7 packages do not provide a |
@tiran Sure. Can you provide correct |
--with-tclk-*
options fromconfigure
_tkinter
dependencies (Tcl/Tk, X11)TCLTK_CFLAGS
andTCLTK_LIBS
https://bugs.python.org/issue45847
Automerge-Triggered-By: GH:tiran