From a9b3d717eac4c4f3b87b2bb7fe9f0961f4bb6fb0 Mon Sep 17 00:00:00 2001 From: Paul Cristian Sarbu Date: Mon, 29 Jan 2024 18:09:56 +0100 Subject: just-mr: Serve endpoint always implies a remote-execution endpoint As the serve service always has an associated remote-execution endpoint, when just-mr gets passed only a serve endpoint address it will now default to implying a remote-execution endpoint exists too at that address. Additionally, now the implementation of the --backup-to-remote option more clearly shows that it can only be done in native mode. --- src/other_tools/just_mr/setup_utils.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/other_tools/just_mr/setup_utils.cpp') diff --git a/src/other_tools/just_mr/setup_utils.cpp b/src/other_tools/just_mr/setup_utils.cpp index c3799b1f..c6805e07 100644 --- a/src/other_tools/just_mr/setup_utils.cpp +++ b/src/other_tools/just_mr/setup_utils.cpp @@ -236,17 +236,20 @@ auto ReadConfiguration( } auto GetRemoteApi(std::optional const& remote_exec_addr, + std::optional const& remote_serve_addr, MultiRepoRemoteAuthArguments const& auth) -> IExecutionApi::Ptr { - // we only allow remotes in native mode - if (remote_exec_addr and not Compatibility::IsCompatible()) { + // if only a serve endpoint address is given, we assume it is one that acts + // also as remote-execution + auto remote_addr = remote_exec_addr ? remote_exec_addr : remote_serve_addr; + if (remote_addr) { // setup authentication SetupAuthConfig(auth); // setup remote - if (not RemoteExecutionConfig::SetRemoteAddress(*remote_exec_addr)) { + if (not RemoteExecutionConfig::SetRemoteAddress(*remote_addr)) { Logger::Log(LogLevel::Error, "setting remote execution address '{}' failed.", - *remote_exec_addr); + *remote_addr); std::exit(kExitConfigError); } auto address = RemoteExecutionConfig::RemoteAddress(); -- cgit v1.2.3