From ee6f54124360d8a72b9b545dcc581f3c80d3c8a9 Mon Sep 17 00:00:00 2001 From: Sascha Roloff Date: Mon, 11 Jul 2022 19:55:10 +0200 Subject: Modified artifact digest to provide wire digest on demand --- src/buildtool/execution_api/local/local_cas.hpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/buildtool/execution_api/local/local_cas.hpp') 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 { - 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 { 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( -- cgit v1.2.3