summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/buildtool/execution_api/bazel_msg/bazel_msg_factory.cpp7
-rw-r--r--src/buildtool/execution_api/bazel_msg/bazel_msg_factory.hpp5
2 files changed, 8 insertions, 4 deletions
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 155067fd..52002c47 100644
--- a/src/buildtool/execution_api/bazel_msg/bazel_msg_factory.cpp
+++ b/src/buildtool/execution_api/bazel_msg/bazel_msg_factory.cpp
@@ -185,8 +185,11 @@ template <class T>
if (not content) {
return std::nullopt;
}
- auto digest = ArtifactDigest::Create<ObjectType::File>(
- HashFunction::Instance(), *content);
+
+ // SHA256 is used since bazel types are processed here.
+ HashFunction const hash_function{HashFunction::JustHash::Compatible};
+ auto digest =
+ ArtifactDigest::Create<ObjectType::File>(hash_function, *content);
auto msg = CreateDirectoryNode(dir_name);
msg.set_allocated_digest(
diff --git a/src/buildtool/execution_api/bazel_msg/bazel_msg_factory.hpp b/src/buildtool/execution_api/bazel_msg/bazel_msg_factory.hpp
index 720d00d5..e8dc6da0 100644
--- a/src/buildtool/execution_api/bazel_msg/bazel_msg_factory.hpp
+++ b/src/buildtool/execution_api/bazel_msg/bazel_msg_factory.hpp
@@ -51,8 +51,9 @@ class BazelMsgFactory {
using TreeStoreFunc =
std::function<std::optional<bazel_re::Digest>(std::string const&)>;
- /// \brief Create Directory digest from artifact tree structure.
- /// Recursively traverse entire tree and create blobs for sub-directories.
+ /// \brief Create Directory digest from artifact tree structure. Uses
+ /// compatible HashFunction for hashing. Recursively traverse entire tree
+ /// and create blobs for sub-directories.
/// \param tree Directory tree of artifacts.
/// \param resolve_links Function for resolving symlinks.
/// \param process_blob Function for processing Directory blobs.