diff options
author | Maksim Denisov <denisov.maksim@huawei.com> | 2024-08-29 17:29:49 +0200 |
---|---|---|
committer | Maksim Denisov <denisov.maksim@huawei.com> | 2024-08-30 17:17:09 +0200 |
commit | 013d83eed166049be110d47f00feb4c6af1315af (patch) | |
tree | d792e9f6a180337365f639a17c0e07b52b480b37 /test/utils/remote_execution/bazel_action_creator.hpp | |
parent | 576e31959bb7550bdd2b348f5d096f4926e859c6 (diff) | |
download | justbuild-013d83eed166049be110d47f00feb4c6af1315af.tar.gz |
Use BazelDigestFactory to create bazel_re::Digest directly if needed
...bypassing ArtifactDigest functionality.
Diffstat (limited to 'test/utils/remote_execution/bazel_action_creator.hpp')
-rw-r--r-- | test/utils/remote_execution/bazel_action_creator.hpp | 13 |
1 files changed, 7 insertions, 6 deletions
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<ObjectType::File>(hash_function, cmd_data); + auto cmd_id = BazelDigestFactory::HashDataAs<ObjectType::File>( + 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<ObjectType::Tree>(hash_function, dir_data); + auto dir_id = BazelDigestFactory::HashDataAs<ObjectType::Tree>( + hash_function, dir_data); blobs.emplace_back(dir_id, dir_data, /*is_exec=*/false); bazel_re::Action action; @@ -82,8 +83,8 @@ gsl::owner<bazel_re::Digest*>{new bazel_re::Digest{dir_id}}); auto action_data = action.SerializeAsString(); - auto action_id = - ArtifactDigest::Create<ObjectType::File>(hash_function, action_data); + auto action_id = BazelDigestFactory::HashDataAs<ObjectType::File>( + hash_function, action_data); blobs.emplace_back(action_id, action_data, /*is_exec=*/false); auto auth_config = TestAuthConfig::ReadFromEnvironment(); |