summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKlaus Aehlig <klaus.aehlig@huawei.com>2022-07-05 16:56:32 +0200
committerKlaus Aehlig <klaus.aehlig@huawei.com>2022-07-05 17:25:03 +0200
commit1adf3ea9c28b1b72eb7e56ef4027d2aee200042e (patch)
treeacf4f9d2670d3b48789719c96d334ec433de2f2f
parenta7462a787fc45bee5e8010686333d1edbf7f3963 (diff)
downloadjustbuild-1adf3ea9c28b1b72eb7e56ef4027d2aee200042e.tar.gz
Make remote endpoint specification part of analysis
The remote execution endpoint shards the target-level cache; still, for analysis, we want to specify a particular target-level cache, e.g., to analyse the inputs of a particular action that failed remotely. Note that the action identifier depends on the target-level cache in question, due to the extensional projection implicit in target-level caching.
-rw-r--r--share/man/just.1.org8
-rw-r--r--src/buildtool/common/cli.hpp21
-rw-r--r--src/buildtool/main/main.cpp3
3 files changed, 18 insertions, 14 deletions
diff --git a/share/man/just.1.org b/share/man/just.1.org
index c3b9f823..98db94e4 100644
--- a/share/man/just.1.org
+++ b/share/man/just.1.org
@@ -389,16 +389,20 @@ well-defined graph file. See *just-graph-file(5)* for more details.
** Remote execution options
+ As remote execution properties shard the target-level cache, they are also
+ available for analysis. In this way, the same action identifiers can be
+ achieved despite the extensional projection inherent to target level caching,
+ e.g., in conjunction with *--request-action-input*.
*--remote-execution-property* KEY:VAL\\
Property for remote execution as key-value pair. Specifying this
option multiple times will accumulate pairs. If multiple pairs with
the same key are given, the latest wins.\\
- Supported by: build|install|rebuild|traverse.
+ Supported by: analysis|build|install|rebuild|traverse.
*-r*, *--remote-execution-address* NAME:PORT\\
Address of the remote execution service.\\
- Supported by: build|install-cas|install|rebuild|traverse.
+ Supported by: analysis|build|install-cas|install|rebuild|traverse.
** *analyse* specific options
diff --git a/src/buildtool/common/cli.hpp b/src/buildtool/common/cli.hpp
index e677924c..4e1d86da 100644
--- a/src/buildtool/common/cli.hpp
+++ b/src/buildtool/common/cli.hpp
@@ -56,16 +56,16 @@ struct DiagnosticArguments {
std::optional<std::string> dump_nodes{std::nullopt};
};
-/// \brief Arguments required for specifying cache/build endpoint.
+/// \brief Arguments required for specifying build endpoint.
struct EndpointArguments {
std::optional<std::filesystem::path> local_root{};
std::optional<std::string> remote_execution_address;
+ std::vector<std::string> platform_properties;
};
/// \brief Arguments required for building.
struct BuildArguments {
std::optional<std::vector<std::string>> local_launcher{std::nullopt};
- std::vector<std::string> platform_properties;
std::chrono::milliseconds timeout{kDefaultTimeout};
std::size_t build_jobs{};
std::optional<std::string> dump_artifacts{std::nullopt};
@@ -254,6 +254,14 @@ static inline auto SetupEndpointArguments(
clargs->remote_execution_address,
"Address of the remote execution service.")
->type_name("NAME:PORT");
+ app->add_option(
+ "--remote-execution-property",
+ clargs->platform_properties,
+ "Property for remote execution as key-value pair. Specifying this "
+ "option multiple times will accumulate pairs (latest wins).")
+ ->type_name("KEY:VAL")
+ ->allow_extra_args(false)
+ ->expected(1, 1);
}
static inline auto SetupBuildArguments(
@@ -271,15 +279,6 @@ static inline auto SetupBuildArguments(
->type_name("JSON")
->default_val(nlohmann::json{"env", "--"}.dump());
- app->add_option(
- "--remote-execution-property",
- clargs->platform_properties,
- "Property for remote execution as key-value pair. Specifying this "
- "option multiple times will accumulate pairs (latest wins).")
- ->type_name("KEY:VAL")
- ->allow_extra_args(false)
- ->expected(1, 1);
-
app->add_option_function<unsigned int>(
"--action-timeout",
[clargs](auto const& seconds) {
diff --git a/src/buildtool/main/main.cpp b/src/buildtool/main/main.cpp
index 6d7be359..1c84d585 100644
--- a/src/buildtool/main/main.cpp
+++ b/src/buildtool/main/main.cpp
@@ -80,6 +80,7 @@ auto SetupAnalyseCommandArguments(
gsl::not_null<CommandLineArguments*> const& clargs) {
SetupCommonArguments(app, &clargs->common);
SetupAnalysisArguments(app, &clargs->analysis);
+ SetupEndpointArguments(app, &clargs->endpoint);
SetupDiagnosticArguments(app, &clargs->diagnose);
SetupCompatibilityArguments(app);
}
@@ -229,7 +230,7 @@ void SetupExecutionConfig(EndpointArguments const& eargs,
Logger::Log(LogLevel::Error, "failed to configure local execution.");
std::exit(kExitFailure);
}
- for (auto const& property : bargs.platform_properties) {
+ for (auto const& property : eargs.platform_properties) {
if (not RemoteConfig::AddPlatformProperty(property)) {
Logger::Log(LogLevel::Error,
"addding platform property '{}' failed.",