[webkit-dev] Xcode workspace builds enabled by default in build-webkit; expect faster build times

Elliott Williams emw at apple.com
Tue Jun 14 14:55:04 PDT 2022

Hi folks, 

As part of ongoing work to adopt Xcode’s modern build system, I have turned on “workspace builds” by default for build-webkit as of <https://commits.webkit.org/251501@main>. When building for Mac, iOS, watchOS, or tvOS (including builds made by EWS bots), expect build times to drop, sometimes by a lot!

In this new build workflow, build-webkit makes a single xcodebuild invocation and builds the “All Modules” scheme, instead of recursing through the WebKit tree one project one at a time [1]. This scheme builds all WebKit targets in parallel, in any dependency order Xcode chooses. Increased parallelism, plus lower overhead between projects results in marginally faster full builds and significantly faster incremental builds [2].

One caveat to this build workflow is that we need to emit enough metadata to Xcode’s build system for it to infer the dependency relationships between targets. This is automatic for targets that link against another—for example, Xcode sees that WebCore links against JavaScriptCore and ensures they build in proper order—but often requires manual intervention when there is a headers-only dependency between targets. Please let me know if you’re seeing build failures where a target is building before one of its included headers is available, and refer to <https://commits.webkit.org/246026@main> for the way we typically register dependencies between otherwise unrelated build products.

You can access the old sequential-based build workflow by passing `--no-use-workspace.` At this time, `make` still builds sequentially, but I intend to change `make USE_WORKSPACE=YES` to be the default soon.


[1]: This is exactly what opening WebKit.xcworkspace and building from the Xcode IDE does, and while we don’t have much test coverage of that workflow, I expect that by making build-webkit behave much more like and IDE build, we are fixing inconsistencies and odd behaviors in both places.

[2]: It’s hard to make an accurate statement on the impact of workspace builds for EWS and build queues, because of some separate bug fixes I’m landing to avoid unnecessary full builds on bots <https://bugs.webkit.org/show_bug.cgi?id=241586>. 

However, I’ve been testing workspace builds on a post-commit bot for a few months now, and compared with a similar-spec builder, workspace builds yield a 10x improvement in minimum build time and a 20x improvement (!) in median time:

	min 28s median 100s max 5552s

	min 254s median 2382s max 5768s

More information about the webkit-dev mailing list