missingdeps: add exception for targets that dep on build.ninja

A "missing dep path" to build.ninja is a false positive, skip reporting it.
This commit is contained in:
Tomasz Śniatowski 2021-02-15 13:06:30 +01:00
parent bc69a640de
commit b94a891ac9

View File

@ -114,6 +114,14 @@ void MissingDependencyScanner::ProcessNodeDeps(Node* node, Node** dep_nodes,
std::set<Edge*> 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);