From dd23c6e397584f4bf1cf84a73d9c382a8ff81de7 Mon Sep 17 00:00:00 2001 From: Maksim Denisov Date: Fri, 5 Jul 2024 17:27:13 +0200 Subject: Pass HashFunction to ArtifactDigest::Create --- .../execution_api/remote/bazel/bazel_response.cpp | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'src/buildtool/execution_api/remote/bazel/bazel_response.cpp') diff --git a/src/buildtool/execution_api/remote/bazel/bazel_response.cpp b/src/buildtool/execution_api/remote/bazel/bazel_response.cpp index 1b7682bd..0cb860a3 100644 --- a/src/buildtool/execution_api/remote/bazel/bazel_response.cpp +++ b/src/buildtool/execution_api/remote/bazel/bazel_response.cpp @@ -18,6 +18,7 @@ #include "gsl/gsl" #include "src/buildtool/compatibility/native_support.hpp" +#include "src/buildtool/crypto/hash_function.hpp" #include "src/buildtool/execution_api/bazel_msg/bazel_blob_container.hpp" #include "src/buildtool/execution_api/common/common_api.hpp" #include "src/buildtool/execution_api/remote/bazel/bazel_cas_client.hpp" @@ -30,7 +31,8 @@ namespace { auto ProcessDirectoryMessage(bazel_re::Directory const& dir) noexcept -> std::optional { auto data = dir.SerializeAsString(); - auto digest = ArtifactDigest::Create(data); + auto digest = ArtifactDigest::Create( + HashFunction::Instance(), data); return BazelBlob{std::move(digest), std::move(data), /*is_exec=*/false}; } @@ -99,8 +101,8 @@ auto BazelResponse::Populate() noexcept -> bool { artifacts.emplace( link.path(), Artifact::ObjectInfo{ - .digest = - ArtifactDigest::Create(link.target()), + .digest = ArtifactDigest::Create( + HashFunction::Instance(), link.target()), .type = ObjectType::Symlink}); } catch (...) { return false; @@ -111,8 +113,8 @@ auto BazelResponse::Populate() noexcept -> bool { artifacts.emplace( link.path(), Artifact::ObjectInfo{ - .digest = - ArtifactDigest::Create(link.target()), + .digest = ArtifactDigest::Create( + HashFunction::Instance(), link.target()), .type = ObjectType::Symlink}); dir_symlinks.emplace(link.path()); // add it to set } catch (...) { @@ -126,8 +128,8 @@ auto BazelResponse::Populate() noexcept -> bool { artifacts.emplace( link.path(), Artifact::ObjectInfo{ - .digest = - ArtifactDigest::Create(link.target()), + .digest = ArtifactDigest::Create( + HashFunction::Instance(), link.target()), .type = ObjectType::Symlink}); } catch (...) { return false; @@ -138,8 +140,8 @@ auto BazelResponse::Populate() noexcept -> bool { artifacts.emplace( link.path(), Artifact::ObjectInfo{ - .digest = - ArtifactDigest::Create(link.target()), + .digest = ArtifactDigest::Create( + HashFunction::Instance(), link.target()), .type = ObjectType::Symlink}); } catch (...) { return false; -- cgit v1.2.3