build.py: Add dep cache (doesn't make a speed difference at all)

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2016-03-08 16:35:58 +00:00
commit 22cba71eeb

View file

@ -31,6 +31,12 @@ def find_proj_path(name):
raise Exception("module " + name + " not found below " + proj_base)
def read_deps(cur, prereq_type):
# dep cache doesn't make a difference at all
if prereq_type in dep_cache:
if cur in dep_cache[prereq_type]:
return dep_cache[cur][prereq_type]
else:
dep_cache[prereq_type] = {}
path = find_proj_path(cur)
os.chdir(path)
# ignoring prereq_type, as it has never been anything but BUILD, now
@ -44,6 +50,8 @@ def read_deps(cur, prereq_type):
r.add(d)
if cur in r:
r.remove(cur)
print 'inserting', prereq_type, cur, r
dep_cache[prereq_type][cur] = r
return r
def add_tree(cur, prereq_type):