summaryrefslogtreecommitdiff
path: root/src/buildtool/execution_api/bazel_msg
diff options
context:
space:
mode:
authorMaksim Denisov <denisov.maksim@huawei.com>2024-07-05 17:27:13 +0200
committerMaksim Denisov <denisov.maksim@huawei.com>2024-07-22 17:01:13 +0200
commitdd23c6e397584f4bf1cf84a73d9c382a8ff81de7 (patch)
tree0f0f600a4674a03da42c07f4ea016ff3c2dc578e /src/buildtool/execution_api/bazel_msg
parentbeb3faa6956b9bfd58d4ea6644a9b2987409aaba (diff)
downloadjustbuild-dd23c6e397584f4bf1cf84a73d9c382a8ff81de7.tar.gz
Pass HashFunction to ArtifactDigest::Create
Diffstat (limited to 'src/buildtool/execution_api/bazel_msg')
-rw-r--r--src/buildtool/execution_api/bazel_msg/TARGETS1
-rw-r--r--src/buildtool/execution_api/bazel_msg/bazel_msg_factory.cpp10
2 files changed, 8 insertions, 3 deletions
diff --git a/src/buildtool/execution_api/bazel_msg/TARGETS b/src/buildtool/execution_api/bazel_msg/TARGETS
index cc14a0df..db495aa5 100644
--- a/src/buildtool/execution_api/bazel_msg/TARGETS
+++ b/src/buildtool/execution_api/bazel_msg/TARGETS
@@ -34,6 +34,7 @@
[ ["src/buildtool/compatibility", "compatibility"]
, ["src/utils/cpp", "hex_string"]
, ["src/buildtool/file_system", "file_system_manager"]
+ , ["src/buildtool/crypto", "hash_function"]
, ["src/buildtool/file_system", "git_repo"]
]
, "stage": ["src", "buildtool", "execution_api", "bazel_msg"]
diff --git a/src/buildtool/execution_api/bazel_msg/bazel_msg_factory.cpp b/src/buildtool/execution_api/bazel_msg/bazel_msg_factory.cpp
index 48c8b062..155067fd 100644
--- a/src/buildtool/execution_api/bazel_msg/bazel_msg_factory.cpp
+++ b/src/buildtool/execution_api/bazel_msg/bazel_msg_factory.cpp
@@ -27,6 +27,7 @@
#include "src/buildtool/common/bazel_types.hpp"
#include "src/buildtool/compatibility/native_support.hpp"
+#include "src/buildtool/crypto/hash_function.hpp"
#include "src/buildtool/file_system/file_system_manager.hpp"
#include "src/buildtool/file_system/git_repo.hpp"
#include "src/utils/cpp/hex_string.hpp"
@@ -184,7 +185,8 @@ template <class T>
if (not content) {
return std::nullopt;
}
- auto digest = ArtifactDigest::Create<ObjectType::File>(*content);
+ auto digest = ArtifactDigest::Create<ObjectType::File>(
+ HashFunction::Instance(), *content);
auto msg = CreateDirectoryNode(dir_name);
msg.set_allocated_digest(
@@ -223,7 +225,8 @@ template <class T>
if (not content) {
return std::nullopt;
}
- auto digest = ArtifactDigest::Create<ObjectType::File>(*content);
+ auto digest = ArtifactDigest::Create<ObjectType::File>(
+ HashFunction::Instance(), *content);
return BazelBlob{digest, std::move(*content), /*is_exec=*/false};
}
@@ -259,7 +262,8 @@ template <class T>
if (not content) {
return std::nullopt;
}
- auto digest = ArtifactDigest::Create<ObjectType::File>(*content);
+ auto digest = ArtifactDigest::Create<ObjectType::File>(
+ HashFunction::Instance(), *content);
return BazelBlob{digest, std::move(*content), /*is_exec=*/false};
}