summaryrefslogtreecommitdiff
path: root/src/other_tools/root_maps/root_utils.hpp
diff options
context:
space:
mode:
authorPaul Cristian Sarbu <paul.cristian.sarbu@huawei.com>2024-10-21 12:51:08 +0200
committerPaul Cristian Sarbu <paul.cristian.sarbu@huawei.com>2024-10-25 13:00:43 +0200
commit6242ef6fff52116398913a40634a71292616c126 (patch)
tree56da133aa074278c71f9489fd637d2aa5c4d1800 /src/other_tools/root_maps/root_utils.hpp
parent0675a0daf093442860d117afb060e5456e37c7e2 (diff)
downloadjustbuild-6242ef6fff52116398913a40634a71292616c126.tar.gz
just-mr and SourceTree: Use new Git execution api instance
In just-mr: to instantiate the new Git api instance, both storage configs, as well as the compatible storage, need to be passed to the maps. While there, use more explicit naming schemes for the storage and CAS instances used. In serve: also acquire gc locks for the local storages when needed to instantiate the new Git api, which now has access to the CAS. In all these instances we also pass, as needed, the local api, which currently still operates only in native mode. This makes no difference currently, but will ensure less changes needed when the future compatible-aware local api will be used instead.
Diffstat (limited to 'src/other_tools/root_maps/root_utils.hpp')
-rw-r--r--src/other_tools/root_maps/root_utils.hpp19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/other_tools/root_maps/root_utils.hpp b/src/other_tools/root_maps/root_utils.hpp
index c055633f..2d3ec6a7 100644
--- a/src/other_tools/root_maps/root_utils.hpp
+++ b/src/other_tools/root_maps/root_utils.hpp
@@ -22,6 +22,8 @@
#include "src/buildtool/execution_api/common/execution_api.hpp"
#include "src/buildtool/multithreading/async_map_consumer.hpp"
#include "src/buildtool/serve_api/remote/serve_api.hpp"
+#include "src/buildtool/storage/config.hpp"
+#include "src/buildtool/storage/storage.hpp"
/// \brief Calls the ServeApi to check whether the serve endpoint has the given
/// tree available to build against.
@@ -43,9 +45,16 @@
/// used by given remote execution endpoint!
/// \param tree_id The Git-tree identifier.
/// \param repo_path Local witnessing Git repository for the tree.
-/// \param remote_api Optional API of the remote-execution endpoint. If nullopt,
-/// skip the upload to the remote CAS; this assumes prior knowledge which
-/// guarantees the tree given by tree_id exists in the remote CAS for the
+/// \param native_storage_config Configuration of the native local storage.
+/// \param compat_storage_config Optional configuration of the compatible local
+/// storage, if it was set up.
+/// \param compat_storage Optional compatible local storage, if it was set up.
+/// \param local_api Optional API that knows how to communicate with the
+/// remote-execution endpoint specified by parameter remote_api, if given. In
+/// particular, it is expected to be provided if the remote is compatible.
+/// \param remote_api Optional API of the remote-execution endpoint.
+/// If nullopt, skip the upload to the remote CAS; this assumes prior knowledge
+/// which guarantees the tree given by tree_id exists in the remote CAS for the
/// duration of the subsequent serve API call; this option should be used
/// carefully, but does result in less remote communication.
/// \param logger An AsyncMapConsumer logger instance.
@@ -58,6 +67,10 @@
ServeApi const& serve,
std::string const& tree_id,
std::filesystem::path const& repo_path,
+ gsl::not_null<StorageConfig const*> const& native_storage_config,
+ StorageConfig const* compat_storage_config,
+ Storage const* compat_storage,
+ IExecutionApi const* local_api,
IExecutionApi const* remote_api,
AsyncMapConsumerLoggerPtr const& logger,
bool no_sync_is_fatal) -> bool;