From e6d58923dfa42c3e55faf4b6d649068b9d8fd678 Mon Sep 17 00:00:00 2001 From: Esun Kim Date: Fri, 26 Jul 2019 14:29:42 -0700 Subject: [PATCH] Add a detection of missing file in filegroup.uses --- tools/buildgen/plugins/expand_filegroups.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tools/buildgen/plugins/expand_filegroups.py b/tools/buildgen/plugins/expand_filegroups.py index 99d9463b3f9..99e33332c85 100755 --- a/tools/buildgen/plugins/expand_filegroups.py +++ b/tools/buildgen/plugins/expand_filegroups.py @@ -55,6 +55,7 @@ def mako_plugin(dictionary): libs = dictionary.get('libs') targets = dictionary.get('targets') filegroups_list = dictionary.get('filegroups') + filegroups_set = set(fg['name'] for fg in filegroups_list) filegroups = {} for fg in filegroups_list: @@ -78,8 +79,10 @@ def mako_plugin(dictionary): todo = todo[1:] # check all uses filegroups are present (if no, skip and come back later) skip = False - for uses in cur.get('uses', []): - if uses not in filegroups: + for use in cur.get('uses', []): + assert use in filegroups_set, ( + "filegroup(%s) uses non-existent %s" % (cur['name'], use)) + if use not in filegroups: skip = True if skip: skips += 1