feat(daemon): report per-unit compile arguments; deepen registry search tests
VoidBuildSystem CI / build-and-test-gcc16 (push) Failing after 3s
VoidBuildSystem CI / signing-openssl-gcc16 (push) Failing after 8s

This commit is contained in:
faumaray committed 2026-12-04 04:38:05 +03:00
1 parent 2b18a0331a
commit 624016d904
9 files changed
+335 -27

No files matched your search

+23
View File
@@ -1636,6 +1636,17 @@ int execute_daemon_command(std::string_view sub, const DaemonCmdOptions &opts) {
} else if (sub == "actions") {
request_json = std::format(R"({{"op":"actions","profile":{},"limit":{}}})",
Util::json_quote(opts.profile_arg), opts.limit_arg);
} else if (sub == "target_flags") {
if (!opts.target_arg || opts.target_arg->empty()) {
std::cerr << "vbs daemon target flags: --name must not be empty\n";
return 2;
}
request_json = std::format(
R"({{"op":"target_flags","profile":{},"target":{}{}}})",
Util::json_quote(opts.profile_arg), Util::json_quote(*opts.target_arg),
opts.file_filter_arg
? std::format(",\"file\":{}", Util::json_quote(*opts.file_filter_arg))
: std::string{});
} else if (sub == "target_info") {
if (!opts.target_arg || opts.target_arg->empty()) {
std::cerr << "vbs daemon target: --name must not be empty\n";
@@ -2764,6 +2775,15 @@ int main(int argc, char **argv) {
daemon_target_info_cmd
.option_default("--profile", "-p", "Profile to evaluate", daemon_opts.profile_arg, "debug")
.option("--name", "-n", "Target name", daemon_opts.target_arg);
auto &daemon_target_flags_cmd = daemon_target_cmd.subcommand(
"flags", "Report one target's bounded compile arguments per unit");
configure_daemon_common(daemon_target_flags_cmd);
daemon_target_flags_cmd
.option_default("--profile", "-p", "Profile to evaluate", daemon_opts.profile_arg,
"debug")
.option("--name", "-n", "Target name", daemon_opts.target_arg)
.option("--file", "", "Only units whose source path ends with this value",
daemon_opts.file_filter_arg);
auto &daemon_workspace_cmd =
daemon_cmd.subcommand("workspace", "Workspace metadata served by the daemon");
auto &daemon_workspace_members_cmd =
@@ -2953,6 +2973,9 @@ int main(int argc, char **argv) {
} else if (daemon_sub == "target" && parsed.matched_command_path.size() > 2 &&
parsed.matched_command_path[2] == "info") {
daemon_sub = "target_info";
} else if (daemon_sub == "target" && parsed.matched_command_path.size() > 2 &&
parsed.matched_command_path[2] == "flags") {
daemon_sub = "target_flags";
}
return execute_daemon_command(daemon_sub, daemon_opts);
}