Skip to content

Commit

Permalink
Fuchsia: Reset all SDK timestamps to current time.
Browse files Browse the repository at this point in the history
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/1025376
Reviewed-by: Scott Graham <scottmg@chromium.org>
Commit-Queue: Kevin Marshall <kmarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#553267}
  • Loading branch information
Kevin Marshall authored and Commit Bot committed Apr 24, 2018
1 parent 5398653 commit 6560e0e
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions build/fuchsia/update_sdk.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,16 @@ def Cleanup(path):
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():
if len(sys.argv) != 1:
print >>sys.stderr, 'usage: %s' % sys.argv[0]
Expand Down Expand Up @@ -92,6 +102,8 @@ def main():
with open(hash_filename, 'w') as f:
f.write(sdk_hash)

UpdateTimestampsRecursive(output_dir)

return 0


Expand Down

0 comments on commit 6560e0e

Please sign in to comment.