Skip to content
CAI
Software that uses CAICheck a score

swiftlang/swift-build

60.7

Adequate · 1 October 2026

147.5k

lines of production code

Swift

primary language

2

measurements over time

CAI band scale
CAI trend line
CAI lens gauges

What this system is

Swift Build is the default build system for the Swift ecosystem, responsible for compiling, linking, and packaging code across a wide range of platforms including macOS, Linux, Windows, Android, QNX, and WebAssembly. It provides a plugin-based architecture that manages platform-specific toolchains, SDK discovery, and build specifications while supporting advanced features like compilation caching, artifact bundles, and granular build configuration filtering. The system exposes a robust protocol for client integration, enabling IDEs and other tools to query build descriptions, manage caches, and execute builds with fine-grained control over targets and dependencies.

How it got here

2025 — Swift 6 migration and cross-platform expansion

88 changes.

This period focused on upgrading the codebase to Swift 6, introducing CMake build support, and expanding platform coverage to include Android, WebAssembly, FreeBSD, OpenBSD, and bare-metal targets. Significant work also went into enhancing build caching, adding granular configuration filters, and refactoring core modules for concurrency safety and extensibility.

2026 — Testing infrastructure and developer tooling

4 changes.

This period focused on expanding test coverage for WebAssembly and static Linux SDK integration, ensuring correct build and execution of Swift executables. It also introduced developer convenience features, including VS Code Dev Container support and a mock CAS plugin to facilitate local testing of compilation caching mechanisms.

Features

Add WebAssembly platform support via plugin

The Swift build system now includes a dedicated plugin for the WebAssembly platform. This change introduces the SWBWebAssemblyPlatform module, which registers a platform extension to recognize the 'webassembly' platform (mapping from WASI triples) and loads associated xcspec files for compilation, linking, and library tooling. A CMake build target is also added to bundle these resources and link against core Swift Build libraries.

Sources/SWBWebAssemblyPlatform · high confidence

Added dev container configuration for Swift development

Developers can now use VS Code Dev Containers to work in a pre-configured Swift nightly environment. The new .devcontainer files set up a Docker Compose service using the swiftlang/swift:nightly-main image, install necessary build dependencies (curl, sqlite3, python3, build-essential), and configure VS Code with the Swift extension and LLDB debugger support.

.devcontainer · high confidence

Added development workspaces and a CI performance test script

Developers can now use two new Xcode workspaces (SwiftBuild+Deps and SwiftPM+SwiftBuild) to co-develop Swift Build with swift-driver and SwiftPM respectively. Additionally, a new shell script (swift-ci-perf-tests.sh) has been added to the Utilities folder to run performance tests in a CI environment.

Utilities · high confidence

Build configuration filters for build files and target dependencies

Users can now apply build configuration filters to build files and target dependencies, allowing them to include or exclude specific files and dependencies based on the active build configuration. This change introduces a new \BuildConfigurationFilter\ model and extends \BuildFile\ and \TargetDependency\ to support these filters, enabling more granular control over which parts of a project are built in different configurations.

Sources/SWBCore/ProjectModel · high confidence

Expanded build service protocol with new API endpoints and message capabilities

The SWBProtocol module introduces several new capabilities for build system clients. A new \BuildDescriptionMessages.swift\ file adds requests to query configured targets, their source files, and to select targets for indexing within a pre-generated build description. The protocol now supports non-blocking dependency graph computation via \NonBlockingComputeDependencyGraphRequest\ to avoid blocking other messages. Build requests can now retain build descriptions in memory (\retainBuildDescription\) and override the llbuild scheduler width (\schedulerLaneWidthOverride\). Diagnostic messages now include traits and attachments, and new metrics expose task-level cache counters. Clients can also query build cache size, look up toolchain identifiers, and retrieve platform-specific target information. The protocol adds explicit commands to clean caches in addition to the build folder, and introduces a \SwiftSDK\ type to represent cross-compilation destinations with toolset resolution. Finally, the \AsyncIPCMessageSequence\ implementation is simplified by removing macOS 15+ availability checks, and \BuildDescriptionID\ is made serializable.

Sources/SWBProtocol · high confidence

Expanded test infrastructure and API surface in SWBTestSupport

The SWBTestSupport module has been significantly expanded to provide more granular control and visibility for build system tests. New capabilities include a controllable MockClock for time-based tests, helpers to locate Swift SDKs from artifact bundles, and new properties in CoreBasedTests to access clang++ and llvm-cas tool paths. The BuildOperationTester now supports reporting task cache keys and capturing diagnostic messages by pattern. Additionally, the module exposes new task action factories (e.g., for object libraries, SDK imports, and embed-in-code accessors) and refactors core test setup to use a unified DeveloperPath enum and MutablePluginManager, allowing tests to better simulate different toolchain environments and plugin configurations.

Sources/SWBTestSupport · high confidence

Export CMake targets for SwiftPM integration

Added CMake configuration files (SwiftBuildConfig.cmake.in and the corresponding CMakeLists.txt) that generate and export SwiftBuild targets with the SwiftBuild:: namespace. This enables other build systems, specifically Swift Package Manager (SwiftPM), to consume the SwiftBuild library as a dependency.

cmake · high confidence

Initial CMake build support and repository configuration updates

Swift Build now supports building with CMake (minimum version 3.26), providing CMake targets for integration with other CMake-based projects. The repository configuration has been updated to enforce Unix line endings via .gitattributes, record the required Swift toolchain version (6.2.0) in .swift-version, and update the README to reflect Swift Build's role as the default SwiftPM build system and its usage with Xcode and xcodebuild. Additional configuration includes a new license header template, updated .gitignore entries for build and index directories, and the removal of the legacy CODEOWNERS file.

