Merge pull request #19769 from veblush/build-uses

Add a detection of missing file in filegroup.uses
pull/19747/head
Esun Kim 5 years ago committed by GitHub
commit 6c4ea6333d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      tools/buildgen/plugins/expand_filegroups.py

@ -55,6 +55,7 @@ def mako_plugin(dictionary):
libs = dictionary.get('libs') libs = dictionary.get('libs')
targets = dictionary.get('targets') targets = dictionary.get('targets')
filegroups_list = dictionary.get('filegroups') filegroups_list = dictionary.get('filegroups')
filegroups_set = set(fg['name'] for fg in filegroups_list)
filegroups = {} filegroups = {}
for fg in filegroups_list: for fg in filegroups_list:
@ -78,8 +79,10 @@ def mako_plugin(dictionary):
todo = todo[1:] todo = todo[1:]
# check all uses filegroups are present (if no, skip and come back later) # check all uses filegroups are present (if no, skip and come back later)
skip = False skip = False
for uses in cur.get('uses', []): for use in cur.get('uses', []):
if uses not in filegroups: assert use in filegroups_set, (
"filegroup(%s) uses non-existent %s" % (cur['name'], use))
if use not in filegroups:
skip = True skip = True
if skip: if skip:
skips += 1 skips += 1

Loading…
Cancel
Save