One more question about SWIFT_ENABLE_COMPILE_CACHE which is available as Build Setting since Xcode 26.
With combination of few more settings:
COMPILATION_CACHE_ENABLE_PLUGIN=YES
COMPILATION_CACHE_REMOTE_SERVICE_PATH=$SOCKET
we can enable CAS plugin putting and querying some build artefacts from external cache service via gRPC.
With Xcode builds and xcodebuild that just works, but it seems not possible to enable the same for pure swift build.
The most straightforward was:
EnableSwiftCachingByDefault=true \
EnableClangCachingByDefault=true \
EnableSwiftExplicitModulesByDefault=true \
swift build --build-system swiftbuild
But in this configuration swift build uses integrated queries, and when it does it completely ignores any cas-plugin-* flags.
What I tried:
EnableSDKStatCaching=0 \
EnableSwiftExplicitModulesByDefault=true \
swift build --build-system swiftbuild \
-Xswiftc -cache-compile-job \
-Xswiftc -cas-path -Xswiftc "$SAMPLE/.build/cas" \
-Xswiftc -cas-plugin-path -Xswiftc "$PLUGIN_PATH" \
-Xswiftc -cas-plugin-option -Xswiftc "remote-service-path=$SOCKET"
But still no calls to remote service.
So obviously bypassing build system is not a good idea, but somehow Xcode setting COMPILATION_CACHE_REMOTE_SERVICE_PATH is being mapped into swiftbuild? Maybe there any plans to support equivalent option for swift build?
Environment
swift-driver version: 1.127.14.1 Apple Swift version 6.2.1 (swiftlang-6.2.1.4.8 clang-1700.4.4.1)
Target: arm64-apple-macosx26.0
Xcode 26.1