diff options
Diffstat (limited to 'src/buildtool/main/main.cpp')
-rw-r--r-- | src/buildtool/main/main.cpp | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/src/buildtool/main/main.cpp b/src/buildtool/main/main.cpp index 65daa0d8..ad1447be 100644 --- a/src/buildtool/main/main.cpp +++ b/src/buildtool/main/main.cpp @@ -146,21 +146,6 @@ void SetupServeConfig(ServeArguments const& srvargs, *srvargs.remote_serve_address); std::exit(kExitFailure); } - // if the user has not provided the --remote-execution-address, we fall - // back to the --remote-serve-address - if (auto client_remote_address = RemoteExecutionConfig::RemoteAddress(); - !client_remote_address) { - if (!RemoteExecutionConfig::SetRemoteAddress( - *srvargs.remote_serve_address)) { - Logger::Log(LogLevel::Error, - "Setting remote execution address '{}' failed.", - *srvargs.remote_serve_address); - std::exit(kExitFailure); - } - Logger::Log(LogLevel::Info, - "Using '{}' as the remote execution endpoint.", - *srvargs.remote_serve_address); - } } if (not srvargs.repositories.empty() and not RemoteServeConfig::SetKnownRepositories(srvargs.repositories)) { @@ -863,6 +848,22 @@ auto main(int argc, char* argv[]) -> int { } return kExitSuccess; } + + // If no execution endpoint was given, the client should default to the + // serve endpoint, if given + if (not RemoteExecutionConfig::RemoteAddress() and + arguments.serve.remote_serve_address) { + if (!RemoteExecutionConfig::SetRemoteAddress( + *arguments.serve.remote_serve_address)) { + Logger::Log(LogLevel::Error, + "Setting remote execution address '{}' failed.", + *arguments.serve.remote_serve_address); + std::exit(kExitFailure); + } + Logger::Log(LogLevel::Info, + "Using '{}' as the remote execution endpoint.", + *arguments.serve.remote_serve_address); + } #endif // BOOTSTRAP_BUILD_TOOL auto jobs = arguments.build.build_jobs > 0 ? arguments.build.build_jobs |