diff options
author | Maksim Denisov <denisov.maksim@huawei.com> | 2024-07-05 17:27:13 +0200 |
---|---|---|
committer | Maksim Denisov <denisov.maksim@huawei.com> | 2024-07-22 17:01:13 +0200 |
commit | dd23c6e397584f4bf1cf84a73d9c382a8ff81de7 (patch) | |
tree | 0f0f600a4674a03da42c07f4ea016ff3c2dc578e /src/buildtool/execution_api/remote/bazel/bazel_response.cpp | |
parent | beb3faa6956b9bfd58d4ea6644a9b2987409aaba (diff) | |
download | justbuild-dd23c6e397584f4bf1cf84a73d9c382a8ff81de7.tar.gz |
Pass HashFunction to ArtifactDigest::Create
Diffstat (limited to 'src/buildtool/execution_api/remote/bazel/bazel_response.cpp')
-rw-r--r-- | src/buildtool/execution_api/remote/bazel/bazel_response.cpp | 20 |
1 files changed, 11 insertions, 9 deletions
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<BazelBlob> { auto data = dir.SerializeAsString(); - auto digest = ArtifactDigest::Create<ObjectType::File>(data); + auto digest = ArtifactDigest::Create<ObjectType::File>( + 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<ObjectType::File>(link.target()), + .digest = ArtifactDigest::Create<ObjectType::File>( + 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<ObjectType::File>(link.target()), + .digest = ArtifactDigest::Create<ObjectType::File>( + 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<ObjectType::File>(link.target()), + .digest = ArtifactDigest::Create<ObjectType::File>( + 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<ObjectType::File>(link.target()), + .digest = ArtifactDigest::Create<ObjectType::File>( + HashFunction::Instance(), link.target()), .type = ObjectType::Symlink}); } catch (...) { return false; |