summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaksim Denisov <denisov.maksim@huawei.com>2024-07-26 11:47:57 +0200
committerMaksim Denisov <denisov.maksim@huawei.com>2024-08-07 14:43:19 +0200
commit010944c231bc32918ec70274e4da7aad710c288f (patch)
tree1ba26a22d09d33df1dc2d81b5783b12a7f05ec9b
parentc1edc2e21ecf381470d71767dc38a83c85f57d23 (diff)
downloadjustbuild-010944c231bc32918ec70274e4da7aad710c288f.tar.gz
Remove HashFunction field from LocalAC
...and get it from LocalCAS.
-rw-r--r--src/buildtool/storage/local_ac.hpp6
-rw-r--r--src/buildtool/storage/local_ac.tpp19
2 files changed, 9 insertions, 16 deletions
diff --git a/src/buildtool/storage/local_ac.hpp b/src/buildtool/storage/local_ac.hpp
index 920413cd..49f46b9d 100644
--- a/src/buildtool/storage/local_ac.hpp
+++ b/src/buildtool/storage/local_ac.hpp
@@ -48,10 +48,7 @@ class LocalAC {
GenerationConfig const& config,
gsl::not_null<Uplinker<kDoGlobalUplink> const*> const&
uplinker) noexcept
- : cas_{*cas},
- file_store_{config.action_cache},
- uplinker_{*uplinker},
- hash_function_{config.storage_config->hash_function} {};
+ : cas_{*cas}, file_store_{config.action_cache}, uplinker_{*uplinker} {}
LocalAC(LocalAC const&) = default;
LocalAC(LocalAC&&) noexcept = default;
@@ -98,7 +95,6 @@ class LocalAC {
FileStorage<ObjectType::File, kStoreMode, /*kSetEpochTime=*/false>
file_store_;
Uplinker<kDoGlobalUplink> const& uplinker_;
- HashFunction const hash_function_;
[[nodiscard]] auto ReadResult(bazel_re::Digest const& digest) const noexcept
-> std::optional<bazel_re::ActionResult>;
diff --git a/src/buildtool/storage/local_ac.tpp b/src/buildtool/storage/local_ac.tpp
index 122549bb..47da88f7 100644
--- a/src/buildtool/storage/local_ac.tpp
+++ b/src/buildtool/storage/local_ac.tpp
@@ -18,7 +18,6 @@
#include <tuple> //std::ignore
#include "src/buildtool/common/bazel_types.hpp"
-#include "src/buildtool/crypto/hash_function.hpp"
#include "src/buildtool/logging/log_level.hpp"
#include "src/buildtool/storage/local_ac.hpp"
@@ -103,20 +102,18 @@ requires(kIsLocalGeneration) auto LocalAC<kDoGlobalUplink>::LocalUplinkEntry(
}
}
for (auto const& link : result->output_file_symlinks()) {
- if (not cas_.LocalUplinkBlob(
- latest.cas_,
- bazel_re::Digest(ArtifactDigest::Create<ObjectType::File>(
- hash_function_, link.target())),
- /*is_executable=*/false)) {
+ if (not cas_.LocalUplinkBlob(latest.cas_,
+ ArtifactDigest::Create<ObjectType::File>(
+ cas_.GetHashFunction(), link.target()),
+ /*is_executable=*/false)) {
return false;
}
}
for (auto const& link : result->output_directory_symlinks()) {
- if (not cas_.LocalUplinkBlob(
- latest.cas_,
- bazel_re::Digest(ArtifactDigest::Create<ObjectType::File>(
- hash_function_, link.target())),
- /*is_executable=*/false)) {
+ if (not cas_.LocalUplinkBlob(latest.cas_,
+ ArtifactDigest::Create<ObjectType::File>(
+ cas_.GetHashFunction(), link.target()),
+ /*is_executable=*/false)) {
return false;
}
}