darwinbuild icon indicating copy to clipboard operation
darwinbuild copied to clipboard

Add support for building and using a custom SDK

Open wjk opened this issue 3 years ago • 0 comments

This PR changes the way darwinbuild handles dependencies between projects. Previously, Xcode would use its built-in SDK, which always targets the very latest version of macOS. This tends to cause problems every WWDC when the structure of the low-level system headers changes out from under us.

With this PR applied, darwinbuild will create a new SDK under the build volume. To allow for bootstrapping from nothing but Xcode and source tarballs, this SDK will be filled at first with symbolic links to the files in Apple’s SDK. As roots are added to the image, the symbolic links will be overwritten with “real” copies of the files. Eventually, we can package a prebuilt PureDarwin SDK (that contains no Apple SDK symlinks) and teach darwinbuild how to use it. Once we do this, we divest ourselves from depending on any particular quirk of Apple’s macOS SDK. Apple could completely rewrite the low-level headers, and we won’t care, because we will be using our prebuilt SDK with our own copy of the low-level headers. Enjoy!

wjk avatar Oct 03 '20 03:10 wjk