From 3499ddd4ef5eeb7e274cbdf618cc53bf62939d14 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 19 Jan 2018 11:26:50 +0200 Subject: Fix bug in header dependency extraction logic --- build2/cc/compile.cxx | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/build2/cc/compile.cxx b/build2/cc/compile.cxx index 3ae1e94..6bb3d9a 100644 --- a/build2/cc/compile.cxx +++ b/build2/cc/compile.cxx @@ -2377,7 +2377,7 @@ namespace build2 if (restart) { - l6 ([&]{trace << "restarting";}); + l6 ([&]{trace << "restarting (cache)";}); break; } } @@ -2546,6 +2546,17 @@ namespace build2 // if (good_error) restart = updating = true; + // + // And if we have updated the header (restart is true), + // then we may end up in this situation: an old header + // got included which caused the preprocessor to fail + // down the line. So if we are restarting, set the good + // error flag in case the process fails because of + // something like this (and if it is for a valid reason, + // then we will pick it up on the next round). + // + else if (restart) + good_error = true; if (restart) l6 ([&]{trace << "restarting";}); @@ -2611,6 +2622,11 @@ namespace build2 if (restart) { + // The same "preprocessor may fail down the line" + // logic as above. + // + good_error = true; + l6 ([&]{trace << "restarting";}); break; } -- cgit v1.1