SwiftPM 6.4 Release Notes
Swift Package Manager 6.4 makes Swift Build the new default build system, providing a unified build experience across all platforms Swift supports. This release also adds first-class support for generating Software Bill of Materials (SBOM) documents.
SwiftBuild: The new default build system
SwiftPM has changed its default build system to Swift Build. Read more here.
Key changes from the native build system
Build artifacts are output to a different location. For all build systems, using
swift build --show-bin-path <other build arguments>is the recommended way to determine the build output location.--static-swift-stdlib: Stricter validation (errors instead of silently ignoring)The native build system silently ignored this option on some platforms; Swift Build now produces an error.
Swift Build generates an error on platforms where statically linking the standard library is not supported.
Swift Build creates a test runner per test target defined in the package manifest, while the native build system created a single monolithic test runner.
Detailed differences
The following sections describe specific behavioral differences you may encounter when migrating to Swift Build.
Resource support parity with xcodebuild
When targeting Apple platforms, SwiftPM consistently applies the same set of resource rules as xcodebuild when a package contains resource types like asset catalogs, storyboards, Metal sources, etc.
Swift Driver integration
The
--use-integrated-swift-drivercommand-line option is deprecated and has no effect. Swift Build always uses the library-based Swift driver.On supported platforms, Swift Build will make use of explicitly-built Clang and Swift modules.
Enhanced diagnostics
Swift Build may produce different log output and diagnostics compared to the native build system.
Other
Supports building universal binaries when targeting Apple platforms. Example invocation:
swift build --arch arm64 --arch x86_64
Known issues
Swift Build fails to build projects with Linux SDKs generated by the SDK generator.
Tracking: package-manager#10006
Using the
--explicit-target-dependency-import-checkcommand line option does not behave as expected when building with Swift Build.Tracking: swiftlang/swift-package-manager#9620
Building projects that use swift-java and build tool plugins may fail.
Tracking: swiftlang/swift-package-manager#10060
Troubleshooting
If your package fails to build with Swift Build in Swift 6.4, you can fall back to the previous native build system using the --build-system native flag:
swift build --build-system native
swift test --build-system native
swift run --build-system nativeIf your build passes using the native build system but fails using Swift Build, please report the issue.
Software Bill of Materials (SBOM) support
Swift Package Manager can now generate an SBOM for your Swift package. Read more Generating Software Bill of Materials (SBOM).
Additional features
Test repetition for Swift Testing
swift test now supports repeating tests until they match a condition via the --repeat-until and --maximum-repetitions arguments. This will only repeat the individual test cases that meet the repetition condition.
--maximum-repetitionsprovides an upper bound on the number of times a test will repeat.--repeat-untilsupports the following repetition conditions:pass: If the test fails, it will repeat until it passes, or untilmaximum-repetitionshas been reached.fail: If the test passes, it will repeat until it fails, or untilmaximum-repetitionshas been reached.
If --maximum-repetitions is provided without --repeat-until, all tests will repeat maximum-repetitions times.
LLDB Debugger support in `swift test`
Running swift test --debugger will launch tests in an LLDB debugging session on the command line. Read more swift test.
Mirrors deterministic order
When adding or removing a mirror configuration using swift package config <command>, the produced mirrors.json file was being completely rewritting with a non-deterministic order. A change to SwiftPM renders the mirror.json file in a deterministic order.
Reporting issues
Please follow these steps when reporting issues:
Review the
known issueslisted above to ensure your issue has not already been identified.If your issue is not listed, submit a new issue on GitHub.
Include the following information in your report:
The exact command that failed
Complete error output
System information (operating system, Swift version, etc.)
Whether the same command works with the native build system