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
setup.py not picking up tkinter headers from non-system macOS Tcl and Tk frameworks #83343
Comments
./configure && make -j4 is returning: Failed to build these modules: I'm running macOS 10.15.2, with the SDK installed using /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Tk.framework/ xcrun --show-sdk-path If I debug setup.py, I can see it's eagerly returning the wrong path (/System) On a REPL, if I do:
>>> import setup
>>> setup.macosx_sdk_root()
'/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk' So the path is correct, but I can see in setup.py that detect_tkinter_darwin() will break inside the loop if /System/Library/Frameworks/Tk.framework/Versions/Current exists (which it does), but it doesn't contain the headers, it contains 3 directories: Resources Tk _CodeSignature I think detect_tkinter_darwin should be updated so that framework_dirs scans macosx_sdk_root first, but I don't know what other scenarios this might break. I'd be happy to submit a patch for my scenario but it looks like this whole function needs tests so each platform change and scenario as they come up. There's loads of other issues on BPO related. |
I also can't see how this condition would ever match, since macosx_sdk_root() is not in the list being iterated upon, |
This comes down to a logic bug in detect_tkinter_darwin(), shown in https://github.com/python/cpython/pull/17753/files#r361956102 |
Thanks for the report and the PR. Yes, detect_tkinter_darwin() had a number of problems due mainly to how Apple has first deprecated and more recently removed the option to have header files installed in the running system. Plus some nasty quirks of how the Tcl and Tk frameworks are built make it difficult to use them without hacks for embedding while supporting Python build options. Your analysis was helpful. In the end, I tried to fix this and some more general problems in detect_tkinter_darwin() with PR 20171 for bpo-34956 which will be available in 3.9.0b1. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: