This is to keep the possibility of maybe having a tool that deletes
old files in the future, or for having a tool which exposes this
information to generators so they can do that.
See https://github.com/martine/ninja/pull/697#issuecomment-
37140762
and the discussion on #762.
Idea from @maximuska!
// edge is rare, and the first recompaction will delete all old outputs from
// the deps log, and then a second recompaction will clear the build log,
// which seems good enough for this corner case.)
- return !n || !n->in_edge();
+ // Do keep entries around for files which still exist on disk, for
+ // generators that want to use this information.
+ return (!n || !n->in_edge()) && disk_interface_.Stat(s.AsString()) == 0;
}
};