From 83056869b618a27c0b3d8ec86e15e9f15777c172 Mon Sep 17 00:00:00 2001 From: Evan Martin Date: Fri, 7 Jan 2011 17:22:17 -0800 Subject: missing implicit deps are ok This was a very subtle bug, and the difficulty of writing a test for it makes me think I've gone about the testing infrastructure the wrong way. I intend to follow this by fixing up the way tests work. --- src/ninja_jumble.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/ninja_jumble.cc b/src/ninja_jumble.cc index dc41f2e..18faac8 100644 --- a/src/ninja_jumble.cc +++ b/src/ninja_jumble.cc @@ -130,7 +130,10 @@ bool Edge::RecomputeDirty(State* state, DiskInterface* disk_interface, if (!edge->RecomputeDirty(state, disk_interface, err)) return false; } else { - (*i)->dirty_ = !(*i)->file_->exists(); + // This input has no in-edge; it is dirty if it is missing. + // But it's ok for implicit deps to be missing. + if (!is_implicit(i - inputs_.begin())) + (*i)->dirty_ = !(*i)->file_->exists(); } } @@ -160,7 +163,7 @@ bool Edge::RecomputeDirty(State* state, DiskInterface* disk_interface, (*i)->file_->StatIfNecessary(disk_interface); // Output is dirty if we're dirty, we're missing the output, - // or if it's older than the mostt recent input mtime. + // or if it's older than the most recent input mtime. if (dirty || !(*i)->file_->exists() || (*i)->file_->mtime_ < most_recent_input) { (*i)->dirty_ = true; -- cgit v0.12