summaryrefslogtreecommitdiff
path: root/src/buildtool/execution_api
diff options
context:
space:
mode:
authorMaksim Denisov <denisov.maksim@huawei.com>2024-07-09 12:13:04 +0200
committerMaksim Denisov <denisov.maksim@huawei.com>2024-07-12 14:09:08 +0200
commit2e2a3083a21823aa04afa0f02c38b612ca4d1045 (patch)
tree69ce6a5071ebb80887c3f7b2c931c25fff30a284 /src/buildtool/execution_api
parent357dd0b623bdb578b8daa47f2f88caf6ab23858f (diff)
downloadjustbuild-2e2a3083a21823aa04afa0f02c38b612ca4d1045.tar.gz
Remove unused parameters in CreateDirectoryDigestFromTree
Diffstat (limited to 'src/buildtool/execution_api')
-rw-r--r--src/buildtool/execution_api/bazel_msg/bazel_msg_factory.cpp36
-rw-r--r--src/buildtool/execution_api/bazel_msg/bazel_msg_factory.hpp6
2 files changed, 13 insertions, 29 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 9ced1375..1ce53021 100644
--- a/src/buildtool/execution_api/bazel_msg/bazel_msg_factory.cpp
+++ b/src/buildtool/execution_api/bazel_msg/bazel_msg_factory.cpp
@@ -398,8 +398,7 @@ template <class T>
std::string const& root_name,
DirectoryTreePtr const& tree,
BazelMsgFactory::LinkDigestResolveFunc const& resolve_links,
- std::optional<BazelMsgFactory::BlobProcessFunc> const& process_blob,
- std::optional<BazelMsgFactory::InfoStoreFunc> const& store_info,
+ BazelMsgFactory::BlobProcessFunc const& process_blob,
std::filesystem::path const& parent = "") noexcept
-> DirectoryNodeBundle::Ptr {
std::vector<bazel_re::FileNode> file_nodes{};
@@ -410,18 +409,14 @@ template <class T>
for (auto const& [name, node] : *tree) {
if (std::holds_alternative<DirectoryTreePtr>(node)) {
auto const& dir = std::get<DirectoryTreePtr>(node);
- auto const dir_bundle = DirectoryTreeToBundle(name,
- dir,
- resolve_links,
- process_blob,
- store_info,
- parent / name);
+ auto const dir_bundle = DirectoryTreeToBundle(
+ name, dir, resolve_links, process_blob, parent / name);
if (not dir_bundle) {
return nullptr;
}
dir_nodes.emplace_back(dir_bundle->Message());
- if (process_blob and not(*process_blob)(dir_bundle->MakeBlob(
- /*is_exec=*/false))) {
+ if (not process_blob(dir_bundle->MakeBlob(
+ /*is_exec=*/false))) {
return nullptr;
}
}
@@ -445,10 +440,6 @@ template <class T>
file_nodes.emplace_back(
CreateFileNodeFromObjectInfo(name, *object_info));
}
- if (store_info and
- not(*store_info)(parent / name, *object_info)) {
- return nullptr;
- }
}
}
return CreateDirectoryNodeBundle(
@@ -469,19 +460,16 @@ template <class T>
auto BazelMsgFactory::CreateDirectoryDigestFromTree(
DirectoryTreePtr const& tree,
LinkDigestResolveFunc const& resolve_links,
- std::optional<BlobProcessFunc> const& process_blob,
- std::optional<InfoStoreFunc> const& store_info) noexcept
+ BlobProcessFunc const& process_blob) noexcept
-> std::optional<bazel_re::Digest> {
- if (auto bundle = DirectoryTreeToBundle(
- "", tree, resolve_links, process_blob, store_info)) {
- if (process_blob) {
- try {
- if (not(*process_blob)(bundle->MakeBlob(/*is_exec=*/false))) {
- return std::nullopt;
- }
- } catch (...) {
+ if (auto bundle =
+ DirectoryTreeToBundle("", tree, resolve_links, process_blob)) {
+ try {
+ if (not process_blob(bundle->MakeBlob(/*is_exec=*/false))) {
return std::nullopt;
}
+ } catch (...) {
+ return std::nullopt;
}
return bundle->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 817925f9..0a07806d 100644
--- a/src/buildtool/execution_api/bazel_msg/bazel_msg_factory.hpp
+++ b/src/buildtool/execution_api/bazel_msg/bazel_msg_factory.hpp
@@ -42,8 +42,6 @@ class BazelMsgFactory {
using BlobProcessFunc = std::function<bool(BazelBlob&&)>;
/// \brief Store blob.
using BlobStoreFunc = std::function<void(BazelBlob&&)>;
- using InfoStoreFunc = std::function<bool(std::filesystem::path const&,
- Artifact::ObjectInfo const&)>;
using LinkDigestResolveFunc =
std::function<void(std::vector<bazel_re::Digest> const&,
std::vector<std::string>*)>;
@@ -59,13 +57,11 @@ class BazelMsgFactory {
/// \param tree Directory tree of artifacts.
/// \param resolve_links Function for resolving symlinks.
/// \param process_blob Function for processing Directory blobs.
- /// \param store_info Function for storing object infos.
/// \returns Digest representing the entire tree.
[[nodiscard]] static auto CreateDirectoryDigestFromTree(
DirectoryTreePtr const& tree,
LinkDigestResolveFunc const& resolve_links,
- std::optional<BlobProcessFunc> const& process_blob = std::nullopt,
- std::optional<InfoStoreFunc> const& store_info = std::nullopt) noexcept
+ BlobProcessFunc const& process_blob) noexcept
-> std::optional<bazel_re::Digest>;
/// \brief Create Directory digest from local file root.