From 013d83eed166049be110d47f00feb4c6af1315af Mon Sep 17 00:00:00 2001 From: Maksim Denisov Date: Thu, 29 Aug 2024 17:29:49 +0200 Subject: Use BazelDigestFactory to create bazel_re::Digest directly if needed ...bypassing ArtifactDigest functionality. --- test/utils/remote_execution/bazel_action_creator.hpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'test/utils/remote_execution/bazel_action_creator.hpp') diff --git a/test/utils/remote_execution/bazel_action_creator.hpp b/test/utils/remote_execution/bazel_action_creator.hpp index 7b92428d..ad9b3fbc 100644 --- a/test/utils/remote_execution/bazel_action_creator.hpp +++ b/test/utils/remote_execution/bazel_action_creator.hpp @@ -24,6 +24,7 @@ #include "gsl/gsl" #include "src/buildtool/auth/authentication.hpp" +#include "src/buildtool/common/bazel_digest_factory.hpp" #include "src/buildtool/common/bazel_types.hpp" #include "src/buildtool/common/remote/retry_config.hpp" #include "src/buildtool/crypto/hash_function.hpp" @@ -64,14 +65,14 @@ }); auto cmd_data = cmd.SerializeAsString(); - auto cmd_id = - ArtifactDigest::Create(hash_function, cmd_data); + auto cmd_id = BazelDigestFactory::HashDataAs( + hash_function, cmd_data); blobs.emplace_back(cmd_id, cmd_data, /*is_exec=*/false); bazel_re::Directory empty_dir; auto dir_data = empty_dir.SerializeAsString(); - auto dir_id = - ArtifactDigest::Create(hash_function, dir_data); + auto dir_id = BazelDigestFactory::HashDataAs( + hash_function, dir_data); blobs.emplace_back(dir_id, dir_data, /*is_exec=*/false); bazel_re::Action action; @@ -82,8 +83,8 @@ gsl::owner{new bazel_re::Digest{dir_id}}); auto action_data = action.SerializeAsString(); - auto action_id = - ArtifactDigest::Create(hash_function, action_data); + auto action_id = BazelDigestFactory::HashDataAs( + hash_function, action_data); blobs.emplace_back(action_id, action_data, /*is_exec=*/false); auto auth_config = TestAuthConfig::ReadFromEnvironment(); -- cgit v1.2.3