* limit `LLVM_PARALLEL_LINK_JOBS` to 4 on CI to prevent OOM
Seems to fail during the link phase of
```
FAILED: [code=1] unittests/Disassembler/DisassemblerTests
```
Seen on both ubuntu 2604 and Debian 13
Add a new --enable-caching option that enables compilation caching for both
C/C++ (via clang-cache as compiler launcher) and Swift code (via
-cache-compile-job flags when bootstrapping=hosttools).
New options:
- --enable-caching: main toggle, incompatible with --sccache/--distcc
- --caching-cas-path: CAS directory (default: $BUILD_ROOT/cas)
- --caching-depscan-socket: depscan daemon socket path
- --caching-plugin-path: CAS plugin library path
- --caching-plugin-option: CAS plugin options (repeatable)
- --caching-prefix-map: enable source/SDK/toolchain prefix mapping
- --caching-remote-service-path: remote caching service with auto
plugin inference from Xcode and implied prefix mapping
The build script starts a clang-cache depscan daemon with reliable cleanup
via atexit and SIGTERM handlers. Per-product build directories get .cas-config
and compilation-prefix-map.json files written automatically.
Caching flags are applied to all Swift host compilation targets: compiler
sources, pure-swift host libraries (ASTGen, macros), swift-syntax, and
the new runtime build when --build-runtime-with-host-compiler is used.
When not using --caching-remote-service-path, enables CAS backend
(-Xfrontend -cas-backend -Xllvm -cas-friendly-debug-info) unless
SWIFT_CACHE_DISABLE_MCCAS is set.
A ninja wrapper is generated at build/<subdir>/build-utils/ninja for
cached incremental builds outside the build-script.
rdar://155876033
Assisted-By: Claude
The reason why I am changing this is that when one runs bisect with --invert,
the last successful snapshot is actually the snapshot where the test case last
failed. We want the tool to also tell us the first place it succeeded rather
than us having to use git to find it ourselves.
- **Explanation**: This enables incremental dependency scan for CAS on
the Windows toolchain build, which bring small but meaningful speedup in
incremental builds with CAS enabled.
- **Scope**: It's a simple flag flip. The flag is already used in the
swift driver tests and is known to work.
- **Issues**: None.
- **Risk**: Low. CAS isn't enabled by default.
- **Testing**: Local toolchain build for Windows and the swift CI.
The two bootstrap macro builds were inlined directly in the main build
sequence as raw Build-CMakeProject calls, inconsistent with every other
build step which is expressed as Invoke-BuildStep <Function> <Platform>.
Extract them into named functions so the build sequence is a uniform list
of Invoke-BuildStep invocations.
Reduce the duplication for the thin to thick conversion that we do on
the SDKs. While it is harder now to identify when the conversion can be
removed, this makes it easier to maintain.
- Explanation: Adds new tests to the repo and makes a couple of minor
swift-dev-utils/crash-reduce improvements (scripts only used at-desk)
- Scope: test/utils
- Issue: N/A
- Risk: None
- Testing: N/A
- Reviewer: TBD