Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

bpo-45847: Port _tkinter to PY_STDLIB_MOD#31698

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
miss-islington merged 20 commits intopython:mainfromerlend-aasland:ac-tkinter
Mar 31, 2022

Conversation

@erlend-aasland
Copy link
Contributor

@erlend-aaslanderlend-aasland commentedMar 5, 2022
edited by miss-islington
Loading

  • Remove--with-tclk-* options fromconfigure
  • Use pkg-config to detect_tkinter dependencies (Tcl/Tk, X11)
  • Manual override via environment variablesTCLTK_CFLAGS andTCLTK_LIBS

https://bugs.python.org/issue45847

Automerge-Triggered-By: GH:tiran

@erlend-aasland
Copy link
ContributorAuthor

erlend-aasland commentedMar 6, 2022
edited
Loading

Looks like the Ubuntu pkg-config files for Tcl/Tk are buggy; they don't provide the correct--libs flags (-L is wrong).

Resolved in commita8313a1

Now we've got problems on FreeBSD (14.0):X11/Xlib.h is included bytk.h, X11 include path is not passed toCFLAGS:

$grep -A5"cc.*tcl" config.logconfigure: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   >&5In 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 in72cf592

@erlend-aasland
Copy link
ContributorAuthor

(I squeezed 46e43dcaa599d3fe906cdb3ebd591151af856372, 5156b5764a368578e5eb55da471b74e80e5aa479, and 8af1b258d04b042038e0cc0e5fccfd35aad659af into72cf592)

@erlend-aaslanderlend-aasland changed the title[WIP] bpo-45847: Port _tkinter to PY_STDLIB_MODbpo-45847: Port _tkinter to PY_STDLIB_MODMar 7, 2022
Comment on lines 3540 to 3544
#if defined(TK_HEX_VERSION)
# if TK_HEX_VERSION < 0x08040200
# error "Tk older than 8.4.2 not supported"
# endif
#endif
Copy link
ContributorAuthor

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?

@erlend-aaslanderlend-aasland added the 🔨 test-with-buildbotsTest PR w/ buildbots; report in status section labelMar 7, 2022
@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by@erlend-aasland for commitea426ef 🤖

If you want to schedule another build, you need to add the ":hammer: test-with-buildbots" label again.

@bedevere-botbedevere-bot removed the 🔨 test-with-buildbotsTest PR w/ buildbots; report in status section labelMar 7, 2022
@erlend-aasland
Copy link
ContributorAuthor

erlend-aasland commentedMar 7, 2022
edited
Loading

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:

  • A FreeBSD bot failed because the X11 check lacked a guard. Addressed in5816799
