summaryrefslogtreecommitdiffstats
path: root/src/graph.h
diff options
context:
space:
mode:
authorEvan Martin <martine@danga.com>2013-02-17 23:13:35 (GMT)
committerEvan Martin <martine@danga.com>2013-04-08 22:02:32 (GMT)
commit149e8d8d5d2b043fa53f9f8b74fff893ea1819df (patch)
tree93c41d13b33be468c61f586f1c25fe637341e29a /src/graph.h
parent5031940a8fa5c0c7a76a4bb7fffdb4526713ce7c (diff)
downloadNinja-149e8d8d5d2b043fa53f9f8b74fff893ea1819df.zip
Ninja-149e8d8d5d2b043fa53f9f8b74fff893ea1819df.tar.gz
Ninja-149e8d8d5d2b043fa53f9f8b74fff893ea1819df.tar.bz2
use logged deps mtime in dirty calculation
The idea here is that it's possible for a build to complete (writing its output) but then for Ninja to get interrupted before writing out the updated dependency information. In that case the mtime stored in the deps log (if any) will match the previous output, and we'll know we need to rebuild the output just to get the deps updated.
Diffstat (limited to 'src/graph.h')
-rw-r--r--src/graph.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/graph.h b/src/graph.h
index 650a83e..428ba01 100644
--- a/src/graph.h
+++ b/src/graph.h
@@ -192,9 +192,10 @@ struct ImplicitDepLoader {
DiskInterface* disk_interface)
: state_(state), disk_interface_(disk_interface), deps_log_(deps_log) {}
- /// Load implicit dependencies for \a edge.
+ /// Load implicit dependencies for \a edge. May fill in \a mtime with
+ /// the timestamp of the loaded information.
/// @return false on error (without filling \a err if info is just missing).
- bool LoadDeps(Edge* edge, string* err);
+ bool LoadDeps(Edge* edge, TimeStamp* mtime, string* err);
DepsLog* deps_log() const {
return deps_log_;
@@ -207,7 +208,7 @@ struct ImplicitDepLoader {
/// Load implicit dependencies for \a edge from the DepsLog.
/// @return false on error (without filling \a err if info is just missing).
- bool LoadDepsFromLog(Edge* edge, string* err);
+ bool LoadDepsFromLog(Edge* edge, TimeStamp* mtime, string* err);
/// Preallocate \a count spaces in the input array on \a edge, returning
/// an iterator pointing at the first new space.
@@ -242,6 +243,7 @@ struct DependencyScan {
/// Recompute whether a given single output should be marked dirty.
/// Returns true if so.
bool RecomputeOutputDirty(Edge* edge, Node* most_recent_input,
+ TimeStamp deps_mtime,
const string& command, Node* output);
BuildLog* build_log() const {