Commit 5968da64 by Jamie Madill Committed by Commit Bot

code gen: Be more robust to dirty hashes.

If any JSON files get out of whack this will print which file is malformed. Also will show any temporary files (e.g. .rej or .orig) as untracked in the code generation hashes dir. Bug: angleproject:3691 Change-Id: I534e87bd2ea692182aa558bb80e09fb526e441b0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2564000Reviewed-by: 's avatarShahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
parent 3d061021
......@@ -93,3 +93,6 @@ Release_Win32/
Release_x64/
TestResults.qpa
.idea/
# Any temporary files will confuse code generation.
!scripts/code_generation_hashes/*
......@@ -182,7 +182,10 @@ def load_hashes():
for file in os.listdir(hash_dir):
hash_fname = os.path.join(hash_dir, file)
with open(hash_fname) as hash_file:
hashes[file] = json.load(open(hash_fname))
try:
hashes[file] = json.load(hash_file)
except ValueError:
raise Exception("Could not decode JSON from %s" % file)
return hashes
......
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