summaryrefslogtreecommitdiff
path: root/src/buildtool/execution_api/local/local_action.cpp
diff options
context:
space:
mode:
authorOliver Reiche <oliver.reiche@huawei.com>2022-09-19 13:39:12 +0200
committerOliver Reiche <oliver.reiche@huawei.com>2022-10-05 14:35:36 +0200
commite63fb212be7cc237cbcc32e007c502f8a0e7dab5 (patch)
treedd4a96a869f90b4c6ec8de2055a4155a35c12c62 /src/buildtool/execution_api/local/local_action.cpp
parent72b171430b5c9e90aec5173e33d36f247d308128 (diff)
downloadjustbuild-e63fb212be7cc237cbcc32e007c502f8a0e7dab5.tar.gz
LocalAction: Improve error message for staging
Diffstat (limited to 'src/buildtool/execution_api/local/local_action.cpp')
-rw-r--r--src/buildtool/execution_api/local/local_action.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/buildtool/execution_api/local/local_action.cpp b/src/buildtool/execution_api/local/local_action.cpp
index 3a2beb64..0c15e788 100644
--- a/src/buildtool/execution_api/local/local_action.cpp
+++ b/src/buildtool/execution_api/local/local_action.cpp
@@ -138,8 +138,14 @@ auto LocalAction::StageFile(std::filesystem::path const& target_path,
auto blob_path =
storage_->BlobPath(info.digest, IsExecutableObject(info.type));
- return blob_path and
- FileSystemManager::CreateDirectory(target_path.parent_path()) and
+ if (not blob_path) {
+ logger_.Emit(LogLevel::Error,
+ "artifact with id {} is missing in CAS",
+ info.digest.hash());
+ return false;
+ }
+
+ return FileSystemManager::CreateDirectory(target_path.parent_path()) and
FileSystemManager::CreateFileHardlink(*blob_path, target_path);
}