summaryrefslogtreecommitdiff
path: root/src/other_tools/just_mr/setup_utils.cpp
diff options
context:
space:
mode:
authorPaul Cristian Sarbu <paul.cristian.sarbu@huawei.com>2024-07-08 11:28:13 +0200
committerPaul Cristian Sarbu <paul.cristian.sarbu@huawei.com>2024-07-16 17:51:12 +0200
commit978de9de55d9592c258052dd52dc25c788a89d78 (patch)
treedff959d84f1d95af1f0546471d3b2c7eaa47dbc2 /src/other_tools/just_mr/setup_utils.cpp
parentb4cd4d0c0d1b526eab3549c9cba12179dbba3a3f (diff)
downloadjustbuild-978de9de55d9592c258052dd52dc25c788a89d78.tar.gz
Remove the LocalExecutionConfig singleton
...and replace it with passed instances created early via a builder pattern.
Diffstat (limited to 'src/other_tools/just_mr/setup_utils.cpp')
-rw-r--r--src/other_tools/just_mr/setup_utils.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/other_tools/just_mr/setup_utils.cpp b/src/other_tools/just_mr/setup_utils.cpp
index 2c219d95..ae6f5a28 100644
--- a/src/other_tools/just_mr/setup_utils.cpp
+++ b/src/other_tools/just_mr/setup_utils.cpp
@@ -217,6 +217,22 @@ auto CreateAuthConfig(MultiRepoRemoteAuthArguments const& authargs) noexcept
return Auth{};
}
+auto CreateLocalExecutionConfig(MultiRepoCommonArguments const& cargs) noexcept
+ -> std::optional<LocalExecutionConfig> {
+
+ LocalExecutionConfig::Builder builder;
+ if (cargs.local_launcher.has_value()) {
+ builder.SetLauncher(*cargs.local_launcher);
+ }
+
+ auto config = builder.Build();
+ if (config) {
+ return *std::move(config);
+ }
+ Logger::Log(LogLevel::Error, config.error());
+ return std::nullopt;
+}
+
void SetupRemoteConfig(
std::optional<std::string> const& remote_exec_addr,
std::optional<std::string> const& remote_serve_addr) noexcept {