summaryrefslogtreecommitdiff
path: root/src/buildtool/execution_api/local/local_cas.hpp
diff options
context:
space:
mode:
authorSascha Roloff <sascha.roloff@huawei.com>2022-07-11 19:55:10 +0200
committerSascha Roloff <sascha.roloff@huawei.com>2022-08-05 14:41:31 +0200
commitee6f54124360d8a72b9b545dcc581f3c80d3c8a9 (patch)
tree20ab0e5e0e8132c30da0f99c401750d712fe00d0 /src/buildtool/execution_api/local/local_cas.hpp
parent76c17ffa9e079fdd3d2a7159c02a1d9593e11930 (diff)
downloadjustbuild-ee6f54124360d8a72b9b545dcc581f3c80d3c8a9.tar.gz
Modified artifact digest to provide wire digest on demand
Diffstat (limited to 'src/buildtool/execution_api/local/local_cas.hpp')
-rw-r--r--src/buildtool/execution_api/local/local_cas.hpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/buildtool/execution_api/local/local_cas.hpp b/src/buildtool/execution_api/local/local_cas.hpp
index f8efbb6a..310a3011 100644
--- a/src/buildtool/execution_api/local/local_cas.hpp
+++ b/src/buildtool/execution_api/local/local_cas.hpp
@@ -41,11 +41,12 @@ class LocalCAS {
[[nodiscard]] auto BlobPath(bazel_re::Digest const& digest) const noexcept
-> std::optional<std::filesystem::path> {
- auto blob_path = file_store_.GetPath(digest.hash());
+ auto id = NativeSupport::Unprefix(digest.hash());
+ auto blob_path = file_store_.GetPath(id);
if (FileSystemManager::IsFile(blob_path)) {
return blob_path;
}
- logger_.Emit(LogLevel::Debug, "Blob not found {}", digest.hash());
+ logger_.Emit(LogLevel::Debug, "Blob not found {}", id);
return std::nullopt;
}
@@ -90,7 +91,8 @@ class LocalCAS {
-> std::optional<bazel_re::Digest> {
auto digest = CreateDigest(data);
if (digest) {
- if (StoreBlobData(digest->hash(), data, is_owner)) {
+ if (StoreBlobData(
+ NativeSupport::Unprefix(digest->hash()), data, is_owner)) {
return digest;
}
logger_.Emit(