Sources/PackageManagerDocs/Documentation.docc/SwiftBuildPreview.md
Understand, use, and preview the next-generation build system for Package Manager.
@Metadata { @Available("Swift", introduced: "6.3") }
Swift Package Manager is previewing a new build system Swift Build as a replacement for the current native build system. This document outlines the current state of the preview, key differences, and known issues.
We encourage you to try the new build system in your project and report any issues you encounter.
For more information about the migration to Swift Build, see this forum post.
The Swift Build integration follows these phases:
native and xcode build systemsTo participate in the preview, run your Swift Package Manager commands with the --build-system swiftbuild flag:
swift build --build-system swiftbuild
swift test --build-system swiftbuild
swift run --build-system swiftbuild
--static-swift-stdlib: Stricter validation (errors instead of silently ignoring)
--build-system swiftbuild, SwiftPM now consistently applies the same set of resource rules as xcodebuild when a package contains resource types like asset catalogs, storyboards, Metal sources, etc.--use-integrated-swift-driver command-line option is considered deprecated. --build-system swiftbuild always uses the library-based Swift driver.--build-system swiftbuild will make use of explicitly-built Clang and Swift modules.--build-system swiftbuild supports building universal binaries. Example invocation: swift build --build-system swiftbuild --arch arm64 --arch x86_64swift build --show-bin-path <other build arguments> to determine the build output location.The swift run --repl command may fail to import some modules.
Swift Build does not provide sanitizer support for scudo and fuzzer.
Swift Build does not support the --enable-parseable-module-interfaces option.
Test execution with coverage may fail on certain platforms.
Swift SDK's and toolset.json files aren't working for the most part. The webassembly SDK is ready to use.
Swift Build does not support test targets depending on other test targets.
Expected native build failure in release configuration may not fail with Swift Build
Swift Build does not support the --explicit-target-dependency-import-check flag.
Swift Build does not pass environment variables to plugin tools.
Swift Build does not support overlapping executable product names and library product names (case-insensitive).
Please follow these steps when reporting issues: