From 8605b3daa6c68b29e4126e86193acdcfaf7cc2f1 Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Wed, 3 Dec 2014 18:04:26 -0800 Subject: Revert #223, fixes #874. No test since there's still no good way to test code in ninja.cc. Going forward, either move NinjaMain to its own file with tests, or create a system that makes it possible to run integration tests on the ninja binary. Instead, add a comment that explains why the restat optimization isn't done. --- src/ninja.cc | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/ninja.cc b/src/ninja.cc index 2c890c2..3e99782 100644 --- a/src/ninja.cc +++ b/src/ninja.cc @@ -241,12 +241,11 @@ bool NinjaMain::RebuildManifest(const char* input_file, string* err) { if (builder.AlreadyUpToDate()) return false; // Not an error, but we didn't rebuild. - if (!builder.Build(err)) - return false; - // The manifest was only rebuilt if it is now dirty (it may have been cleaned - // by a restat). - return node->dirty(); + // Even if the manifest was cleaned by a restat rule, claim that it was + // rebuilt. Not doing so can lead to crashes, see + // https://github.com/martine/ninja/issues/874 + return builder.Build(err); } Node* NinjaMain::CollectTarget(const char* cpath, string* err) { -- cgit v0.12