From 29ba620502e05d6bd22d13fc819ddc98309c5a58 Mon Sep 17 00:00:00 2001 From: Klaus Aehlig Date: Thu, 4 Aug 2022 14:45:08 +0200 Subject: Artifact reporting: repeat the failed artifacts In targets that produce a large list of artifacts, e.g., a simple test suite realized by "install", it is sometimes hard to find the failed artifacts after being made aware of them by the warning. Therefore, at info level, repeat a list of the failed artifacts close to the end of the output. --- src/buildtool/graph_traverser/graph_traverser.hpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/buildtool/graph_traverser/graph_traverser.hpp') diff --git a/src/buildtool/graph_traverser/graph_traverser.hpp b/src/buildtool/graph_traverser/graph_traverser.hpp index 18a055a8..acd1515a 100644 --- a/src/buildtool/graph_traverser/graph_traverser.hpp +++ b/src/buildtool/graph_traverser/graph_traverser.hpp @@ -557,6 +557,8 @@ class GraphTraverser { std::vector const& artifact_nodes, std::map const& runfiles) const { std::string msg_dbg{"Artifact ids:"}; + std::string msg_failed{"Failed artifacts:"}; + bool failed{false}; nlohmann::json json{}; for (std::size_t pos = 0; pos < paths.size(); ++pos) { auto path = paths[pos].string(); @@ -570,6 +572,11 @@ class GraphTraverser { auto info = artifact_nodes[pos]->Content().Info(); if (info) { message += fmt::format("\n {} {}", path, info->ToString()); + if (info->failed) { + msg_failed += + fmt::format("\n {} {}", path, info->ToString()); + failed = true; + } if (clargs_.build.dump_artifacts) { json[path] = info->ToJson(); } @@ -588,6 +595,9 @@ class GraphTraverser { Logger::Log(LogLevel::Info, "{}", message); Logger::Log(LogLevel::Debug, "{}", msg_dbg); + if (failed) { + Logger::Log(LogLevel::Info, "{}", msg_failed); + } if (clargs_.build.dump_artifacts) { if (*clargs_.build.dump_artifacts == "-") { -- cgit v1.2.3