-
-
Notifications
You must be signed in to change notification settings - Fork 1.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
hooks: tkinter: avoid collecting data from system Tcl/Tk framework on macOS #5217
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bwoodsend
reviewed
Oct 3, 2020
bwoodsend
approved these changes
Oct 3, 2020
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.
I feel like my review isn't worth much here seeing as I can't test it.
rokm
force-pushed
the
hooks-tkinter-nosysdata
branch
from
October 5, 2020 12:01
585b630
to
397e93d
Compare
… macOS On macOS, we do not collect system libraries in general; if tkinter uses system Tcl/Tk 8.5 framework (older 32/64-bit python.org builds, or brew python), we do not collect its Tk and Tcl shared library, either. Therefore, it makes little sense to collect the data (scripts and modules) from the system framework, either. This commit modifies the behavior of both _tkinter stdhook and rthook on macOS. The stdhook now treats (None, None) returned by _find_tcl_tk() as an indicator that the system framework is used and that data directories should not be collected. The rthook now sets TCL_LIBRARY and TK_LIBRARY environment variables if collected tcl and tk directories exist, but does not raise error anymore if they do not (under assumption that they have not been collected from the system framework). The behavior under other OSes remains unchanged.
rokm
force-pushed
the
hooks-tkinter-nosysdata
branch
from
October 5, 2020 12:12
397e93d
to
af09a05
Compare
Legorooj
approved these changes
Oct 10, 2020
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.
Thanks for this @rokm
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
After a discussion with @bwoodsend, we reached conclusion that in the case of system Tcl/Tk framework on macOS, it makes no sense to collect data when we do not collect the shared library (which we do not; and is not needed anymore as #5172 ensures that the system libraries are used correctly). So this PR removes the collection of data from macOS' system Tcl/Tk. This affects only python builds that use system Tcl/Tk - older python.org builds (e.g., 32/64-bit 3.6.5) and apparently homebrew python.
As a bonus, this also takes care of the error in
tkinter
hook with homebrew python on macOS 11, which was reported in #5040.On macOS, we do not collect system libraries in general; if
tkinter
uses system Tcl/Tk 8.5 framework (older 32/64-bitpython.org builds, or brew python), we do not collect its Tk and Tcl shared library, either. Therefore, it makes little sense to
collect the data (scripts and modules) from the system framework, either.
This commit modifies the behavior of both
_tkinter
stdhook and rthook on macOS. The stdhook now treats(None, None)
returned by_find_tcl_tk()
as an indicator that the system framework is used and that data directories should not be collected. The rthook now setsTCL_LIBRARY
andTK_LIBRARY
environment variables if collected tcl and tk directories exist, but does not raise error anymore if they do not (under assumption that they have not been collected from the system framework).The behavior under other OSes remains unchanged.