(repo-wide) · high confidence

Introduce WebAssembly platform plugin

Added the SWBWebAssemblyPlatformPlugin module, which registers a plugin entry point to initialize the WebAssembly platform support within the build system.

Sources/SWBWebAssemblyPlatformPlugin · high confidence

Introduce build dependency info and artifact bundle metadata support

The build system now supports exporting structured dependency information for all targets in a build via the new \BuildDependencyInfo\ data structure, which can be encoded to JSON for client consumption. Additionally, a new \ArtifactBundleMetadata\ type has been added to parse and validate artifact bundle manifests (info.json), enabling the system to recognize and handle bundles containing executables, static libraries, and Swift SDKs. These changes provide better visibility into build inputs/outputs and support for artifact-based dependency workflows.

Sources/SWBCore · high confidence

New MockToolchainCASPlugin for testing compilation caching

Added a new \MockToolchainCASPlugin\ and its supporting \SWBMockCASPluginSupport\ module to enable local testing of swift-build's compilation caching. The plugin implements the \llcas\\\ C ABI using in-memory dictionaries persisted to on-disk JSON files, simulating both local and remote (global) content-addressable storage (CAS) tiers. It includes a structured call log (\call\_log.jsonl\) to allow tests to verify which caching operations occurred, and a plugin locator that automatically discovers the built dynamic library or framework for test execution.

Sources/MockToolchainCASPlugin, Sources/SWBMockCASPluginSupport · high confidence

New Swift plugin to auto-generate Windows installer component groups

A new Swift Package Plugin, \generate-windows-installer-component-groups\, has been added to the repository. When invoked, this plugin scans the package's targets and automatically generates the XML structure for Windows installer component groups, including library components, resource files (specifically xcspec and xcbuildrules), and directory references. This tool assists in automating the creation of installer content for SwiftBuild on Windows by outputting the necessary ComponentGroup and Directory definitions.

Plugins/generate-windows-installer-component-groups · high confidence

New build settings for DocC symbol graph generation and embedding resources in dSYM bundles

Users can now control DocC symbol graph generation with new build settings: \DOCC\_PRETTY\_PRINT\ for formatted output, \DOCC\_SKIP\_SYNTHESIZED\_MEMBERS\ and \DOCC\_SKIP\_INHERITED\_DOCS\ to filter symbols, and \DOCC\_MINIMUM\_ACCESS\_LEVEL\ to specify the minimum access level (e.g., internal, private, package) for included symbols. Additionally, header visibility for extraction can be controlled via \DOCC\_EXTRACT\_PRIVATE\_HEADERS\_DOCUMENTATION\ and \DOCC\_EXTRACT\_PROJECT\_HEADERS\_DOCUMENTATION\. The \DSYMUTIL\_EMBED\_RESOURCES\ setting allows embedding files into dSYM bundles, and the build system now tracks dSYM bundle directories for proper stale file removal during clean operations.

Sources/SWBCore/SpecImplementations/Tools · high confidence

New compilation caching settings and refined search path lookups

The build system now exposes a comprehensive set of new build settings to control compilation caching behavior, including \CLANG\_ENABLE\_COMPILE\_CACHE\, \SWIFT\_ENABLE\_COMPILE\_CACHE\, and various CAS (Content Addressable Storage) options like \COMPILATION\_CACHE\_CAS\_PATH\ and \COMPILATION\_CACHE\_LIMIT\_SIZE\. Additionally, the \StackedSearchPath\ logic has been refactored to use a typed \StackedSearchPathLookupSubject\ (executable or library) instead of raw paths, improving how the system locates tools and libraries across different operating systems.

Sources/SWBCore/Settings · high confidence

New createBuildDescription command and --allTargets build option

The \swift-build\ console command now supports a new \createBuildDescription\ command, allowing users to generate build descriptions without executing the full build. Additionally, the existing \build\ command accepts a new \--allTargets\ flag, which builds all targets in the workspace (excluding dynamic target variants) when no specific targets are listed via \--target\. The \derivedDataPath\ argument is also normalized to an absolute path relative to the base directory for consistency.

Sources/SwiftBuild/ConsoleCommands · high confidence

New task actions for embed-in-code accessors, object libraries, and SDK imports

This change introduces several new task actions in the build system. A new \GenerateEmbedInCodeAccessorTaskAction\ generates Swift accessors for resources marked \embedInCode\. Support for the \object library\ product type is added via \ObjectLibraryAssemblerTaskAction\, which handles input deduplication on case-insensitive filesystems. \ProcessSDKImportsTaskAction\ sanitizes SDK import metadata by shortening paths to basenames to avoid leaking private machine information. Additionally, \AuxiliaryFileTaskAction\ now supports a \forceWrite\ mode to bypass content-change checks, and \ClangCompileTaskAction\ gains the ability to generate crash reproducers for explicit module build errors.

Sources/SWBTaskExecution/TaskActions · high confidence

Support for bare-metal platforms and generated test entry points

Swift Build now supports building for bare-metal targets (triple system 'none') by registering a new 'none' platform and SDK registry, and introduces generated test entry points for non-Darwin platforms. This includes a new task that discovers tests via the IndexStore and generates a runner executable that supports both XCTest and the Swift Testing library, ensuring proper linkage and execution of test bundles on platforms like Linux and Windows.

Sources/SWBUniversalPlatform · high confidence

Support for object libraries and Swift as a linker driver

