Use time tolerance in run_code_generation check.
The mtime values I was seeing on my file system were sometimes
floating point numbers that were very very close but not exactly
the same. This might be due to numerical errors. Increasing the
tolerance to something still very small, precision is less than
a second. It will lead to fewer rebuilds of non-dirty files.
Bug: angleproject:2455
Change-Id: I95dc3214ee91af7a70a20cc625405e0e2bc18698
Reviewed-on: https://chromium-review.googlesource.com/1032855
Reviewed-by: Luc Ferron <lucferron@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
diff --git a/scripts/run_code_generation.py b/scripts/run_code_generation.py
index e5cac24..fe95d2c 100755
--- a/scripts/run_code_generation.py
+++ b/scripts/run_code_generation.py
@@ -204,7 +204,8 @@
dirty = True
else:
output_mtime = os.path.getmtime(foutput)
- if input_mtime > output_mtime:
+ # Use a fuzzy comparison to avoid tiny time delta errors.
+ if input_mtime - output_mtime > 0.1:
dirty = True
if dirty: