Commit dda84a41 authored by Nico Weber's avatar Nico Weber

compare_build_artifacts.py: Add workaround for .isolated files containing the...

compare_build_artifacts.py: Add workaround for .isolated files containing the name of the build dir.

Bug: 899438,907488
Change-Id: Ic958d09e1fd4fc8a34f4f33fc9bfb9e3bc5d6a54
Reviewed-on: https://chromium-review.googlesource.com/c/1346670
Commit-Queue: Nico Weber <thakis@chromium.org>
Reviewed-by: default avatarHans Wennborg <hans@chromium.org>
Cr-Commit-Position: refs/heads/master@{#610051}
parent 7b1a3d2d
......@@ -183,6 +183,14 @@ def compare_files(first_filepath, second_filepath):
lhs = json.load(f)
with open(second_filepath, 'rb') as f:
rhs = json.load(f)
# The isolated files contain the name of the build dir. Until that's
# fixed (https://crbug.com/907488), change the rhs to use the lhs's
# build dir -- we care more about the hash differences than about
# the name of the build dir.
with open(second_filepath, 'rb') as f:
lhs_cwd = lhs['relative_cwd']
rhs_cwd = rhs['relative_cwd']
rhs = json.loads(f.read().replace(rhs_cwd, lhs_cwd))
diff = diff_dict(lhs, rhs)
if diff:
return '\n' + '\n'.join(' ' + line for line in diff.splitlines())
......
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