This update introduces support for the new 'Object Library' product type, allowing users to build and link object libraries alongside standard static and dynamic libraries. It also adds the ability to use the Swift compiler (\swiftc\) as a linker driver, providing build settings to control linker behavior (such as Mach-O types and runtime arguments) specifically when \swiftc\ is used instead of the default \clang\ linker. Additionally, the specs define a new 'Test Entry Point Generator' tool and update test bundle configurations to support generated test entry points, facilitating better integration with Swift Testing and XCTest discovery.

Sources/SWBUniversalPlatform/Specs · high confidence

Swift Build now supports Apple Command Line Tools and AI model compilation

Swift Build can now discover and build against Apple Command Line Tools installations (SDKs, platforms, and toolchains) without requiring a full Xcode installation, using new plugin extensions. Additionally, the build system introduces a new compiler spec for AI models (com.apple.compilers.aimodel) with sandboxing enabled, and adds support for generating code symbols from String Catalogs (.xcstrings) via the STRING\_CATALOG\_GENERATE\_SYMBOLS build setting.

Sources/SWBApplePlatform · high confidence

SwiftPM Unit Test Runner product type and SSAF build tools

This update adds a new SwiftPM Unit Test Runner product type (com.apple.product-type.tool.swiftpm-test-runner) to DarwinProductTypes.xcspec, enabling generated unit test runners with XCTest discovery. It also introduces compiler specs for the Swift Static Analysis Framework (SSAF) pipeline: clang-ssaf-analyzer, clang-ssaf-linker, and clang-ssaf-src-edit-merger, along with an Extension Point Extractor and AppExtension plist generator. Additionally, it adds an AI Model compiler spec for .aimodel files, deprecates the old WatchKit extension product type, and removes ENABLE\_BITCODE from OCUnit test bundles.

Sources/SWBApplePlatform/Specs · high confidence

Removals

Removed custom SwiftPM plugin and compiler for xcspec processing

The custom \SWBSpecificationsPlugin\ and its associated \SWBSpecificationsCompiler\ tool have been removed. This eliminates the manual build-step that previously compiled \.xcspec\ and \.xcbuildrules\ files by stripping carriage returns and writing them to the plugin work directory. Users relying on this specific SwiftPM integration for processing these specification files will no longer have this automated build command available.

Plugins/SWBSpecificationsPlugin, Sources/SWBSpecificationsCompiler · high confidence

Behavioural changes

Build configuration filters and platform-specific settings in the project model

The project model now supports build configuration filters, allowing build files and target dependencies to be scoped to specific build configurations (e.g., Debug or Release) in addition to existing platform filters. This is implemented via a new BuildConfigurationFilter type and updated serialization for BuildFile and TargetDependency. Additionally, BuildSettings now exposes subscripts for setting single- and multiple-value build settings per platform, enabling platform-specific configuration overrides. The model also introduces new build settings (such as SWIFT\_TREAT\_WARNINGS\_AS\_ERRORS, LINKER\_DRIVER, and SWIFT\_DISABLE\_PARSE\_AS\_LIBRARY), adds FreeBSD platform support, updates platform filter logic for WASI/FreeBSD, and adds new product types for SwiftPM test runners and common static archives.

Sources/SwiftBuild/ProjectModel · high confidence

Build description caching and task storage are hardened for thread safety and cache coherence

The build system now rejects stale cached build descriptions when the workspace changes, using a stat-based signature of SDK metadata files to detect in-place SDK updates that previously went unnoticed. To support this, the BuildDescriptionManager now uses thread-safe mutexes for its internal state and caches, and the BuildDescription structure has been updated to include CAS validation information and artifact details. Additionally, the underlying TaskStore has been refactored into a 'FrozenTaskStore' with immutable, interned storage to ensure thread safety during concurrent access.

Sources/SWBTaskExecution · high confidence

Build model extensions: configuration filters, localization tracking, and task/platform filter updates

The project model protocol now supports build configuration filters on build files and target dependencies, allowing builds to be scoped to specific configurations. A new \knownLocalizations\ field has been added to the Project model to track available localizations. Custom tasks now support an \alwaysOutOfDate\ flag to force re-execution, and platform filters include an \exclude\ option to invert matching logic. Additionally, the \appIDHasFeaturesEnabled\ property has been removed from provisioning source data as it is no longer used.

Sources/SWBProtocol/ProjectModel · high confidence

Build service now supports cleaning caches and detects in-place SDK updates

Users can now explicitly clear build caches via the build service, in addition to the existing build folder clean operation. The service also detects when SDKs are updated in-place (e.g., a version bump applied to an existing install at the same path) and rebuilds the core rather than serving a stale SDK registry. Additionally, the build service now exposes build cache information, including on-disk size, and supports querying platform information for targets.

Sources/SWBBuildService · high confidence

Build system extension points refactored to use context objects and stricter typing

The extension point protocols in SWBCore have been updated to improve modularity and type safety. Extension methods now accept explicit context objects (such as \PlatformInfoExtensionAdditionalPlatformsContext\ and \SDKRegistryExtensionAdditionalSDKsContext\) instead of individual parameters, and many methods have been made \async throws\ to support error handling. The \SettingsBuilderExtension\ protocol now conforms to \Sendable\, and the \addSDKOverridingSettings\ method receives the build environment. Additionally, new capabilities allow extensions to define how source-generating file types behave when a target lacks a Compile Sources phase, and to query platform information via LLVM triples.

Sources/SWBCore/Extensions · high confidence

Build system spec updates: new settings, removed bitcode, and path handling changes

