@@ -16,6 +16,7 @@ public import SWBCore
16
16
public import SWBLLBuild
17
17
import Foundation
18
18
import SWBProtocol
19
+ import TSCBasic
19
20
20
21
public final class ClangCompileTaskAction : TaskAction , BuildValueValidatingTaskAction {
21
22
public override class var toolIdentifier : String {
@@ -273,7 +274,8 @@ public final class ClangCompileTaskAction: TaskAction, BuildValueValidatingTaskA
273
274
casDBs: casDBs,
274
275
workingDirectory: task. workingDirectory,
275
276
outputDelegate: outputDelegate,
276
- enableDiagnosticRemarks: explicitModulesPayload. casOptions!. enableDiagnosticRemarks
277
+ enableDiagnosticRemarks: explicitModulesPayload. casOptions!. enableDiagnosticRemarks,
278
+ casPath: explicitModulesPayload. casOptions!. casPath. str
277
279
) {
278
280
lastResult = . succeeded
279
281
continue
@@ -404,7 +406,8 @@ public final class ClangCompileTaskAction: TaskAction, BuildValueValidatingTaskA
404
406
casDBs: ClangCASDatabases ,
405
407
workingDirectory: Path ,
406
408
outputDelegate: any TaskOutputDelegate ,
407
- enableDiagnosticRemarks: Bool
409
+ enableDiagnosticRemarks: Bool ,
410
+ casPath: String
408
411
) throws -> Bool {
409
412
guard let cacheKey = command. cacheKey else {
410
413
throw StubError . error ( " missing cache key " )
@@ -413,6 +416,12 @@ public final class ClangCompileTaskAction: TaskAction, BuildValueValidatingTaskA
413
416
if enableDiagnosticRemarks {
414
417
outputDelegate. note ( " cache miss: \( cacheKey) " )
415
418
}
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 ( ) )
416
425
outputDelegate. incrementCounter ( . clangCacheMisses)
417
426
outputDelegate. incrementTaskCounter ( . cacheMisses)
418
427
outputDelegate. emitOutput ( " Cache miss \n " )
0 commit comments