From b94a891ac9fcd0cee80652197c03633d752ad068 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20=C5=9Aniatowski?= Date: Mon, 15 Feb 2021 13:06:30 +0100 Subject: [PATCH] missingdeps: add exception for targets that dep on build.ninja A "missing dep path" to build.ninja is a false positive, skip reporting it. --- src/missing_deps.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/missing_deps.cc b/src/missing_deps.cc index a0fd048..adce2d2 100644 --- a/src/missing_deps.cc +++ b/src/missing_deps.cc @@ -114,6 +114,14 @@ void MissingDependencyScanner::ProcessNodeDeps(Node* node, Node** dep_nodes, std::set deplog_edges; for (int i = 0; i < dep_nodes_count; ++i) { Node* deplog_node = dep_nodes[i]; + // Special exception: A dep on build.ninja can be used to mean "always + // rebuild this target when the build is reconfigured", but build.ninja is + // often generated by a configuration tool like cmake or gn. The rest of + // the build "implicitly" depends on the entire build being reconfigured, + // so a missing dep path to build.ninja is not an actual missing dependecy + // problem. + if (deplog_node->path() == "build.ninja") + return; Edge* deplog_edge = deplog_node->in_edge(); if (deplog_edge) { deplog_edges.insert(deplog_edge);