This update to the core build system specifications introduces several new build settings and modifies existing behaviors. It adds support for the 'objectlib' product type, new architecture cohort settings (ENABLE\_COHORT\_ARCHS, COHORT\_BASE\_ARCH, COHORT\_ARCHS), and a setting to skip the bundle hook in mergeable libraries (SKIP\_MERGEABLE\_LIBRARY\_BUNDLE\_HOOK). Bitcode support has been removed, eliminating ENABLE\_BITCODE, HIDE\_BITCODE\_SYMBOLS, and BITCODE\_GENERATION\_MODE. Path handling is refined by changing FRAMEWORK\_SEARCH\_PATHS to use PathOrderedSet and updating EXCLUDED\_RECURSIVE\_SEARCH\_PATH\SUBDIRECTORIES to include \.icon. Additionally, the GENERATE\_MASTER\_OBJECT\_FILE setting is renamed to GENERATE\_PRELINK\_OBJECT\_FILE for inclusive language, and the default value for CHOWN is changed from '/usr/sbin/chown' to 'chown' for better cross-platform discoverability.

Sources/SWBCore/Specs · high confidence

Build system specs refactored for concurrency and new linker capabilities

The build system specifications in SWBCore have been refactored to support Swift concurrency by adopting the Sendable protocol across core types like SpecRegistry, CommandLineToolSpec, and various file type and product type specs. This change introduces new build settings including LINKER\_DRIVER (allowing swiftc as a linker driver), SWIFT\_API\_DIGESTER\_MODE, and ExcludedArchitectures, while also adding support for object library product types and whole-archive linking. Additionally, deprecation warnings for product types can now be gated by deployment target thresholds, and the linker spec now properly handles response file formats and search path logic based on the selected driver.

Sources/SWBCore/SpecImplementations · high confidence

Clang module verifier refactored to use Swift Regex and fixes diagnostic settings

The Clang module verifier now uses Swift's native Regex type instead of Foundation's NSRegularExpression for parsing module maps, simplifying the header extraction logic. Additionally, a typo in the diagnostic location name has been corrected from MODULE\_VERIFIER\_TARGET\_TRIPLE\_ARCHS to MODULE\_VERIFIER\_TARGET\_TRIPLES, and the underlying method name was fixed from verifyDupicateArchitecture to verifyDuplicateArchitecture.

Sources/SWBCore/ClangModuleVerifier · high confidence

Enhanced compilation caching, Windows DLL support, and build directory management

The build system now generates \.cas-config\ and \compilation-prefix-map.json\ files to support remote compilation caching with configurable prefix mappings for Clang and Swift. It also introduces support for \experimentalWindowsDLL\ artifact bundles, automatically copying the correct architecture variant to the target build directory. Additionally, the system now pre-creates cache and Swift stats output directories (including the new \SWIFT\_STATS\_OUTPUT\_DIR\) to allow clean operations to verify their origin, and improves XCFramework handling by selecting libraries based on the specific target architectures and ensuring deterministic ordering for build directory inputs.

Sources/SWBTaskConstruction/TaskProducers/WorkspaceTaskProducers · high confidence

Expanded CAS plugin API and improved error handling

The SWBCAS module now exposes additional APIs for the CAS plugin, including methods to print and parse content IDs, resolve object IDs from digests, and check if objects are materialized. Error handling has been significantly enhanced by adopting the LocalizedError protocol, providing descriptive error messages for operations like ID parsing, digest validation, and cache lookups. The load operation now supports asynchronous execution with cancellation handling, and new methods allow for global cache insertion and flexible cache lookups.

Sources/SWBCAS · high confidence

Expanded generic Unix platform support for FreeBSD, OpenBSD, and static Linux

The generic Unix platform plugin now explicitly supports FreeBSD and OpenBSD as cross-compile targets, in addition to Linux. It introduces a new 'staticlinux' platform variant for musl-based targets, which avoids linking relocatable objects. The plugin also registers fallback developer directory detection for these systems, configures specific linker settings (such as forcing lld on FreeBSD), and updates the specification domains to include these new operating systems.

Sources/SWBGenericUnixPlatform · high confidence

Expanded libclang feature support and API updates

The vendored libclang bindings now expose support for several new Clang capabilities, including directory-listing dependencies for incremental rebuilds, negative stat cache diagnostics, current working directory optimization, reproducer generation for crash debugging, and explicit module cache pruning. The DependencyScanner API has been extended to expose directory dependencies and working directory status, and to provide methods for diagnosing invalid cache entries and generating reproducers. Additionally, CAS database size methods have been updated to use Int64 for better precision.

Sources/SWBCore/LibclangVendored · high confidence

Improved Android SDK and NDK discovery with robust version handling

The Android platform plugin now features a more robust mechanism for discovering Android SDKs and NDKs, moving from a simple directory scan to a structured lookup that validates NDK versions (requiring r23 or later) and parses detailed metadata like ABIs and deployment targets. This change introduces an \AndroidPlugin\ class that caches these installations and exposes them to other extensions, ensuring that environment variables (\ANDROID\_HOME\, \ANDROID\_SDK\_ROOT\, \ANDROID\_NDK\_ROOT\, \ANDROID\_NDK\_HOME\) are set based on the validated, preferred NDK installation. The update also refactors how platform information and SDK search paths are managed, blocking default SDK registration for Android to rely on this new, more precise discovery logic.

Sources/SWBAndroidPlatform · high confidence

Improved Clang module dependency tracking and compilation caching behavior

