Commit 13264033 by Jamie Madill Committed by Commit Bot

Minor cleanups to run_code_generation.

Prints more info when a particular file is not found. Bug: angleproject:3333 Change-Id: I11ceb0d319023cd1fd23fd25297e5367030342a0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1550899Reviewed-by: 's avatarYuly Novikov <ynovikov@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
parent 84661549
...@@ -13,7 +13,7 @@ import os ...@@ -13,7 +13,7 @@ import os
import subprocess import subprocess
import sys import sys
script_dir = os.path.abspath(os.path.dirname(os.path.abspath(__file__))) script_dir = sys.path[0]
root_dir = os.path.abspath(os.path.join(script_dir, '..')) root_dir = os.path.abspath(os.path.join(script_dir, '..'))
# auto_script is a standard way for scripts to return their inputs and outputs. # auto_script is a standard way for scripts to return their inputs and outputs.
...@@ -106,6 +106,7 @@ def any_hash_dirty(name, filenames, new_hashes, old_hashes): ...@@ -106,6 +106,7 @@ def any_hash_dirty(name, filenames, new_hashes, old_hashes):
for filename in filenames: for filename in filenames:
key = name + ":" + filename key = name + ":" + filename
if not os.path.isfile(filename): if not os.path.isfile(filename):
print('Could not find %s for %s' % (filename, name))
found_dirty_hash = True found_dirty_hash = True
else: else:
new_hashes[key] = md5(filename) new_hashes[key] = md5(filename)
...@@ -115,12 +116,13 @@ def any_hash_dirty(name, filenames, new_hashes, old_hashes): ...@@ -115,12 +116,13 @@ def any_hash_dirty(name, filenames, new_hashes, old_hashes):
def any_old_hash_missing(new_hashes, old_hashes): def any_old_hash_missing(new_hashes, old_hashes):
result = False
for name, _ in old_hashes.iteritems(): for name, _ in old_hashes.iteritems():
if name not in new_hashes: if name not in new_hashes:
script, file = name.split(':') script, file = name.split(':')
print('%s missing from generated hashes.' % file) print('%s missing from generated hashes for %s.' % (file, script))
return True result = True
return False return result
def update_output_hashes(script, outputs, new_hashes): def update_output_hashes(script, outputs, new_hashes):
...@@ -134,6 +136,7 @@ def update_output_hashes(script, outputs, new_hashes): ...@@ -134,6 +136,7 @@ def update_output_hashes(script, outputs, new_hashes):
def main(): def main():
os.chdir(script_dir) os.chdir(script_dir)
old_hashes = json.load(open(hash_fname)) old_hashes = json.load(open(hash_fname))
new_hashes = {} new_hashes = {}
any_dirty = False any_dirty = False
......
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