Switching to XCBuild for Apple builds

# Keith Rollin (3 days ago)

For several years now, Xcode has included two build systems: the “legacy” build system and the newer “XCBuild” system (see, for example, developer.apple.com/videos/play/wwdc2018/408 and developer.apple.com/videos/play/wwdc2018/415, as well as medium.com/xcblog/xcode-new-build-system-for-speedy-swift-builds-c39ea6596e17 and medium.com/xcblog/five-things-you-must-know-about-xcode-10-new-build-system-41676cd5fd6c).

WebKit is finally in a position to move to the new build system. However, this switch is not without consequences. In particular, WebKit has a complicated build process and requires new XCBuild features only found in Xcode 11.4. If you build from within the IDE, you will need Xcode 11.4 or later. Pre-releases have been available for some time on developer.apple.com, but the final version of Xcode 11.4 was posted to the Mac App Store last week on March 24, 2020.

When building from the command line, the conditions are less strict. By default, builds are performed with XCBuild if the build-webkit script or the makefiles detect that Xcode 11.4 or later is installed. If not, builds are performed with the legacy build system. We can be flexible here because the build process is controlled by these scripts and makefiles, allowing the build process to determine the Xcode version before invoking xcodebuild. There is no such opportunity when building within the Xcode IDE, and so the build requirements are stricter.

I’ve made the changes to switch over to XCBuild but I haven’t yet posted them. I want to first find out if this move will cause any issues for developers who — for whatever reason — need to stay on old versions of Xcode. If so, please let me know.

— Keith Rollin

Contact us to advertise here
# Frédéric Wang (2 days ago)

On 31/03/2020 08:42, Keith Rollin wrote:

Hi,

Hi all,

For several years now, Xcode has included two build systems: the “legacy” build system and the newer “XCBuild” system (see, for example, developer.apple.com/videos/play/wwdc2018/408 and developer.apple.com/videos/play/wwdc2018/415, as well as medium.com/xcblog/xcode-new-build-system-for-speedy-swift-builds-c39ea6596e17 and medium.com/xcblog/five-things-you-must-know-about-xcode-10-new-build-system-41676cd5fd6c).

WebKit is finally in a position to move to the new build system. However, this switch is not without consequences. In particular, WebKit has a complicated build process and requires new XCBuild features only found in Xcode 11.4. If you build from within the IDE, you will need Xcode 11.4 or later. Pre-releases have been available for some time on developer.apple.com, but the final version of Xcode 11.4 was posted to the Mac App Store last week on March 24, 2020.

Out of curiosity, what will be the benefits brought by XCBuild for WebKit developers? (sorry for asking but I don't have time to watch the videos and skimming over the blog post, it seems it's mostly performance improvement for swift compilation?)

When building from the command line, the conditions are less strict. By default, builds are performed with XCBuild if the build-webkit script or the makefiles detect that Xcode 11.4 or later is installed. If not, builds are performed with the legacy build system. We can be flexible here because the build process is controlled by these scripts and makefiles, allowing the build process to determine the Xcode version before invoking xcodebuild. There is no such opportunity when building within the Xcode IDE, and so the build requirements are stricter.

I’ve made the changes to switch over to XCBuild but I haven’t yet posted them. I want to first find out if this move will cause any issues for developers who — for whatever reason — need to stay on old versions of Xcode. If so, please let me know.

So I'm not sure I understand but concretely, am I already using the new system if I use the build-script, I've upgraded to XCode 11.4 and rebuilt WebKit from scratch? How can I know which build system I'm using?

Or do you mean you have a patch for WebKit that is pending to land? If so, what's the bug number?

Thanks,

# Keith Rollin (2 days ago)

On Apr 1, 2020, at 06:21, Frédéric Wang <fwang at igalia.com> wrote:

On 31/03/2020 08:42, Keith Rollin wrote:

For several years now, Xcode has included two build systems: the “legacy” build system and the newer “XCBuild” system (see, for example, developer.apple.com/videos/play/wwdc2018/408 and developer.apple.com/videos/play/wwdc2018/415, as well as medium.com/xcblog/xcode-new-build-system-for-speedy-swift-builds-c39ea6596e17 and medium.com/xcblog/five-things-you-must-know-about-xcode-10-new-build-system-41676cd5fd6c).

WebKit is finally in a position to move to the new build system. However, this switch is not without consequences. In particular, WebKit has a complicated build process and requires new XCBuild features only found in Xcode 11.4. If you build from within the IDE, you will need Xcode 11.4 or later. Pre-releases have been available for some time on developer.apple.com, but the final version of Xcode 11.4 was posted to the Mac App Store last week on March 24, 2020.

Out of curiosity, what will be the benefits brought by XCBuild for WebKit developers? (sorry for asking but I don't have time to watch the videos and skimming over the blog post, it seems it's mostly performance improvement for swift compilation?)

I created bugs.webkit.org/show_bug.cgi?id=209890 and responded to your question there.

When building from the command line, the conditions are less strict. By default, builds are performed with XCBuild if the build-webkit script or the makefiles detect that Xcode 11.4 or later is installed. If not, builds are performed with the legacy build system. We can be flexible here because the build process is controlled by these scripts and makefiles, allowing the build process to determine the Xcode version before invoking xcodebuild. There is no such opportunity when building within the Xcode IDE, and so the build requirements are stricter.

I’ve made the changes to switch over to XCBuild but I haven’t yet posted them. I want to first find out if this move will cause any issues for developers who — for whatever reason — need to stay on old versions of Xcode. If so, please let me know. So I'm not sure I understand but concretely, am I already using the new system if I use the build-script, I've upgraded to XCode 11.4 and rebuilt WebKit from scratch? How can I know which build system I'm using?

Or do you mean you have a patch for WebKit that is pending to land? If so, what's the bug number?

The patch was just on my local system. I wanted to make sure I’d covered any issues that were turned up in response to my email before posting. But I’ve now created the bug noted above and added the patch to it.

— Keith

# Frédéric Wang (a day ago)

On 02/04/2020 04:42, Keith Rollin wrote: >

The patch was just on my local system. I wanted to make sure I’d covered any issues that were turned up in response to my email before posting. But I’ve now created the bug noted above and added the patch to it.

Thanks for publishing it. I assume by "Apple builds" (in the title) you mean macOS and iOS ports i.e. it still works for people using the public SDK rather than Apple's internal one. I gave a quick try and I'm not able to build both ports in parallel anymore (will follow-up issues on the bug).

I'm generally working with the latest version of Xcode and with the command line, so I guess others are in better position to reply to your concern on legacy support.

Want more features?

Request early access to our private beta of readable email premium.