The build system now tracks directory-listing dependencies for Clang modules, ensuring that adding or removing files from umbrella or framework directories triggers correct incremental rebuilds. Compilation caching diagnostics have been changed from remarks to notes, and the system now supports generating reproducer files when precompiling a module fails or crashes. Additionally, the caching infrastructure has been updated to use Swift concurrency for uploads, simplified hashing contexts, and unified CAS pruning strategies, while the task execution model no longer requires explicit input tracking for dynamic tasks.

Sources/SWBTaskExecution/DynamicTaskSpecs · high confidence

Improved build deduplication and diagnostic handling in Swift driver

The Swift driver now uses signatures based on resolved command-line contents (including response file contents) rather than raw argument lists to uniquely identify jobs, ensuring that jobs with identical effective commands but different dependency sets are not incorrectly deduplicated. The \planBuild\ API has been updated to return diagnostics alongside the success boolean instead of using a delegate, and new debugging endpoints allow querying registered swiftmodules and planning dependencies. Additionally, the internal dependency tracker was refactored to fix a quadratic lookup performance issue and added assertions to prevent out-of-bounds access.

Sources/SWBCore/LibSwiftDriver · high confidence

Improved build diagnostics and concurrency safety in test support

The SwiftBuildTestSupport library now provides richer debugging information for build failures by introducing a new TaskBacktraces module that allows test assertions to inspect and validate detailed build backtraces for specific tasks. Additionally, the CoreQualificationTester now attaches event logs, diagnostics, and output to test results, with optional naming to distinguish multiple build operations. Under the hood, internal concurrency primitives have been migrated from LockedValue to SWBMutex for thread safety, and the test session initialization now supports passing custom environment variables to the build service.

Sources/SwiftBuildTestSupport · high confidence

Improved build stability and performance for XCFrameworks and sanitizers

The task construction system now caches XCFramework output paths and uses dictionary lookups to speed up build planning, while also introducing a new \WindowsDLLCopyContext\ to deterministically handle Windows DLL artifact bundle variants. Additionally, the build system now supports the Memory Tagging Address Sanitizer (MTASan) by including it in stale file removal identifiers, and adds diagnostic support for \ProcessSDKImports\ tasks to improve build output clarity.

Sources/SWBTaskConstruction · high confidence

Improved localization filtering and script execution control in build phases

Copy Files and Resources build phases now respect the BUILD\_ONLY\_KNOWN\_LOCALIZATIONS setting, filtering out files for locales not explicitly supported to reduce build artifacts. Additionally, shell script execution during indexing is now governed by a dedicated shouldPrepareForIndexing logic that skips scripts with no outputs or outputs outside the build directory, preventing unnecessary background runs and potential file-system conflicts.

Sources/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers · high confidence

Improved macro evaluation stability and new path handling capabilities

The macro evaluation engine now uses an iterative stack-based approach instead of recursion to prevent stack overflows during deeply nested macro expansions. XCConfig file parsing now tracks and exposes precise line and column locations for macro assignments, enabling better diagnostic reporting. A new \PathOrderedSet\ macro type has been added to support evaluating paths as a deduplicated, order-preserving set. Additionally, new retrieval operators \not\ and \truncatedversion\ allow for boolean negation and version number truncation within macro expressions.

Sources/SWBMacro · high confidence

Launch Xcode plugin now supports release builds and improved error handling

The \launch-xcode\ command plugin now accepts \--release\ or \--configuration release\ flags to build and launch in release mode, in addition to the default debug configuration. Error handling has been refactored to throw specific, descriptive errors (unsupported platform, build service not found, launch failure) instead of printing messages and returning silently, providing clearer feedback when operations fail.

Plugins/launch-xcode · high confidence

New granular clean operations and build database serialization

The build system now supports cleaning build caches independently of build folders via new \enqueueCleanAndClearCaches\ and \enqueueClearCaches\ APIs, allowing users to selectively remove cached artifacts. Additionally, builds are now serialized per database directory to prevent concurrent llbuild engines from corrupting the same database, and the \BuildOperation\ now records prior build descriptions to help diagnose incremental build signature changes.

Sources/SWBBuildSystem · high confidence

Plugin initialization updated to use MutablePluginManager

The plugin entry points across all platform plugins (Android, Apple, Generic Unix, QNX, Universal, and Windows) now pass a \MutablePluginManager\ instance to the initialization function instead of the previous \PluginManager\. This change aligns the plugin loading mechanism with the Swift 6 upgrade, ensuring that the plugin system correctly handles the mutable manager type required for the new language version.

(repo-wide) · high confidence

QNX platform plugin refactored with state caching and updated build configuration

The QNX platform plugin now uses a dedicated \QNXPlugin\ class to cache QNX SDP installation lookups, improving performance by avoiding redundant system scans. The plugin's initialization has been updated to pass this plugin instance to its extensions, and the \QNXSDP\ struct now accepts a host operating system parameter for installation discovery. Additionally, the plugin registers a \LINKER\_DRIVER\ setting for QNX SDKs, updates the toolchain constructor to use explicit named parameters, and adds a new \platformName\ extension to map QNX triples. A CMake build file has also been added to support building the plugin as part of the Swift Build project.

Sources/SWBQNXPlatform · high confidence

Refactor Clang blocklists and add Apple Clang detection

The Clang tool info now consolidates caching and module verification restrictions into a unified blocklist structure, allowing separate configuration files for compile caching and the builtin module verifier. Additionally, the system now detects whether the Clang compiler is Apple Clang by checking for the \_\_apple\_build\version\\_ macro, and exposes new feature flags for deployment target environment variables and SSAF invocation.

Sources/SWBCore/ToolInfo · high confidence

Refactor task producer context and introduce extension points for post-build processing

