summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaksim Denisov <denisov.maksim@huawei.com>2024-06-20 15:39:58 +0200
committerMaksim Denisov <denisov.maksim@huawei.com>2024-06-25 13:59:48 +0200
commit702c9f4af93d66d97f01fcb496b3f699e3a83f6a (patch)
tree274ce9d9c38b879ca37aa8191931906b3e588746
parentc2817da6d108acc38f17bf29900aa66d71337b34 (diff)
downloadjustbuild-702c9f4af93d66d97f01fcb496b3f699e3a83f6a.tar.gz
Remove CreateExecutionApi
-rw-r--r--src/buildtool/execution_api/common/TARGETS7
-rw-r--r--src/buildtool/execution_api/common/api_bundle.cpp2
-rw-r--r--src/buildtool/execution_api/common/api_bundle.hpp24
-rw-r--r--src/buildtool/serve_api/remote/TARGETS1
-rw-r--r--src/buildtool/serve_api/remote/target_client.cpp2
-rw-r--r--src/buildtool/serve_api/serve_service/TARGETS1
-rw-r--r--src/buildtool/serve_api/serve_service/source_tree.cpp1
-rw-r--r--src/other_tools/ops_maps/TARGETS1
-rw-r--r--src/other_tools/ops_maps/git_tree_fetch_map.cpp1
9 files changed, 15 insertions, 25 deletions
diff --git a/src/buildtool/execution_api/common/TARGETS b/src/buildtool/execution_api/common/TARGETS
index f95764ea..a2063a70 100644
--- a/src/buildtool/execution_api/common/TARGETS
+++ b/src/buildtool/execution_api/common/TARGETS
@@ -39,12 +39,15 @@
, "srcs": ["api_bundle.cpp"]
, "stage": ["src", "buildtool", "execution_api", "common"]
, "deps":
- [ ["src/buildtool/common", "config"]
+ [ "common"
+ , ["src/buildtool/common", "config"]
, ["src/buildtool/common/remote", "remote_common"]
+ ]
+ , "private-deps":
+ [ ["src/buildtool/execution_api/bazel_msg", "bazel_msg"]
, ["src/buildtool/execution_api/local", "local"]
, ["src/buildtool/execution_api/remote", "bazel"]
]
- , "private-deps": [["src/buildtool/execution_api/bazel_msg", "bazel_msg"]]
}
, "message_limits":
{ "type": ["@", "rules", "CC", "library"]
diff --git a/src/buildtool/execution_api/common/api_bundle.cpp b/src/buildtool/execution_api/common/api_bundle.cpp
index 06857fc0..85ab49f1 100644
--- a/src/buildtool/execution_api/common/api_bundle.cpp
+++ b/src/buildtool/execution_api/common/api_bundle.cpp
@@ -15,6 +15,8 @@
#include "src/buildtool/execution_api/common/api_bundle.hpp"
#include "src/buildtool/execution_api/bazel_msg/bazel_common.hpp"
+#include "src/buildtool/execution_api/local/local_api.hpp"
+#include "src/buildtool/execution_api/remote/bazel/bazel_api.hpp"
ApiBundle::ApiBundle(
std::optional<gsl::not_null<const RepositoryConfig*>> const& repo_config,
diff --git a/src/buildtool/execution_api/common/api_bundle.hpp b/src/buildtool/execution_api/common/api_bundle.hpp
index 09e06901..2f393dba 100644
--- a/src/buildtool/execution_api/common/api_bundle.hpp
+++ b/src/buildtool/execution_api/common/api_bundle.hpp
@@ -21,29 +21,7 @@
#include "gsl/gsl"
#include "src/buildtool/common/remote/remote_common.hpp"
#include "src/buildtool/common/repository_config.hpp"
-#include "src/buildtool/execution_api/local/local_api.hpp"
-#include "src/buildtool/execution_api/remote/bazel/bazel_api.hpp"
-
-/// \brief Utility function to instantiate either a Local or Bazel Execution
-/// API.
-/// \param address if provided, a BazelApi is instantiated
-/// \param repo_config repository configuration to be used by GitApi calls
-/// \param instance_name only used in the construction of the BazelApi object
-[[nodiscard]] static inline auto CreateExecutionApi(
- std::optional<ServerAddress> const& address,
- std::optional<gsl::not_null<const RepositoryConfig*>> const& repo_config =
- std::nullopt,
- std::string const& instance_name = "remote-execution")
- -> gsl::not_null<IExecutionApi::Ptr> {
- if (address) {
- ExecutionConfiguration config;
- config.skip_cache_lookup = false;
-
- return std::make_unique<BazelApi>(
- instance_name, address->host, address->port, config);
- }
- return std::make_unique<LocalApi>(repo_config);
-}
+#include "src/buildtool/execution_api/common/execution_api.hpp"
/// \brief Utility structure for instantiation of local and remote apis at the
/// same time. If the remote api cannot be instantiated, it falls back to
diff --git a/src/buildtool/serve_api/remote/TARGETS b/src/buildtool/serve_api/remote/TARGETS
index efb923f0..4a92cd40 100644
--- a/src/buildtool/serve_api/remote/TARGETS
+++ b/src/buildtool/serve_api/remote/TARGETS
@@ -63,6 +63,7 @@
, "private-deps":
[ ["src/buildtool/common/remote", "client_common"]
, ["src/buildtool/common", "bazel_types"]
+ , ["src/buildtool/execution_api/remote", "config"]
, ["@", "fmt", "", "fmt"]
, ["@", "json", "", "json"]
]
diff --git a/src/buildtool/serve_api/remote/target_client.cpp b/src/buildtool/serve_api/remote/target_client.cpp
index d0e6796e..c8a7fc94 100644
--- a/src/buildtool/serve_api/remote/target_client.cpp
+++ b/src/buildtool/serve_api/remote/target_client.cpp
@@ -23,7 +23,9 @@
#include "nlohmann/json.hpp"
#include "src/buildtool/common/bazel_types.hpp"
#include "src/buildtool/common/remote/client_common.hpp"
+#include "src/buildtool/execution_api/remote/config.hpp"
#include "src/buildtool/logging/log_level.hpp"
+#include "src/buildtool/storage/storage.hpp"
TargetClient::TargetClient(ServerAddress const& address,
gsl::not_null<ApiBundle const*> const& apis) noexcept
diff --git a/src/buildtool/serve_api/serve_service/TARGETS b/src/buildtool/serve_api/serve_service/TARGETS
index 9e82a4f9..3f51feba 100644
--- a/src/buildtool/serve_api/serve_service/TARGETS
+++ b/src/buildtool/serve_api/serve_service/TARGETS
@@ -35,6 +35,7 @@
, ["src/buildtool/storage", "fs_utils"]
, ["src/buildtool/storage", "storage"]
, ["src/utils/archive", "archive_ops"]
+ , ["src/buildtool/execution_api/git", "git"]
]
}
, "serve_server_implementation":
diff --git a/src/buildtool/serve_api/serve_service/source_tree.cpp b/src/buildtool/serve_api/serve_service/source_tree.cpp
index ff0cb518..634ce795 100644
--- a/src/buildtool/serve_api/serve_service/source_tree.cpp
+++ b/src/buildtool/serve_api/serve_service/source_tree.cpp
@@ -25,6 +25,7 @@
#include "src/buildtool/common/artifact_digest.hpp"
#include "src/buildtool/compatibility/compatibility.hpp"
#include "src/buildtool/compatibility/native_support.hpp"
+#include "src/buildtool/execution_api/git/git_api.hpp"
#include "src/buildtool/file_system/file_system_manager.hpp"
#include "src/buildtool/file_system/git_repo.hpp"
#include "src/buildtool/logging/log_level.hpp"
diff --git a/src/other_tools/ops_maps/TARGETS b/src/other_tools/ops_maps/TARGETS
index 5bfd9093..205e7b83 100644
--- a/src/other_tools/ops_maps/TARGETS
+++ b/src/other_tools/ops_maps/TARGETS
@@ -128,6 +128,7 @@
, ["src/other_tools/just_mr/progress_reporting", "statistics"]
, ["src/other_tools/ops_maps", "content_cas_map"]
, ["src/other_tools/ops_maps", "import_to_git_map"]
+ , ["src/buildtool/execution_api/git", "git"]
, ["@", "fmt", "", "fmt"]
]
}
diff --git a/src/other_tools/ops_maps/git_tree_fetch_map.cpp b/src/other_tools/ops_maps/git_tree_fetch_map.cpp
index b99c7814..0a0c7eb9 100644
--- a/src/other_tools/ops_maps/git_tree_fetch_map.cpp
+++ b/src/other_tools/ops_maps/git_tree_fetch_map.cpp
@@ -22,6 +22,7 @@
#include "src/buildtool/common/repository_config.hpp"
#include "src/buildtool/compatibility/compatibility.hpp"
#include "src/buildtool/execution_api/common/execution_common.hpp"
+#include "src/buildtool/execution_api/git/git_api.hpp"
#include "src/buildtool/file_system/file_system_manager.hpp"
#include "src/buildtool/multithreading/task_system.hpp"
#include "src/buildtool/storage/config.hpp"