Skip to content

Commit c696593

Browse files
[Caching] Downgrade output loading error to a warning
If the output loading failed after cache key lookup, treat that as a warning and resume as if that is a cache miss. This is not a valid configuration for builtin CAS but can happen for a remote CAS service that failed to serve the output. Instead of failing, we should continue to compile to avoid disruptive failures. rdar://140822432
1 parent 53ce9b9 commit c696593

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

include/swift/AST/DiagnosticsFrontend.def

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -511,6 +511,7 @@ REMARK(output_cache_miss, none, "cache miss for input file '%0': key '%1'", (Str
511511

512512
// CAS related diagnostics
513513
ERROR(error_cas, none, "CAS error encountered: %0", (StringRef))
514+
WARNING(cache_replay_failed, none, "cache replay failed: %0", (StringRef))
514515

515516
ERROR(error_failed_cached_diag, none, "failed to serialize cached diagnostics: %0", (StringRef))
516517
ERROR(error_replay_cached_diag, none, "failed to replay cached diagnostics: %0", (StringRef))

lib/Frontend/CachingUtils.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,8 @@ bool replayCachedCompilerOutputs(
226226
OutputEntry{OutputPath->second, OutID, Kind, Input, *Proxy});
227227
return Error::success();
228228
})) {
229-
Diag.diagnose(SourceLoc(), diag::error_cas, toString(std::move(Err)));
229+
Diag.diagnose(SourceLoc(), diag::cache_replay_failed,
230+
toString(std::move(Err)));
230231
return lookupFailed();
231232
}
232233
};

0 commit comments

Comments
 (0)