The task construction system has been refactored to improve thread safety and extensibility. Access to build description invalidation paths is now centralized in the \TaskProducerContext\ using a lock-protected state, ensuring that file accesses during task generation correctly trigger rebuilds. The \TaskProducerContext\ and related classes have been made \public\ to support broader integration, and the \TaskProducer\ protocol has removed the deprecated \provisionalTasks\ mechanism. Additionally, new extension points (\TaskProducerExtension\ and \ProductPostprocessingStep\) allow plugins to inject custom task producers and define post-processing steps that run after build phases, enabling more flexible build customization.

Sources/SWBTaskConstruction/TaskProducers · high confidence

Refinements to custom task execution, headermap construction, and module verification

Custom tasks now include their environment in display strings and can be forced to always execute via the alwaysOutOfData flag, with improved hash stability and compilation requirement gating for output types like headers. Headermap construction has been refactored to use task validation criteria instead of provisional tasks, with stricter error handling and fixes to file path resolution. Module verification now supports a blocklist for builtin modules, uses target triples instead of archs, and skips execution in the index build arena. Info.plist generation now iterates over target triples rather than architectures, and supports passing client libraries for codeless bundles. Product postprocessing skips stripping for object libraries and respects a new option to copy only binaries during copy-aside.

Sources/SWBTaskConstruction/TaskProducers/OtherTaskProducers · high confidence

Removal of libreadline dependency

The module map for the readline package has been removed, indicating that the library no longer links against or exposes the system libreadline library. This change eliminates the external dependency on libreadline for this component.

Packages/Sources · high confidence

Replace provisional tasks with validity criteria and add task producer extensions

The build system now uses explicit validity criteria to determine whether a task should be included in the final plan, replacing the previous provisional task mechanism. This change improves build description invalidation reliability by ensuring tasks are only considered valid if their specific criteria are met, and fixes issues with shared PCH staleness by introducing ordering gate tasks. Additionally, the system now supports extending the build process via task producer extensions, allowing external plugins to inject additional tasks, and introduces new task producers for Windows DLL artifact bundle copying and compilation caching configuration files.

Sources/SWBTaskConstruction/ProductPlanning · high confidence

SWBCSupport: CMake build support and expanded libclang dependency-scanning capabilities

The SWBCSupport module now supports building with CMake, exposing the library as an installable CMake target for downstream projects. This update also extends the libclang wrapper to expose several new dependency-scanning features: directory-listing dependencies for correct incremental rebuilds, current working directory optimization, reproducer generation for crash diagnostics, explicit precompiled module cache pruning, and diagnostics for invalid negative stat cache entries.

Sources/SWBCSupport · high confidence

SWBUtil library refactored for Swift 6 and cross-platform support

The SWBUtil library has been upgraded to Swift 6 and restructured to improve cross-platform compatibility and concurrency safety. This includes adding new types like ByteCount and ArtifactInfo, introducing a new Environment type with task-local helpers, and implementing robust Windows path handling via PathWindows and Win32 helpers. Legacy code such as the TBD parser and GNUReadLine wrapper has been removed, and concurrency primitives have been modernized to use native Swift actors and locks, replacing older patterns like ActorLock and DispatchSemaphore.

Sources/SWBUtil · high confidence

Simplified test project provisioning configuration

The test support library for App Clip projects no longer requires specifying the app ID features flag in provisioning source data. This change removes the \appIDHasFeaturesEnabled\ parameter from the \ProvisioningSourceData\ initialization in the \AppClips.swift\ test helper, simplifying the setup for test projects by relying on default behavior for this flag.

Sources/SWBTestSupport/Projects · high confidence

Support for new build settings, file types, and serialization improvements

The project model now supports the BUILD\_ONLY\_KNOWN\_LOCALIZATIONS build setting, which allows projects to restrict localization to only those regions explicitly known. Icon Composer icon files are now correctly identified with the 'folder.iconcomposer.icon' type, and artifact bundles are recognized as 'wrapper.artifactbundle'. Serialization of platform filters and build configuration filters has been refactored to use dedicated extension methods, improving consistency and fixing nondeterminism in platform filter serialization. Additionally, custom tasks now support an 'alwaysOutOfDate' flag, allowing them to always be considered out of date.

Sources/SWBProjectModel/IDE · high confidence

SwiftBuild API overhaul: new build targets, cache cleaning, and improved diagnostics

This release introduces several significant changes to the SwiftBuild API. The \SWBRunDestinationInfo\ model has been refactored to support Swift SDKs via a new \SWBBuildTarget\ abstraction, replacing the previous flat \platform\/\sdk\ properties while maintaining backward compatibility for older clients. New build commands have been added to \SWBBuildCommand\ to allow clients to clean build caches independently of the build folder. Additionally, the build request now supports reporting task cache keys via \enableTaskCacheKeyReporting\, and build operation backtraces have been enhanced with sorting and collection capabilities for better debugging. The deprecated \SWBMacroEvaluationScope\ API has been removed in favor of \IDEBlueprint.getExportedMacroNamesAndValues()\, and internal synchronization primitives have been migrated from \LockedValue\ to \SWBMutex\.

Sources/SwiftBuild · high confidence

Target dependencies and build files now support build configuration filters

The project model now allows specifying build configuration filters when adding target dependencies, linking libraries, adding resource files, or creating build files. This enables build rules to be applied only in specific configurations (e.g., Debug vs. Release) rather than globally. Additionally, a new product type \swiftpm-test-runner\ is introduced to support generated unit test runners, and the \knownLocalizations\ property is added to the project model to track localizations explicitly.

