diff options
Diffstat (limited to 'src/other_tools/just_mr/launch.cpp')
-rw-r--r-- | src/other_tools/just_mr/launch.cpp | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/other_tools/just_mr/launch.cpp b/src/other_tools/just_mr/launch.cpp index 0d8f263b..61953cda 100644 --- a/src/other_tools/just_mr/launch.cpp +++ b/src/other_tools/just_mr/launch.cpp @@ -33,6 +33,7 @@ auto CallJust(std::optional<std::filesystem::path> const& config_file, MultiRepoSetupArguments const& setup_args, MultiRepoJustSubCmdsArguments const& just_cmd_args, MultiRepoLogArguments const& log_args, + MultiRepoRemoteAuthArguments const& auth_args, bool forward_build_root) -> int { // check if subcmd_name can be taken from additional args auto additional_args_offset = 0U; @@ -46,6 +47,9 @@ auto CallJust(std::optional<std::filesystem::path> const& config_file, bool use_build_root{false}; bool use_launcher{false}; bool supports_defines{false}; + bool supports_remote{false}; + bool supports_cacert{false}; + bool supports_client_auth{false}; std::optional<std::filesystem::path> mr_config_path{std::nullopt}; std::optional<LockFile> lock{}; @@ -74,6 +78,10 @@ auto CallJust(std::optional<std::filesystem::path> const& config_file, use_build_root = kKnownJustSubcommands.at(*subcommand).build_root; use_launcher = kKnownJustSubcommands.at(*subcommand).launch; supports_defines = kKnownJustSubcommands.at(*subcommand).defines; + supports_remote = kKnownJustSubcommands.at(*subcommand).remote; + supports_cacert = kKnownJustSubcommands.at(*subcommand).cacert; + supports_client_auth = + kKnownJustSubcommands.at(*subcommand).client_auth; } // build just command std::vector<std::string> cmd = {common_args.just_path->string()}; @@ -135,6 +143,29 @@ auto CallJust(std::optional<std::filesystem::path> const& config_file, cmd.emplace_back(overlay_config.ToString()); } } + // forward remote execution arguments + if (supports_remote and (common_args.compatible == true)) { + cmd.emplace_back("--compatible"); + } + if (supports_remote and common_args.remote_execution_address) { + cmd.emplace_back("-r"); + cmd.emplace_back(*common_args.remote_execution_address); + } + // forward mutual TLS arguments + if (supports_cacert and auth_args.tls_ca_cert) { + cmd.emplace_back("--tls-ca-cert"); + cmd.emplace_back(auth_args.tls_ca_cert->string()); + } + if (supports_client_auth) { + if (auth_args.tls_client_cert) { + cmd.emplace_back("--tls-client-cert"); + cmd.emplace_back(auth_args.tls_client_cert->string()); + } + if (auth_args.tls_client_key) { + cmd.emplace_back("--tls-client-key"); + cmd.emplace_back(auth_args.tls_client_key->string()); + } + } // add args read from just-mrrc if (subcommand and just_cmd_args.just_args.contains(*subcommand)) { for (auto const& subcmd_arg : just_cmd_args.just_args.at(*subcommand)) { |