From 3f3e5ef52b9788cefe69e0a8d4ae916c17842a62 Mon Sep 17 00:00:00 2001 From: Maksim Denisov Date: Fri, 20 Dec 2024 14:18:48 +0100 Subject: Pass BackendDescription to StorageConfig from the outside --- src/buildtool/main/main.cpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'src/buildtool/main/main.cpp') diff --git a/src/buildtool/main/main.cpp b/src/buildtool/main/main.cpp index bc159f6c..544027ca 100644 --- a/src/buildtool/main/main.cpp +++ b/src/buildtool/main/main.cpp @@ -134,16 +134,22 @@ void SetupLogging(LogArguments const& clargs) { builder.SetBuildRoot(*eargs.local_root); } + auto backend_description = BackendDescription::Describe( + remote_address, remote_platform_properties, remote_dispatch); + if (not backend_description) { + Logger::Log(LogLevel::Error, std::move(backend_description).error()); + return std::nullopt; + } + auto config = builder.SetHashType(hash_type) - .SetRemoteExecutionArgs( - remote_address, remote_platform_properties, remote_dispatch) + .SetBackendDescription(std::move(backend_description).value()) .Build(); - if (config) { - return *std::move(config); + if (not config) { + Logger::Log(LogLevel::Error, std::move(config).error()); + return std::nullopt; } - Logger::Log(LogLevel::Error, config.error()); - return std::nullopt; + return *std::move(config); } #ifndef BOOTSTRAP_BUILD_TOOL -- cgit v1.2.3