Sources/SWBProjectModel · high confidence

Windows platform support refactored into a plugin with improved Visual Studio discovery

The Windows platform integration has been restructured from a monolithic initialization into a modular plugin system (SWBWindowsPlatform). This change introduces a dedicated WindowsPlugin class that manages cached lookups for Visual Studio installations and the latest MSVC toolchain version, improving reliability and performance. The platform now registers specific extension points for developer directories, environment variables, platform info, and SDK registry, allowing for more granular control over Windows-specific build behaviors such as SDK search paths and executable discovery. Additionally, the VSInstallation model now parses package components from vswhere, and the build system now uses CMake to bundle necessary xcspec resources for the platform.

Sources/SWBWindowsPlatform · high confidence

Test coverage

Add a command plugin which validates the cmake based build; Added Android platform specification definitions; Added WebAssembly integration tests; Added Windows platform tests for linker discovery and task construction; Added integration tests for Static Linux SDK; Added license headers to test data source files; Added task construction tests for new build system capabilities; Added test coverage for SWBUtil components; Added test coverage for SwiftBuild core capabilities; Added test coverage for build configuration and platform filtering, Swift SDK toolsets, and core build rules; Added test coverage for new build system capabilities; Added tests for Android SDK/NDK discovery and cross-compilation; Added tests for MockToolchainCASPlugin and updated test requirements; Added tests for WebAssembly platform build behavior; Added tests for build configuration filters and serialization determinism; Added tests for cross-compilation and Swift SDK task construction on generic Unix platforms; Added tests for extension point extraction and updated Apple platform spec tests; Added tests for project model build configuration filters and WASI platform matching; Added tests for task execution actions and build description management; Added tests for upward link libraries and build target info API; Expanded and stabilized console command tests across platforms; Expanded macro evaluation and parsing test coverage; Fix unstable performance test assertion for CreateBuildDirectory tasks; QNX platform spec files reorganized and updated for XCTest discovery and linker fixes; Test suite refactored for thread safety; Update SWBUtil performance tests to Swift Testing API; Update performance tests for Swift concurrency and API changes; Updated Swift build performance tests for Apple Silicon architectures; Updated build setting documentation and added security settings; Updated build system performance tests to explicitly specify macOS run destination; Updated compiler build settings and localization strings; Updated generic Unix platform specs for XCTest discovery and cross-platform linker support; Updated protocol message serialization tests to reflect API changes; WebAssembly platform specs added and adapted from Windows/Android; Windows platform build specifications and test coverage.

Dependencies

Upgrade to Swift 6.2 tools version and update platform targets

The package manifest now requires Swift tools version 6.2 and updates the minimum supported platform versions to macOS 15, iOS 18, and Mac Catalyst 18. The build configuration has been refactored to support conditional Swift language modes (v5 and v6) across targets, with several core libraries opting into Swift 6 mode. Additionally, the manifest adds support for non-Darwin platforms including OpenBSD, Android, and FreeBSD, and introduces a new \MockToolchainCASPlugin\ library for testing purposes.

(dependencies) · high confidence

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Score

  • CAI 59 → 61 (+1.3)
  • Rubric changed (rubric-2026.09.11 → rubric-2026.09.18) — scores are not directly comparable.

Lenses

  • Code Health 72 → 73 (+0.8)
  • Architecture 95 → 91 (-4.4)
  • Maturity 61 → 61 (-0.1)
  • Readiness 44 → 53 (+8.7)
  • Security 95 → 95 (+0.0)
  • Performance 63 (new)

Resolved (61)

  • Documentation: no installation or build instructions (README.md)
  • Documentation: no usage examples (README.md)
  • Duplicated block (16 lines × 2) (Plugins/launch-xcode/launch-xcode.swift)
  • Duplicated block (6 lines × 2) (Sources/SWBTaskConstruction/ProductPlanning/ProductPlan.swift)
  • Edited copy of a member (17 corresponding lines) (Sources/SwiftBuild/ConsoleCommands/SWBServiceConsoleBuildCommand.swift)
  • Edited copy of a member (30 corresponding lines) (Sources/SWBTaskExecution/TaskActions/InfoPlistProcessorTaskAction.swift)
  • Edited copy of a member (37 corresponding lines) (Sources/SWBCore/ProjectModel/Target.swift)
  • FixmeComment (Sources/SWBTaskConstruction/TaskProducers/BuildPhaseTaskProducers/SourcesTaskProducer.swift)
  • Hotspot: Sources/SWBApplePlatform/AppIntentsMetadataTaskProducer.swift (Sources/SWBApplePlatform/AppIntentsMetadataTaskProducer.swift)
  • Hotspot: Sources/SWBBuildService/Messages.swift (Sources/SWBBuildService/Messages.swift)
  • Hotspot: Sources/SWBBuildSystem/BuildOperation.swift (Sources/SWBBuildSystem/BuildOperation.swift)
  • Hotspot: Sources/SWBCore/BuildRequestContext.swift (Sources/SWBCore/BuildRequestContext.swift)
  • Hotspot: Sources/SWBCore/DependencyResolution.swift (Sources/SWBCore/DependencyResolution.swift)
  • Hotspot: Sources/SWBCore/SDKRegistry.swift (Sources/SWBCore/SDKRegistry.swift)
  • Hotspot: Sources/SWBCore/Settings/CASOptions.swift (Sources/SWBCore/Settings/CASOptions.swift)
  • Hotspot: Sources/SWBCore/SpecImplementations/Tools/TAPISymbolExtractor.swift (Sources/SWBCore/SpecImplementations/Tools/TAPISymbolExtractor.swift)
  • Hotspot: Sources/SWBCore/ToolchainRegistry.swift (Sources/SWBCore/ToolchainRegistry.swift)
  • Hotspot: Sources/SWBCore/XCFramework.swift (Sources/SWBCore/XCFramework.swift)
  • Hotspot: Sources/SWBMacro/MacroValueAssignmentTable.swift (Sources/SWBMacro/MacroValueAssignmentTable.swift)
  • Hotspot: Sources/SWBProjectModel/PIFGenerationModel.swift (Sources/SWBProjectModel/PIFGenerationModel.swift)
  • …and 41 more