Buildbot status
BuildbotPost PRPre PRStatus
AMD64 FreeBSD Shared PRerrormissing🔴
AMD64 Arch Linux Asan Debug PRyesyes🟢
AMD64 Arch Linux Asan PRyesyes🟢
AMD64 Arch Linux TraceRefs PRyes yes🟢
AMD64 Arch Linux Usan PRyes yes🟢
AMD64 Debian PGO PRyesyes🟢
AMD64 Debian root PRmissingmissing🟢
AMD64 Fedora Stable Clang Installed PRyes yes🟢
AMD64 Fedora Stable Clang PRyesyes🟢
AMD64 Fedora Stable LTO + PGO PRyesyes🟢
AMD64 Fedora Stable LTO PRyesyes🟢
AMD64 Fedora Stable PRyesyes🟢
AMD64 Fedora Stable Refleaks PRyes yes🟢
AMD64 RHEL7 LTO + PGO PRmissingyes🔴
AMD64 RHEL7 LTO PRmissingyes🔴
AMD64 RHEL7 PRmissingyes🔴
AMD64 RHEL7 Refleaks PRmissingyes🔴
AMD64 RHEL8 FIPS Only Blake2 Builtin Hash PRyesyes🟢
AMD64 RHEL8 LTO + PGO PRyesyes🟢
AMD64 RHEL8 LTO PRyesyes🟢
AMD64 RHEL8 PRyesyes🟢
AMD64 RHEL8 Refleaks PRyes yes🟢
AMD64 Ubuntu Shared PRmissingmissing🟢
ARM64 macOS PRmissing (deliberate)yes🟢
PPC64 Fedora PRmissingyes🔴
PPC64LE Fedora Stable Clang Installed PRyesyes🟢
PPC64LE Fedora Stable Clang PRyesyes🟢
PPC64LE Fedora Stable LTO + PGO PRyesyes🟢
PPC64LE Fedora Stable LTO PRyesyes🟢
PPC64LE Fedora Stable PRyesyes🟢
PPC64LE Fedora Stable Refleaks PRyesyes🟢
PPC64LE RHEL7 LTO + PGO PRmissingyes🔴
PPC64LE RHEL7 LTO PRmissingyes🔴
PPC64LE RHEL7 PRmissing yes🔴
PPC64LE RHEL7 Refleaks PRmissingyes🔴
PPC64LE RHEL8 LTO + PGO PRyesyes🟢
PPC64LE RHEL8 LTO PRyes yes🟢
PPC64LE RHEL8 PRyesyes🟢
PPC64LE RHEL8 Refleaks PRyesyes🟢
aarch64 Fedora Stable Clang Installed PRyesyes🟢
aarch64 Fedora Stable Clang PRyesyes🟢
aarch64 Fedora Stable LTO + PGO PR yesyes🟢
aarch64 Fedora Stable LTO PRyesyes🟢
aarch64 Fedora Stable PRyesyes🟢
aarch64 Fedora Stable Refleaks PRyesyes🟢
aarch64 RHEL8 LTO + PGO PRyesyes🟢
aarch64 RHEL8 LTO PRyesyes🟢
aarch64 RHEL8 PRyesyes🟢
aarch64 RHEL8 Refleaks PRyesyes🟢
s390x Debian PRyesyes🟢
s390x Fedora Clang Installed PRyes yes🟢
s390x Fedora Clang PRyesyes🟢
s390x Fedora LTO + PGO PRyesyes🟢
s390x Fedora LTO PRyesyes🟢
s390x Fedora PRyes yes🟢
s390x Fedora Refleaks PRyesyes🟢
s390x RHEL7 LTO + PGO PRmissingyes🔴
s390x RHEL7 LTO PRmissingyes🔴
s390x RHEL7 PRmissingyes🔴
s390x RHEL7 Refleaks PRmissing yes🔴
s390x RHEL8 LTO + PGO PRyes yes🟢
s390x RHEL8 LTO PRyesyes🟢
s390x RHEL8 PRyes yes🟢
s390x RHEL8 Refleaks PRyesyes🟢
s390x SLES PR yes yes🟢
x86 Gentoo Installed with X PRyes yes🟢
x86 Gentoo Non-Debug with X PRyes yes🟢
x86-64 macOS PRmissing (deliberate) yes🟢

@erlend-aasland
Copy link
ContributorAuthor

Sparked byRonald's comment on Discourse:

Wecould 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.

cc.@tiran@ronaldoussoren@ned-deily

@erlend-aasland
Copy link
ContributorAuthor

Wecould 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.

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 toconfigure, for example throughPKG_CONFIG_PATH.

@tirantiran added the 🔨 test-with-buildbotsTest PR w/ buildbots; report in status section labelMar 13, 2022
@erlend-aasland
Copy link
ContributorAuthor

Synced with main to get Serhiy's commits (GH-31839,GH-31938)

@erlend-aasland
Copy link
ContributorAuthor

@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?

@ned-deily
Copy link
Member

ned-deily commentedMar 17, 2022
edited
Loading

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.

erlend-aasland reacted with heart emoji

@erlend-aasland
Copy link
ContributorAuthor

@ned-deily would you still like to review this?

ned-deily reacted with thumbs up emoji

Copy link
Member

@ned-deilyned-deily left a 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 previousconfigure 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.

@ned-deily
Copy link
Member

Ready to go

erlend-aasland reacted with rocket emoji

@erlend-aasland
Copy link
ContributorAuthor

Ready to go

Great, thank you for reviewing!@tiran, can you land this? :)

@tiran
Copy link
Member

Love it! Your PR removes a lot of complicated code fromsetup.py.

erlend-aasland reacted with heart emoji

