diff options
author | Klaus Aehlig <klaus.aehlig@huawei.com> | 2022-08-04 14:45:08 +0200 |
---|---|---|
committer | Klaus Aehlig <klaus.aehlig@huawei.com> | 2022-08-05 15:41:00 +0200 |
commit | 29ba620502e05d6bd22d13fc819ddc98309c5a58 (patch) | |
tree | b061d9d09245d281327f19fd5f2bbfd678c856dd /src | |
parent | 0359caba2d61c157bdc88a9b79758ab5bf72bc1d (diff) | |
download | justbuild-29ba620502e05d6bd22d13fc819ddc98309c5a58.tar.gz |
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/buildtool/graph_traverser/graph_traverser.hpp | 10 |
1 files changed, 10 insertions, 0 deletions
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<DependencyGraph::ArtifactNode const*> const& artifact_nodes, std::map<std::string, ArtifactDescription> 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 == "-") { |