Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(363)

Unified Diff: build/android/gyp/util/md5_check.py

Issue 1374263002: Do not perform a non-incremental compile when previous compile failed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/gyp/util/md5_check.py
diff --git a/build/android/gyp/util/md5_check.py b/build/android/gyp/util/md5_check.py
index 699d3bfe143b278ef55897b4cae46e38e46071c5..30209445cc481ee84bdb491105d88a49ba5672fc 100644
--- a/build/android/gyp/util/md5_check.py
+++ b/build/android/gyp/util/md5_check.py
@@ -14,6 +14,9 @@ import zipfile
# When set and a difference is detected, a diff of what changed is printed.
_PRINT_MD5_DIFFS = int(os.environ.get('PRINT_MD5_DIFFS', 0))
+# An escape hatch that causes all targets to be rebuilt.
+_FORCE_REBUILD = int(os.environ.get('FORCE_REBUILD', 0))
+
def CallAndRecordIfStale(
function, record_path=None, input_paths=None, input_strings=None,
@@ -60,6 +63,7 @@ def CallAndRecordIfStale(
new_metadata.AddFile(path, _Md5ForPath(path))
old_metadata = None
+ force = force or _FORCE_REBUILD
missing_outputs = [x for x in output_paths if force or not os.path.exists(x)]
# When outputs are missing, don't bother gathering change information.
if not missing_outputs and os.path.exists(record_path):
@@ -79,11 +83,6 @@ def CallAndRecordIfStale(
print changes.DescribeDifference()
print '=' * 80
- # Delete the old metdata beforehand since failures leave it in an
- # inderterminate state.
- if old_metadata:
- os.unlink(record_path)
-
args = (changes,) if pass_changes else ()
function(*args)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698