diff --git a/lib/DriverTool/swift_cache_tool_main.cpp b/lib/DriverTool/swift_cache_tool_main.cpp index 96f9bd6081772..9c1659196be6d 100644 --- a/lib/DriverTool/swift_cache_tool_main.cpp +++ b/lib/DriverTool/swift_cache_tool_main.cpp @@ -135,8 +135,15 @@ class SwiftCacheToolInvocation { } // Fallback to default path if not set. - if (CASOpts.CASPath.empty() && CASOpts.PluginPath.empty()) - CASOpts.CASPath = getDefaultOnDiskCASPath(); + if (CASOpts.CASPath.empty() && CASOpts.PluginPath.empty()) { + auto DefaultPath = getDefaultOnDiskCASPath(); + if (!DefaultPath) { + Diags.diagnose(SourceLoc(), diag::error_cas, "get default path", + toString(DefaultPath.takeError())); + return 1; + } + CASOpts.CASPath = *DefaultPath; + } Inputs = ParsedArgs.getAllArgValues(OPT_INPUT); FrontendArgs = ParsedArgs.getAllArgValues(OPT__DASH_DASH); diff --git a/test/CAS/binary_module_deps.swift b/test/CAS/binary_module_deps.swift index 0914c730ad182..17697c10b98c8 100644 --- a/test/CAS/binary_module_deps.swift +++ b/test/CAS/binary_module_deps.swift @@ -11,7 +11,7 @@ /// Test binary module key: binary module key is the CASID of itself. // RUN: %{python} %S/Inputs/SwiftDepsExtractor.py %t/deps.json swiftPrebuiltExternal:A moduleCacheKey > %t/A.key.casid -// RUN: llvm-cas --cas %t/cas --cat-blob @%t/A.key.casid > %t/Loaded.swiftmodule +// RUN: llvm-cas --cas %t/cas --cat-node-data @%t/A.key.casid > %t/Loaded.swiftmodule // RUN: diff %t/A.swiftmodule %t/Loaded.swiftmodule import A