Disable hashes for ANGLE features generator

Features autogen files are small, fast to regenerate.
Run the generator in --verify-only mode and check content every time,
instead of using hashes.

Bug: angleproject:8193
Change-Id: I3988ab50a6c33171b7b7252c03f34a74f09fcf18
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4604579
Commit-Queue: Roman Lavrov <romanl@google.com>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
This commit is contained in:
Roman Lavrov
2023-06-09 18:39:52 -04:00
committed by Angle LUCI CQ
parent f1e1987261
commit 1572f609c1
3 changed files with 51 additions and 42 deletions

View File

@@ -1,28 +0,0 @@
{
"include/platform/autogen/FeaturesD3D_autogen.h":
"d0af019005a4e771f23bf59501da6ad8",
"include/platform/autogen/FeaturesGL_autogen.h":
"ed6342efe54ee4e3fc2b0e4431e4483c",
"include/platform/autogen/FeaturesMtl_autogen.h":
"d7d21bebe1e95f7b9041769e9db4e975",
"include/platform/autogen/FeaturesVk_autogen.h":
"765cdbfaac839d8270eb58f61a5a6e93",
"include/platform/autogen/FrontendFeatures_autogen.h":
"032d7687e0bc9e6ba5bd86029fd71ff2",
"include/platform/d3d_features.json":
"c3f7694511855304b3f678a6ad461d1e",
"include/platform/frontend_features.json":
"db98716ec9e23fc17f32bf9bc53cc331",
"include/platform/gen_features.py":
"7d85e07af44194d80615899accde596f",
"include/platform/gl_features.json":
"deb7ed855cb00b5cbedf4f3c5bab329a",
"include/platform/mtl_features.json":
"c1430ea5f79a6da446914b467058d9e7",
"include/platform/vk_features.json":
"4bf60b8b8430c680ca789cb48257ea3d",
"util/autogen/angle_features_autogen.cpp":
"58ece285f162dd37588c75bc815c13d5",
"util/autogen/angle_features_autogen.h":
"251a5ef9e8222dd9ecb3b7ad0d9cb5a5"
}

View File

@@ -66,8 +66,6 @@ def auto_script(script):
generators = {
'ANGLE features':
'include/platform/gen_features.py',
'ANGLE format':
'src/libANGLE/renderer/gen_angle_format_table.py',
'ANGLE load functions table':
@@ -135,6 +133,12 @@ generators = {
}
# Fast and supports --verify-only without hashes.
hashless_generators = {
'ANGLE features': 'include/platform/gen_features.py',
}
def md5(fname):
hash_md5 = hashlib.md5()
with open(fname, "r") as f:
@@ -252,8 +256,22 @@ def main():
if not runningSingleGenerator and any_old_hash_missing(all_new_hashes, all_old_hashes):
any_dirty = True
# Handle hashless_generators separately as these don't have hash maps.
hashless_generators_dirty = False
for name, script in sorted(hashless_generators.items()):
cmd = [get_executable_name(script), os.path.basename(script)]
rc = subprocess.call(cmd + ['--verify-only'], cwd=get_child_script_dirname(script))
if rc != 0:
print(name + ' generator dirty')
# Don't set any_dirty as we don't need git cl format in this case.
hashless_generators_dirty = True
if not args.verify_only:
print('Running ' + name + ' code generator')
subprocess.check_call(cmd, cwd=get_child_script_dirname(script))
if args.verify_only:
sys.exit(any_dirty)
return int(any_dirty or hashless_generators_dirty)
if any_dirty:
args = ['git.bat'] if os.name == 'nt' else ['git']
@@ -273,6 +291,8 @@ def main():
json.dump(new_hashes, f, indent=2, sort_keys=True, separators=(',', ':\n '))
f.write('\n') # json.dump doesn't end with newline
return 0
if __name__ == '__main__':
sys.exit(main())