New (99)

  • Ambiguous method naming for optional parameters. The methods differ only by the presence of an optional parameter (impartedBuildSettings). While this is technically distinct, the lack of a distinguishing name (like addBuildConfigWithImpartedSettings) makes the API harder to discover and understand at a glance, relying on parameter count/type rather than semantic intent.
  • BuildResults.buildTranscript (cognitive 29) (Sources/SWBTestSupport/BuildOperationTester.swift)
  • ClangToolInfo.swift.discoveredClangToolInfo (cognitive 27) (Sources/SWBCore/ToolInfo/ClangToolInfo.swift)
  • Coverage not measured — Swift suite
  • Dependency hygiene PARTLY measured — SwiftPM pinning read, dependency currency NOT established
  • Documentation: no contributor guidance (README.md)
  • Duplicated block (10 lines × 2) (Sources/SWBProjectModel/PIFGenerationModel.swift)
  • Duplicated block (10 lines × 2) (Sources/SWBUtil/PbxCp.swift)
  • Duplicated block (11 lines × 2) (Sources/SWBCore/SpecImplementations/Tools/SwiftCompiler.swift)
  • Duplicated block (11 lines × 5) (Sources/SWBProjectModel/IDE/IDESwiftPackageExtensions.swift)
  • Duplicated block (13 lines × 5) (Sources/SWBProjectModel/IDE/IDESwiftPackageExtensions.swift)
  • Duplicated block (13–15 lines × 4) (Sources/SWBProjectModel/IDE/IDESwiftPackageExtensions.swift)
  • Duplicated block (14 lines × 2) (Sources/SWBTestSupport/TaskConstructionTester.swift)
  • Duplicated block (15–16 lines × 2) (Sources/SWBUtil/MsgPack.swift)
  • Duplicated block (16 lines × 2) (Sources/SWBUtil/HashContext.swift)
  • Duplicated block (17 lines × 4) (Sources/SWBTestSupport/TestWorkspaces.swift)
  • Duplicated block (2–5 lines × 3) (Sources/SWBCore/SpecImplementations/Tools/LinkerTools.swift)
  • Duplicated block (5 lines × 2) (Sources/SWBApplePlatform/StubBinaryTaskProducer.swift)
  • Duplicated block (5 lines × 2) (Sources/SWBCore/BuildConfigurationFiltering.swift)
  • Duplicated block (5 lines × 2) (Sources/SWBUtil/PropertyList.swift)
  • …and 79 more

Changes since last survey

  • 77 commits — 70 feature/other, 7 fixes

By area

  • (repo) — 33 commits
  • Sources/SWBCore — 14 commits
  • Sources/SWBTaskConstruction — 6 commits
  • Sources/SWBApplePlatform — 5 commits
  • Sources/SWBTaskExecution — 3 commits
  • Sources/SWBUniversalPlatform — 3 commits
  • Tests/SWBBuildSystemTests — 3 commits
  • Tests/SWBCoreTests — 3 commits
  • Tests/SWBTaskConstructionTests — 3 commits
  • Sources/MockToolchainCASPlugin — 2 commits
  • .github/workflows — 1 commit
  • Tests/SwiftBuildTests — 1 commit

Notable commits

  • fix: Fix XCFramework output path cache test on Windows
  • fix: Fix activeRunDestination_MultiPlatform_Target on Xcode 27 (#1675)
  • fix: Merge pull request #1737 from rjmansfield/fix-installapi-header-produced-set
  • fix: Merge pull request #1742 from rjmansfield/fix-installapi-header-produced-set-6.4.2
  • fix: Merge pull request #1785 from rjmansfield/revert-installapi-discovered-deps
  • fix: Merge pull request #1804 from daveinglis/daveinglis/fix-redundant-try-clangexplicitmodulestests
  • fix: Revert InstallAPI discovered dependency file
  • change: Add 6.4.2 to automerge workflow
  • change: Add missing registrations of string-to-triple dictionaries in Settings creation.
  • change: Add options for toolchain vs. simulator IB compiler modes.
  • change: Avoid decoding the full .scan when validating cached clang scans
  • change: Depend only on actual copied headers for InstallAPI
  • change: Depend only on actual copied headers for InstallAPI
  • change: Detect in-place SDK updates via a stat-based SDK metadata signature
  • change: Ensure we derive correct autolink entries for Foundation when statically linking the stdlib
  • change: Ensure we derive correct autolink entries for Foundation when statically linking the stdlib
  • change: Ensure we derive correct autolink entries for Foundation when statically linking the stdlib
  • change: Ensure we derive correct autolink entries for Foundation when statically linking the stdlib
  • change: Fix trailing whitespace
  • change: Generate versioning files for targets fully built for indexing
  • …and 57 more

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

swiftlang/swift-build was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 1 October 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit 748527d216e310d706108e970cafc1a3166a38d0 — the exact code this score is about.
  • Scored under rubric-2026.09.18 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer preprod-e569280dd5e2.