diff options
author | Klaus Aehlig <klaus.aehlig@huawei.com> | 2025-05-06 10:50:45 +0200 |
---|---|---|
committer | Klaus Aehlig <klaus.aehlig@huawei.com> | 2025-05-06 11:21:16 +0200 |
commit | 5f899a316dfed58be9c3fe9e81ba3102cf9e9e9e (patch) | |
tree | b0678dca5bceeb5eb5c4276292ecf06be972e6e4 /src/other_tools | |
parent | f249a220913f4421c58c9c6251e4f3dce67e251c (diff) | |
download | justbuild-5f899a316dfed58be9c3fe9e81ba3102cf9e9e9e.tar.gz |
just-mr: only set profiling-induced --dump-artifacts if supported
... by the requested subcommand. In particular, do not set it for
pure analyse requests.
Diffstat (limited to 'src/other_tools')
-rw-r--r-- | src/other_tools/just_mr/launch.cpp | 4 | ||||
-rw-r--r-- | src/other_tools/just_mr/utils.hpp | 29 |
2 files changed, 23 insertions, 10 deletions
diff --git a/src/other_tools/just_mr/launch.cpp b/src/other_tools/just_mr/launch.cpp index 7d71da9a..ca21e268 100644 --- a/src/other_tools/just_mr/launch.cpp +++ b/src/other_tools/just_mr/launch.cpp @@ -87,6 +87,7 @@ auto CallJust(std::optional<std::filesystem::path> const& config_file, bool supports_remote_properties{false}; bool supports_serve{false}; bool supports_dispatch{false}; + bool does_build{false}; std::optional<std::pair<std::filesystem::path, std::string>> mr_config_pair{ std::nullopt}; @@ -135,6 +136,7 @@ auto CallJust(std::optional<std::filesystem::path> const& config_file, kKnownJustSubcommands.at(*subcommand).remote_props; supports_serve = kKnownJustSubcommands.at(*subcommand).serve; supports_dispatch = kKnownJustSubcommands.at(*subcommand).dispatch; + does_build = kKnownJustSubcommands.at(*subcommand).does_build; } // build just command std::vector<std::string> cmd = {common_args.just_path->string()}; @@ -324,7 +326,7 @@ auto CallJust(std::optional<std::filesystem::path> const& config_file, cmd.emplace_back("--dump-plain-graph"); cmd.emplace_back(*log_dir / *invocation_log.graph_file_plain); } - if (invocation_log.dump_artifacts) { + if (does_build and invocation_log.dump_artifacts) { if (not IsValidFileName(*invocation_log.dump_artifacts)) { Logger::Log( LogLevel::Error, diff --git a/src/other_tools/just_mr/utils.hpp b/src/other_tools/just_mr/utils.hpp index 58b6931b..04f342ea 100644 --- a/src/other_tools/just_mr/utils.hpp +++ b/src/other_tools/just_mr/utils.hpp @@ -56,6 +56,8 @@ struct JustSubCmdFlags { bool remote_props; // supports remote-execution properties bool serve; // supports a serve endpoint bool dispatch; // supports dispatching of the remote-execution endpoint + bool does_build; // is actually building something, i.e., supports options + // related to the build result }; // ordered, so that we have replicability @@ -68,7 +70,8 @@ std::map<std::string, JustSubCmdFlags> const kKnownJustSubcommands{ .remote = false, .remote_props = false, .serve = false, - .dispatch = false}}, + .dispatch = false, + .does_build = false}}, {"describe", {.config = true, .build_root = true, @@ -77,7 +80,8 @@ std::map<std::string, JustSubCmdFlags> const kKnownJustSubcommands{ .remote = true, .remote_props = false, .serve = true, - .dispatch = false}}, + .dispatch = false, + .does_build = false}}, {"analyse", {.config = true, .build_root = true, @@ -86,7 +90,8 @@ std::map<std::string, JustSubCmdFlags> const kKnownJustSubcommands{ .remote = true, .remote_props = true, .serve = true, - .dispatch = true}}, + .dispatch = true, + .does_build = false}}, {"build", {.config = true, .build_root = true, @@ -95,7 +100,8 @@ std::map<std::string, JustSubCmdFlags> const kKnownJustSubcommands{ .remote = true, .remote_props = true, .serve = true, - .dispatch = true}}, + .dispatch = true, + .does_build = true}}, {"install", {.config = true, .build_root = true, @@ -104,7 +110,8 @@ std::map<std::string, JustSubCmdFlags> const kKnownJustSubcommands{ .remote = true, .remote_props = true, .serve = true, - .dispatch = true}}, + .dispatch = true, + .does_build = true}}, {"rebuild", {.config = true, .build_root = true, @@ -113,7 +120,8 @@ std::map<std::string, JustSubCmdFlags> const kKnownJustSubcommands{ .remote = true, .remote_props = true, .serve = true, - .dispatch = true}}, + .dispatch = true, + .does_build = true}}, {"add-to-cas", {.config = false, .build_root = true, @@ -122,7 +130,8 @@ std::map<std::string, JustSubCmdFlags> const kKnownJustSubcommands{ .remote = true, .remote_props = false, .serve = false, - .dispatch = false}}, + .dispatch = false, + .does_build = false}}, {"install-cas", {.config = false, .build_root = true, @@ -131,7 +140,8 @@ std::map<std::string, JustSubCmdFlags> const kKnownJustSubcommands{ .remote = true, .remote_props = false, .serve = false, - .dispatch = false}}, + .dispatch = false, + .does_build = false}}, {"gc", {.config = false, .build_root = true, @@ -140,7 +150,8 @@ std::map<std::string, JustSubCmdFlags> const kKnownJustSubcommands{ .remote = false, .remote_props = false, .serve = false, - .dispatch = false}}}; + .dispatch = false, + .does_build = false}}}; nlohmann::json const kDefaultConfigLocations = nlohmann::json::array( {{{"root", "workspace"}, {"path", "repos.json"}}, |