@@ -16,6 +16,7 @@ public import SWBCore
1616public import SWBLLBuild
1717import Foundation
1818import SWBProtocol
19+ import TSCBasic
1920
2021public final class ClangCompileTaskAction : TaskAction , BuildValueValidatingTaskAction {
2122 public override class var toolIdentifier : String {
@@ -273,7 +274,8 @@ public final class ClangCompileTaskAction: TaskAction, BuildValueValidatingTaskA
273274 casDBs: casDBs,
274275 workingDirectory: task. workingDirectory,
275276 outputDelegate: outputDelegate,
276- enableDiagnosticRemarks: explicitModulesPayload. casOptions!. enableDiagnosticRemarks
277+ enableDiagnosticRemarks: explicitModulesPayload. casOptions!. enableDiagnosticRemarks,
278+ casPath: explicitModulesPayload. casOptions!. casPath. str
277279 ) {
278280 lastResult = . succeeded
279281 continue
@@ -404,7 +406,8 @@ public final class ClangCompileTaskAction: TaskAction, BuildValueValidatingTaskA
404406 casDBs: ClangCASDatabases ,
405407 workingDirectory: Path ,
406408 outputDelegate: any TaskOutputDelegate ,
407- enableDiagnosticRemarks: Bool
409+ enableDiagnosticRemarks: Bool ,
410+ casPath: String
408411 ) throws -> Bool {
409412 guard let cacheKey = command. cacheKey else {
410413 throw StubError . error ( " missing cache key " )
@@ -413,6 +416,12 @@ public final class ClangCompileTaskAction: TaskAction, BuildValueValidatingTaskA
413416 if enableDiagnosticRemarks {
414417 outputDelegate. note ( " cache miss: \( cacheKey) " )
415418 }
419+ let clangCASTool = Path ( command. arguments [ 0 ] ) . dirname. join ( " clang-cas-test " )
420+ let command : [ String ] = [ clangCASTool. str, " --cas " , casPath, " --print-compile-job-cache-key " , cacheKey]
421+ let process = TSCBasic . Process ( arguments: command)
422+ try process. launch ( )
423+ let result = try process. waitUntilExit ( )
424+ try outputDelegate. note ( result. utf8Output ( ) )
416425 outputDelegate. incrementCounter ( . clangCacheMisses)
417426 outputDelegate. incrementTaskCounter ( . cacheMisses)
418427 outputDelegate. emitOutput ( " Cache miss \n " )
0 commit comments