summaryrefslogtreecommitdiffstats
path: root/src/ninja.cc
diff options
context:
space:
mode:
authorNico Weber <nicolasweber@gmx.de>2014-12-04 02:04:26 (GMT)
committerNico Weber <nicolasweber@gmx.de>2014-12-04 02:04:26 (GMT)
commit8605b3daa6c68b29e4126e86193acdcfaf7cc2f1 (patch)
tree7cdd04704be569b42743ef15ecfc6ccd8e3444e6 /src/ninja.cc
parentd2a79b2ac305ec6d3d7ccd1268bb830e7d092953 (diff)
downloadNinja-8605b3daa6c68b29e4126e86193acdcfaf7cc2f1.zip
Ninja-8605b3daa6c68b29e4126e86193acdcfaf7cc2f1.tar.gz
Ninja-8605b3daa6c68b29e4126e86193acdcfaf7cc2f1.tar.bz2
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.
Diffstat (limited to 'src/ninja.cc')
-rw-r--r--src/ninja.cc9
1 files 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) {