summaryrefslogtreecommitdiff
path: root/src/other_tools/just_mr/setup.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/other_tools/just_mr/setup.cpp')
-rw-r--r--src/other_tools/just_mr/setup.cpp25
1 files changed, 19 insertions, 6 deletions
diff --git a/src/other_tools/just_mr/setup.cpp b/src/other_tools/just_mr/setup.cpp
index 5c24f6c8..729725d2 100644
--- a/src/other_tools/just_mr/setup.cpp
+++ b/src/other_tools/just_mr/setup.cpp
@@ -31,9 +31,7 @@
#include "src/buildtool/multithreading/task_system.hpp"
#include "src/buildtool/serve_api/remote/config.hpp"
#include "src/buildtool/serve_api/remote/serve_api.hpp"
-#include "src/buildtool/storage/config.hpp"
#include "src/buildtool/storage/fs_utils.hpp"
-#include "src/buildtool/storage/storage.hpp"
#include "src/other_tools/just_mr/exit_codes.hpp"
#include "src/other_tools/just_mr/progress_reporting/progress.hpp"
#include "src/other_tools/just_mr/progress_reporting/progress_reporter.hpp"
@@ -54,6 +52,8 @@ auto MultiRepoSetup(std::shared_ptr<Configuration> const& config,
MultiRepoSetupArguments const& setup_args,
MultiRepoJustSubCmdsArguments const& just_cmd_args,
MultiRepoRemoteAuthArguments const& auth_args,
+ StorageConfig const& storage_config,
+ Storage const& storage,
bool interactive,
std::string multi_repo_tool_name)
-> std::optional<std::filesystem::path> {
@@ -124,8 +124,8 @@ auto MultiRepoSetup(std::shared_ptr<Configuration> const& config,
return std::nullopt;
}
- ApiBundle const apis{&StorageConfig::Instance(),
- &Storage::Instance(),
+ ApiBundle const apis{&storage_config,
+ &storage,
/*repo_config=*/nullptr,
&*auth_config,
RemoteExecutionConfig::RemoteAddress()};
@@ -140,7 +140,7 @@ auto MultiRepoSetup(std::shared_ptr<Configuration> const& config,
return std::nullopt;
}
- auto serve = ServeApi::Create(*serve_config, &Storage::Instance(), &apis);
+ auto serve = ServeApi::Create(*serve_config, &storage, &apis);
// check configuration of the serve endpoint provided
if (serve) {
@@ -178,6 +178,8 @@ auto MultiRepoSetup(std::shared_ptr<Configuration> const& config,
common_args.ca_info,
&critical_git_op_map,
serve ? &*serve : nullptr,
+ &storage_config,
+ &storage,
&(*apis.local),
has_remote_api ? &*apis.remote : nullptr,
common_args.jobs);
@@ -186,6 +188,7 @@ auto MultiRepoSetup(std::shared_ptr<Configuration> const& config,
CreateImportToGitMap(&critical_git_op_map,
common_args.git_path->string(),
*common_args.local_launcher,
+ &storage_config,
common_args.jobs);
auto git_tree_fetch_map =
@@ -194,6 +197,7 @@ auto MultiRepoSetup(std::shared_ptr<Configuration> const& config,
common_args.git_path->string(),
*common_args.local_launcher,
serve ? &*serve : nullptr,
+ &storage_config,
&(*apis.local),
has_remote_api ? &*apis.remote : nullptr,
false, /* backup_to_remote */
@@ -209,6 +213,7 @@ auto MultiRepoSetup(std::shared_ptr<Configuration> const& config,
common_args.git_path->string(),
*common_args.local_launcher,
serve ? &*serve : nullptr,
+ &storage_config,
&(*apis.local),
has_remote_api ? &*apis.remote : nullptr,
common_args.fetch_absent,
@@ -223,6 +228,8 @@ auto MultiRepoSetup(std::shared_ptr<Configuration> const& config,
&resolve_symlinks_map,
&critical_git_op_map,
serve ? &*serve : nullptr,
+ &storage_config,
+ &storage,
has_remote_api ? &*apis.remote : nullptr,
common_args.fetch_absent,
common_args.jobs);
@@ -231,6 +238,8 @@ auto MultiRepoSetup(std::shared_ptr<Configuration> const& config,
CreateForeignFileGitMap(&content_cas_map,
&import_to_git_map,
serve ? &*serve : nullptr,
+ &storage_config,
+ &storage,
common_args.fetch_absent,
common_args.jobs);
@@ -240,6 +249,7 @@ auto MultiRepoSetup(std::shared_ptr<Configuration> const& config,
&import_to_git_map,
&resolve_symlinks_map,
serve ? &*serve : nullptr,
+ &storage_config,
has_remote_api ? &*apis.remote : nullptr,
common_args.jobs,
multi_repo_tool_name,
@@ -251,6 +261,8 @@ auto MultiRepoSetup(std::shared_ptr<Configuration> const& config,
&import_to_git_map,
&critical_git_op_map,
serve ? &*serve : nullptr,
+ &storage_config,
+ &storage,
&(*apis.local),
has_remote_api ? &*apis.remote : nullptr,
common_args.jobs);
@@ -261,6 +273,7 @@ auto MultiRepoSetup(std::shared_ptr<Configuration> const& config,
&import_to_git_map,
common_args.fetch_absent,
serve ? &*serve : nullptr,
+ &storage_config,
&(*apis.local),
has_remote_api ? &*apis.remote : nullptr,
common_args.jobs);
@@ -385,5 +398,5 @@ auto MultiRepoSetup(std::shared_ptr<Configuration> const& config,
return std::nullopt;
}
// if successful, return the output config
- return StorageUtils::AddToCAS(Storage::Instance(), mr_config.dump(2));
+ return StorageUtils::AddToCAS(storage, mr_config.dump(2));
}