From 027d8d010948c92abc67fd6410f5a88944973392 Mon Sep 17 00:00:00 2001 From: Klaus Aehlig Date: Fri, 15 Mar 2024 10:36:31 +0100 Subject: Add local launcher to just-serve config As just serve can simultaneously act as remote-execution endpoint, it has to accept in its configuration all the necessary information, in particular, the local launcher. Add it. --- src/buildtool/main/serve.cpp | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'src/buildtool/main/serve.cpp') diff --git a/src/buildtool/main/serve.cpp b/src/buildtool/main/serve.cpp index e2b6635e..cebbd247 100644 --- a/src/buildtool/main/serve.cpp +++ b/src/buildtool/main/serve.cpp @@ -524,6 +524,35 @@ void ReadJustServeConfig(gsl::not_null const& clargs) { } clargs->tc.target_cache_write_strategy = *s_value; } + + auto launcher = build_args->Get("local launcher", Expression::none_t{}); + if (launcher.IsNotNull()) { + if (not launcher->IsList()) { + Logger::Log( + LogLevel::Error, + "In serve service config file {}:\nValue for build key " + "\"local launcher\" has to be a list, but found {}", + clargs->serve.config.string(), + launcher->ToString()); + std::exit(kExitFailure); + } + std::vector launcher_list{}; + for (auto const& entry : launcher->List()) { + if (not entry->IsString()) { + Logger::Log(LogLevel::Error, + "In serve service config file {}:\nValue for " + "build key \"local launcher\" has to be a list " + "of string, but found {} with entry {}", + clargs->serve.config.string(), + launcher->ToString(), + entry->ToString()); + + std::exit(kExitFailure); + } + launcher_list.emplace_back(entry->String()); + } + clargs->build.local_launcher = launcher_list; + } } } -- cgit v1.2.3