Monday, February 3, 2025

Swift Build

Owen Voorhees (tweet, Hacker News):

As a foundational step in this new chapter of Swift build technologies, today Apple is open sourcing Swift Build, a powerful and extensible build engine that provides a set of build rules for building Swift projects. Swift Build is the engine used by Xcode, which supports millions of apps in the App Store as well as the internal build process for Apple’s own operating systems. The open source repository also includes support for targeting Linux and Windows.

[…]

Swift Build is an infrastructural component designed to plan and execute builds requested by a higher-level client like Swift Package Manager or Xcode. It builds on top of the existing llbuild project to add capabilities including:

  • Robust integration with the Swift compiler to reliably and efficiently coordinate the build of Swift projects
  • Support for a wide variety of product types including libraries, command line tools, and GUI applications with advanced build configuration options
  • Build graph optimizations that maximize parallelism when building Swift and C code

I suspect this is the component responsible for one of my main frustrations with Swift: spurious compilation errors (or sometimes crashes at runtime) unless I clean the build folder, because it doesn’t correctly figure out which files need to be recompiled after certain changes.

Saagar Jha:

Swift Build being open sourced is a really huge deal. This should remove barriers for teams that are running into Xcode build performance or correctness limitations because they can now debug, profile, and most importantly fix the issues themselves.

Tony Arnold:

I am unbelievably happy to see Apple open source the Xcode build system — I have checked out the project, explored the tests, and am looking at starter issues alongside a relaxing cup of tea.

1 Comment RSS · Twitter · Mastodon


> Swift Build being open sourced is a really huge deal. This should remove barriers for teams that are running into Xcode build performance or correctness limitations because they can now debug, profile, and most importantly fix the issues themselves.

Let me see if I understood this correctly. It's fantastic that a trillion dollar company released in open source the code of a component that it has not been able to fix by itself. Basically 3rd party developers are supposed to give up 30% of their revenues while fixing Apple's own bugs and be grateful for that?

What a wonderful world.

Leave a Comment