[Caching] Improve diagnostics around swift caching

Improve diagnostics message for swift caching build by trying to emit
the diagnostics early when there is more context to differentiate the
different kind of problems.

After the improvement, CAS Error should be more closer to when there is
functional problem with the CAS, rather than mixing in other kinds of
problem (like scanning dependency failures) when operating with a CAS.

rdar://145676736
This commit is contained in:
Steven Wu
2025-04-08 15:57:33 -07:00
parent 11cf263347
commit 226552bf23
9 changed files with 178 additions and 127 deletions

View File

@@ -251,7 +251,8 @@ private:
auto BaseKey = Instance.getCompilerBaseKey();
if (!BaseKey) {
Instance.getDiags().diagnose(SourceLoc(), diag::error_cas,
"Base Key doesn't exist");
"query base cache key",
"base cache key doesn't exist");
return std::nullopt;
}