Commit 6560e0ed authored by Kevin Marshall's avatar Kevin Marshall Committed by Commit Bot

Fuchsia: Reset all SDK timestamps to current time.

Ninja has a quirk that makes it blind to incremental source file
changes, so long as the source files' timestamp precedes the last
build time. As a result Ninja was not correctly picking up changes
in SDK rolls, resulting in an unbootable combination of fresh and stale
build files.

This CL effectively implements a recursive "touch" on the SDK files,
which gives an unambiguous change signal to Ninja.

Change-Id: I6b5e15a2b4404fcc7a2f52ebf76f75f80a0a6605
Reviewed-on: https://chromium-review.googlesource.com/1025376Reviewed-by: default avatarScott Graham <scottmg@chromium.org>
Commit-Queue: Kevin Marshall <kmarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#553267}
parent 5398653e
...@@ -43,6 +43,16 @@ def Cleanup(path): ...@@ -43,6 +43,16 @@ def Cleanup(path):
os.remove(hash_file) os.remove(hash_file)
# Updates the modification timestamps of |path| and its contents to the
# current time.
def UpdateTimestampsRecursive(path):
for root, dirs, files in os.walk(path):
for f in files:
os.utime(os.path.join(root, f), None)
for d in dirs:
os.utime(os.path.join(root, d), None)
def main(): def main():
if len(sys.argv) != 1: if len(sys.argv) != 1:
print >>sys.stderr, 'usage: %s' % sys.argv[0] print >>sys.stderr, 'usage: %s' % sys.argv[0]
...@@ -92,6 +102,8 @@ def main(): ...@@ -92,6 +102,8 @@ def main():
with open(hash_filename, 'w') as f: with open(hash_filename, 'w') as f:
f.write(sdk_hash) f.write(sdk_hash)
UpdateTimestampsRecursive(output_dir)
return 0 return 0
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment