On Mon, May 02, 2022 at 20:46:32 +0200, 'David Turner' via ninja-build wrote:
> Hello Alfred,
>
> We encounter the same kind of issues in the Fuchsia build, and haven't
> found a way to work around them, except for forcing a clean build when we
> detect this happens :-(
>
> It seems the root issue is that Ninja does not record that dependencies
> come from depfiles. If it did, it could ignore them when it determines
> there is an issue (e.g. output is no longer in the graph, implicit input
> does no longer exist), but it's difficult to say how easy that feature
> would be to implement, and how much it would make the code more complex /
> less maintainable, or introduce surprising edge cases.
I wonder if making the information there "depend on" the build rule
itself and consider it out of date if that changes would work (after
all, a `-I` change could very well cache-invalidate a header lookup
resolution)? I don't think ninja has such a concept though. Maybe
deferring integrating the information until the build node is considered
would be enough (though this may run into the same limitations which
prevent the optimizations present in
https://github.com/ninja-build/ninja/issues/1760 from being used)?
--Ben