@miss-islingtonmiss-islington merged commitb36d222 intopython:mainMar 31, 2022
@erlend-aaslanderlend-aasland deleted the ac-tkinter branchMarch 31, 2022 10:35
erlend-aasland pushed a commit to erlend-aasland/cpython that referenced this pull requestApr 17, 2022
miss-islington pushed a commit to miss-islington/cpython that referenced this pull requestMay 9, 2022
(cherry picked from commit269e726)Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@protonmail.com>
erlend-aasland added a commit that referenced this pull requestMay 9, 2022
miss-islington added a commit that referenced this pull requestMay 9, 2022
(cherry picked from commit269e726)Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@protonmail.com>
@sharewax
Copy link

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

Wl,--enable-new-dtags -g -L/usr/lib64/openssl11 -L/opt/wargaming/wargaming-python311/root/usr/lib64-Wl,-z,relro -Wl,-rpath,/opt/wargaming/wargaming-python311/root/usr/lib64 -Wl,--enable-new-dtags -g -L/usr/lib64/openssl11 -L/opt/wargaming/wargaming-python311/root/usr/lib64-Wl,-z,relro -Wl,-rpath,/opt/wargaming/wargaming-python311/root/usr/lib64 -Wl,--enable-new-dtags -fno-semantic-interposition -g -L/usr/lib64/openssl11 -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -L/opt/wargaming/wargaming-python311/root/usr/lib64-Wl,-z,relro -Wl,-rpath,/opt/wargaming/wargaming-python311/root/usr/lib64 -Wl,--enable-new-dtags -fno-semantic-interposition -g -L/usr/lib64/openssl11 -L/opt/wargaming/wargaming-python311/root/usr/lib64-Wl,-z,relro -Wl,-rpath,/opt/wargaming/wargaming-python311/root/usr/lib64 -Wl,--enable-new-dtags -g -L/usr/lib64/openssl11 -I/opt/wargaming/wargaming-python311/root/usr/include -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4-grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -I/usr/include/openssl11 build/temp.linux-x86_64-3.11-pydebug/builddir/build/BUILD/Python-3.11.0rc1/Modules/_ctypes/_ctypes.o build/temp.linux-x86_64-3.11-pydebug/builddir/build/BUILD/Python-3.11.0rc1/Modules/_ctypes/callbacks.o build/temp.linux-x86_64-3.11-pydebug/builddir/build/BUILD/Python-3.11.0rc1/Modules/_ctypes/callproc.o build/temp.linux-x86_64-3.11-pydebug/builddir/build/BUILD/Python-3.11.0rc1/Modules/_ctypes/cfield.o build/temp.linux-x86_64-3.11-pydebug/builddir/build/BUILD/Python-3.11.0rc1/Modules/_ctypes/stgdict.o -L. -L/opt/wargaming/wargaming-python311/root/usr/lib64 -L/usr/lib64/openssl11 -L/usr/local/lib -lffi -ldl -o build/lib.linux-x86_64-3.11-pydebug/_ctypes.cpython-311d-x86_64-linux-gnu.so*** WARNING: renaming "_tkinter" since importing it failed: /builddir/build/BUILD/Python-3.11.0rc1/build/debug/build/lib.linux-x86_64-3.11-pydebug/_tkinter.cpython-311d-x86_64-linux-gnu.so: undefined symbol: Tcl_AddErrorInfoFollowing modules built successfully but were removed because they could not be imported:_tkinter

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.

@tiran
Copy link
Member

@sharewax Python 3.11 requires pkg-config to detect and configure tkinter. The CentOS 7 packages do not provide a.pc file for TCL and TK._tkinter compiles for me with correctTCLTK_LIBS. We should document the correct flags for CentOS7 users. Could you please open a new ticket?

@sharewax
Copy link

sharewax commentedAug 13, 2022
edited
Loading

@tiran Sure. Can you provide correctTCLTK_LIBS for centos7? I would like to finish my installation correctly :)
added:
export TCLTK_LIBS="-ltk8.5 -ltcl8.5"
solves the issue if add in into spec file near other export variables.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@ned-deilyned-deilyned-deily left review comments

@tirantirantiran approved these changes

Assignees

No one assigned

Labels

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

7 participants

@erlend-aasland@bedevere-bot@ned-deily@tiran@sharewax@the-knights-who-say-ni@miss-islington

[8]ページ先頭

©2009-2025 Movatter.jp