summaryrefslogtreecommitdiff
path: root/src/other_tools/just_mr/launch.cpp
diff options
context:
space:
mode:
authorKlaus Aehlig <klaus.aehlig@huawei.com>2023-12-07 10:59:10 +0100
committerKlaus Aehlig <klaus.aehlig@huawei.com>2023-12-11 15:41:58 +0100
commita1bdc438f3e17b0c30f3a53b0bc5e38ebb7bb936 (patch)
treedca0a5c292eb573d36888cc631e92f6ed4d74428 /src/other_tools/just_mr/launch.cpp
parentbcbfd1fc659df948899fa34e8a1af7fa6f7920e6 (diff)
downloadjustbuild-a1bdc438f3e17b0c30f3a53b0bc5e38ebb7bb936.tar.gz
just-mrrc: support file options for the launcher functionality
When just-mr acts as a launcher, for most subcommand options the "just args" entry in the rc files provides a convenient way to set them. However, some options take a file as argument; for those it can be desirable to set them without assuming a fixed file-system layout and instead refer to logical roots, in particular the work space. for the ones that refer to files, it is often desirable to have a potential reference to the work space. Add this functionality.
Diffstat (limited to 'src/other_tools/just_mr/launch.cpp')
-rw-r--r--src/other_tools/just_mr/launch.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/other_tools/just_mr/launch.cpp b/src/other_tools/just_mr/launch.cpp
index 4e9403a8..2c771836 100644
--- a/src/other_tools/just_mr/launch.cpp
+++ b/src/other_tools/just_mr/launch.cpp
@@ -48,6 +48,7 @@ auto CallJust(std::optional<std::filesystem::path> const& config_file,
bool use_launcher{false};
bool supports_defines{false};
bool supports_remote{false};
+ bool supports_dispatch{false};
bool supports_cacert{false};
bool supports_client_auth{false};
std::optional<std::filesystem::path> mr_config_path{std::nullopt};
@@ -81,6 +82,7 @@ auto CallJust(std::optional<std::filesystem::path> const& config_file,
use_launcher = kKnownJustSubcommands.at(*subcommand).launch;
supports_defines = kKnownJustSubcommands.at(*subcommand).defines;
supports_remote = kKnownJustSubcommands.at(*subcommand).remote;
+ supports_dispatch = kKnownJustSubcommands.at(*subcommand).dispatch;
supports_cacert = kKnownJustSubcommands.at(*subcommand).cacert;
supports_client_auth =
kKnownJustSubcommands.at(*subcommand).client_auth;
@@ -121,6 +123,10 @@ auto CallJust(std::optional<std::filesystem::path> const& config_file,
cmd.emplace_back("--plain-log");
}
if (supports_defines) {
+ if (just_cmd_args.config) {
+ cmd.emplace_back("-c");
+ cmd.emplace_back(just_cmd_args.config->string());
+ }
auto overlay_config = Configuration();
for (auto const& s : common_args.defines) {
try {
@@ -153,6 +159,10 @@ auto CallJust(std::optional<std::filesystem::path> const& config_file,
cmd.emplace_back("-r");
cmd.emplace_back(*common_args.remote_execution_address);
}
+ if (supports_dispatch and just_cmd_args.endpoint_configuration) {
+ cmd.emplace_back("--endpoint-configuration");
+ cmd.emplace_back(*just_cmd_args.endpoint_configuration);
+ }
if (supports_remote and common_args.remote_serve_address) {
cmd.emplace_back("--remote-serve-address");
cmd.emplace_back(*common_args.remote_serve_address);