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
zlib skipped when building 2.7 on macOS without /usr/include installed #64159
Comments
When you build python 2.7 on an OSX 10.9 machine with Xcode but without the command-line tools installed that build mostly succeeds, but doesn't detect a number of dependencies (in particular zlib). The attached patch teaches "add_dir_to_list" about the SDK sysroot on OSX and with that the build succeeds. Aside: I also noticed problems with build tinter, with 2.7 but also with 3.3 and 3.4. I'll file a separate issue about that. |
Just a reminder that a patch review is needed here guys. |
Now that Apple, as of 10.14, has removed the option to install system header files into their traditional locations (like /usr/include), thus making every build a build from an SDK, this problem is now more noticeable. At least, I finally noticed it while fixing the more general problems that setup.py had on all branches (see bpo-36231). This issue is in addition and is specific to 2.7. As can be seen in Ronald's patch, which I didn't find until after I had written my own, the problem is that, in 2.7's setup.py, add_dir_to_list() does not take the SDK manipulation into account and, in particular, skips adding /usr/include because that directory doen't exist in the root filesystem anymore. On my systems, besides zlib, the dbm and nis modules were also being skipped. Curiously, some other extension modules with system library dependencies do get built properly, like _sqlite3, because their build step in setup.py explicitly added /usr/include to the SDK search paths. Anyway, the PR I produced is somewhat more complicated that Ronald's original patch. It's more careful about what paths it checks for and it also stores the directory name, if found, without the prepended SDK path. That may be important in other steps in setup.py where it is doing path comparisons. The SDK will eventually get added again, either explicitly or implicitly by the compiler tool chain. |
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: