Tuesday, June 19, 2018

Fixing missing headers in macOS Mojave Beta (10.14 Beta)

Apple recently released the beta version of the next major version of macOS, codenamed Mojave, that introduced new features such as a system-wide dark mode, desktop stacks, improved file and metadata viewing, and more. If you're anything like me and can tolerate a few non-critical bugs, you have installed this when it first came out. If this is you, you might be also be familiar with the Xcode changes that are introduced that have a tendency to break dependent systems such as parts of Homebrew until fixes are introduced.

The release of Xcode 10 beta is no different, as this time Apple has introduced a particularly onerous change by moving the Xcode Command Line Tools system headers from their usual spot in /usr/include/ into the macOS SDK, which has the much longer path of /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include

For me, this only manifested when trying to run pip and pip being unable to find the needed zlib header:



If you are trying to run pip, or any other utility is looking for a system header in /usr/include, navigate to the following path and install the .pkg file inside:

/Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg

If you're indeed having trouble with pip via Homebrew as I was, you may need to reinstall python/pip with brew reinstall python as it's bundled together and may be copying or caching the zlib header elsewhere, as installing the above package did nothing to resolve the issue until after reinstallation.

This is intended to allow legacy software (read: "current software" as of this writing) to continue to function while they transition to using the macOS SDK. In case you're wondering, this information can found on the third page of the Xcode 10 beta release notes.

No comments:

Post a Comment