aboutsummaryrefslogtreecommitdiff
path: root/build2/cc/link-rule.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2018-11-19 14:58:20 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2018-11-19 14:58:20 +0200
commitac5ef35b5fa8b938ed427df4b0ad44e5b6b52cff (patch)
treefa1544e9ba088d4e054a095eec6a196502361d4e /build2/cc/link-rule.cxx
parent5136a6b723e2eeb27718747f1bfd822d0e790b86 (diff)
Finalize workaround for backwards modification time issue
Diffstat (limited to 'build2/cc/link-rule.cxx')
-rw-r--r--build2/cc/link-rule.cxx25
1 files changed, 13 insertions, 12 deletions
diff --git a/build2/cc/link-rule.cxx b/build2/cc/link-rule.cxx
index 90d290d..77619d1 100644
--- a/build2/cc/link-rule.cxx
+++ b/build2/cc/link-rule.cxx
@@ -2068,11 +2068,14 @@ namespace build2
// this situation in the "from scratch" flag.
//
bool scratch (false);
- if (dd.writing () || dd.mtime () > mt)
+ if (dd.writing () || dd.mtime > mt)
scratch = update = true;
+#define MTIME_SANITY_CHECK
+#ifdef MTIME_SANITY_CHECK
timestamp dd_tt (system_clock::now ());
- bool dd_rd (dd.reading ());
+#endif
+
dd.close ();
// If nothing changed, then we are done.
@@ -2080,9 +2083,6 @@ namespace build2
if (!update)
return ts;
- path ddp (tp + ".d");
- timestamp dd_mt (file_mtime (ddp));
-
// Ok, so we are updating. Finish building the command line.
//
string in, out, out1, out2, out3; // Storage.
@@ -2544,19 +2544,20 @@ namespace build2
rm.cancel ();
+#ifdef MTIME_SANITY_CHECK
{
- timestamp tp_tt (system_clock::now ());
timestamp tp_mt (file_mtime (tp));
+ timestamp dd_mt (file_mtime (dd.path));
+ timestamp tp_tt (system_clock::now ());
if (dd_mt > tp_mt)
- {
fail << "backwards modification times:\n"
- << ddp.string () << " " << dd_mt << " (" << dd_rd << ")\n"
- << tp.string () << " " << tp_mt << '\n'
- << dd_tt << '\n'
- << tp_tt;
- }
+ << dd_tt << " window start\n"
+ << dd_mt << " " << dd.path.string () << '\n'
+ << tp_mt << " " << tp.string () << '\n'
+ << tp_tt << " window end";
}
+#endif
// Should we go to the filesystem and get the new mtime? We know the
// file has been modified, so instead just use the current clock time.