summaryrefslogtreecommitdiff
path: root/src/buildtool/execution_api/local
diff options
context:
space:
mode:
Diffstat (limited to 'src/buildtool/execution_api/local')
-rw-r--r--src/buildtool/execution_api/local/TARGETS1
-rw-r--r--src/buildtool/execution_api/local/local_api.hpp7
-rw-r--r--src/buildtool/execution_api/local/local_response.hpp9
3 files changed, 11 insertions, 6 deletions
diff --git a/src/buildtool/execution_api/local/TARGETS b/src/buildtool/execution_api/local/TARGETS
index 53b7f717..682c8624 100644
--- a/src/buildtool/execution_api/local/TARGETS
+++ b/src/buildtool/execution_api/local/TARGETS
@@ -42,6 +42,7 @@
, ["src/buildtool/execution_api/execution_service", "cas_utils"]
, ["src/buildtool/file_system", "git_repo"]
, ["src/utils/cpp", "tmp_dir"]
+ , ["src/buildtool/crypto", "hash_function"]
]
, "stage": ["src", "buildtool", "execution_api", "local"]
, "private-deps":
diff --git a/src/buildtool/execution_api/local/local_api.hpp b/src/buildtool/execution_api/local/local_api.hpp
index 5f8fb6a4..e8ba0831 100644
--- a/src/buildtool/execution_api/local/local_api.hpp
+++ b/src/buildtool/execution_api/local/local_api.hpp
@@ -34,6 +34,7 @@
#include "src/buildtool/common/repository_config.hpp"
#include "src/buildtool/compatibility/compatibility.hpp"
#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/artifact_blob_container.hpp"
#include "src/buildtool/execution_api/common/blob_tree.hpp"
@@ -214,8 +215,10 @@ class LocalApi final : public IExecutionApi {
// storage_.ReadTreeInfos() will contain 0 as size.
ArtifactDigest digest =
IsTreeObject(info.type)
- ? ArtifactDigest::Create<ObjectType::Tree>(*content)
- : ArtifactDigest::Create<ObjectType::File>(*content);
+ ? ArtifactDigest::Create<ObjectType::Tree>(
+ HashFunction::Instance(), *content)
+ : ArtifactDigest::Create<ObjectType::File>(
+ HashFunction::Instance(), *content);
// Collect blob and upload to remote CAS if transfer size reached.
if (not UpdateContainerAndUpload<ArtifactDigest>(
diff --git a/src/buildtool/execution_api/local/local_response.hpp b/src/buildtool/execution_api/local/local_response.hpp
index 30d47ca7..c6214320 100644
--- a/src/buildtool/execution_api/local/local_response.hpp
+++ b/src/buildtool/execution_api/local/local_response.hpp
@@ -20,6 +20,7 @@
#include <utility>
#include "gsl/gsl"
+#include "src/buildtool/crypto/hash_function.hpp"
#include "src/buildtool/execution_api/common/execution_response.hpp"
#include "src/buildtool/execution_api/local/local_action.hpp"
#include "src/buildtool/file_system/file_system_manager.hpp"
@@ -139,7 +140,7 @@ class LocalResponse final : public IExecutionResponse {
link.path(),
Artifact::ObjectInfo{
.digest = ArtifactDigest::Create<ObjectType::File>(
- link.target()),
+ HashFunction::Instance(), link.target()),
.type = ObjectType::Symlink});
} catch (...) {
return false;
@@ -151,7 +152,7 @@ class LocalResponse final : public IExecutionResponse {
link.path(),
Artifact::ObjectInfo{
.digest = ArtifactDigest::Create<ObjectType::File>(
- link.target()),
+ HashFunction::Instance(), link.target()),
.type = ObjectType::Symlink});
dir_symlinks.emplace(link.path()); // add it to set
} catch (...) {
@@ -166,7 +167,7 @@ class LocalResponse final : public IExecutionResponse {
link.path(),
Artifact::ObjectInfo{
.digest = ArtifactDigest::Create<ObjectType::File>(
- link.target()),
+ HashFunction::Instance(), link.target()),
.type = ObjectType::Symlink});
} catch (...) {
return false;
@@ -178,7 +179,7 @@ class LocalResponse final : public IExecutionResponse {
link.path(),
Artifact::ObjectInfo{
.digest = ArtifactDigest::Create<ObjectType::File>(
- link.target()),
+ HashFunction::Instance(), link.target()),
.type = ObjectType::Symlink});
} catch (...) {
return false;