Hi Nico. To clarify, which function do you mean by "this function"? I assume you mean RecomputeOutputDirty, but I only see 1 place where this is called, graph.cc:139, which in turn is only called by graph.cc:111.

I agree that most_recent_input should contain the most recent timestamp for the direct & implicit input nodes of the edge & not order-only deps. But currently this most-recent timestamp is only correct to the first level of nesting, which is what this patch fixes. Currently if one of those input nodes is a phony node, the most_recent_input's mtime is incorrect (as the phony node's mtime would be 0). This patch corrects the phony node's mtime with the UpdatePhonyMtime function.

Phony edges should have the same mtime behavior for direct dependencies and implicit dependencies. Looking at my patch, the RecomputeOutputsDirty function uses the same loop for direct & implicit dependencies for setting most_recent_input, so that should be fine. For order-only dependencies of a phony edge, most_recent_input won't be set so that's ok too.