SwiftPM on Swift Build - October Update
Back in February, we open sourced Swift Build with the goal of adopting it as SwiftPM's unified cross-platform build system implementation. I'd like to share a quick collection of updates on the progress towards that goal we've made so far, and plans for the remaining work. Feel free to use this thread to ask any questions you have!
Trying it out
First things first - You can try out the new build system backend today by passing --build-system swiftbuild when invoking SwiftPM. Currently, I recommend trying this out in a recent nightly-main snapshot, as bug fixes and improvements continue to land daily.
While there remain a number of known issues and some missing features when enabling this backend, it's now capable of building many existing packages on Linux, Windows, and macOS. Feel free to try it out and file issues for any bugs you encounter with your own packages! Early feedback is very much appreciated to help ensure these are tracked and addressed.
Notable recent changes and improvements
When we announced Swift Build, we laid out two goals for replacing SwiftPM's native build system: feature parity and platform support parity. Since then, we've made significant progress in both areas. Some notable changes include:
- Platform parity:
- Many bug fixes and improvements which allow the new backend to build 92% of packages from the Swift Package Index which support Linux and 71% of those which support Windows, with steady progress towards further increasing those numbers.
- SwiftPM is now able to build itself using the new backend on macOS/Linux/Windows
- A wide variety of changes to reconcile packages which had different build behavior in SwiftPM CLI builds compared to Xcode, like ensuring consistent handling of top-level code, and automatically choosing an appropriate linker driver.
- Added initial support for FreeBSD
- Initial low-level build system support for baremetal targets
- Feature Parity:
- Full support for build tool, prebuild, and command plugins in the new backend
- Cross-platform test discovery and code coverage support
- Snippets integration
- API digester support
- WIP support for BSP-powered editor functionality in SourceKit-LSP using the new swift-tools-protocols package.
The full list is too large to list here, but I want to thank everyone who's contributed to the project thus far through pull requests, feedback, and bug reports. Getting to this point has been a real team effort.
Up next
Our goal with this work has been to standardize on Swift Build as SwiftPM's single cross-platform build system implementation. In addition to performance and reliability benefits, completing this transition is also a prerequisite for adding user-facing SwiftPM features which depend on the new backend's improved flexibility and capabilities.
There are a few steps required to execute this transition at a high level:
- Complete the work to reach platform-support and feature parity with SwiftPM's existing build system and recommend it to all SwiftPM users in 2026H1
- Enable
--build-system swiftbuildas SwiftPM's default build system backend and deprecate the current default build system - Remove SwiftPM's current default build system implementation in 2026H2
Tracking progress
We've spun up a new GitHub project dashboard - SwiftPM on SwiftBuild - where you can follow the progress and engage with developers on the issues. Keep an eye out for anything labeled “good first issue” as they are often a great starting point if you're interested in contributing.