From b94a1792d01d7e47cd577228b97b6f32ab2bc8dc Mon Sep 17 00:00:00 2001 From: William Deegan Date: Tue, 2 Apr 2019 13:56:54 -0700 Subject: Enhanced --debug=explain output. Breaks out sources, depends, and implicit components to dependency list. Updated test. TODO: better formatting --- src/engine/SCons/Node/__init__.py | 14 ++++++++++---- test/explain/basic.py | 12 +++++++++--- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/src/engine/SCons/Node/__init__.py b/src/engine/SCons/Node/__init__.py index 131953b..ca6e6ee 100644 --- a/src/engine/SCons/Node/__init__.py +++ b/src/engine/SCons/Node/__init__.py @@ -1666,9 +1666,16 @@ class Node(object, with_metaclass(NoSlotsPyPy)): lines.append("`%s' changed\n" % stringify(k)) if len(lines) == 0 and old_bkids != new_bkids: - lines.append("the dependency order changed:\n" + - "%sold: %s\n" % (' '*15, list(map(stringify, old_bkids))) + - "%snew: %s\n" % (' '*15, list(map(stringify, new_bkids)))) + lines.append("the dependency order changed:\n") + lines.append("->Sources\n") + for (o,n) in map(None, old.bsources, new.bsources): + lines.append("Old:%s\tNew:%s\n"%(o,n)) + lines.append("->Depends\n") + for (o,n) in map(None, old.bdepends, new.bdepends): + lines.append("Old:%s\tNew:%s\n"%(o,n)) + lines.append("->Implicit\n") + for (o,n) in map(None, old.bimplicit, new.bimplicit): + lines.append("Old:%s\tNew:%s\n"%(o,n)) if len(lines) == 0: def fmt_with_title(title, strlines): @@ -1711,7 +1718,6 @@ class Walker(object): This is depth-first, children are visited before the parent. The Walker object can be initialized with any node, and returns the next node on the descent with each get_next() call. - 'kids_func' is an optional function that will be called to get the children of a node instead of calling 'children'. 'cycle_func' is an optional function that will be called when a cycle is detected. diff --git a/test/explain/basic.py b/test/explain/basic.py index 99942cd..bd474bb 100644 --- a/test/explain/basic.py +++ b/test/explain/basic.py @@ -324,9 +324,15 @@ env.Cat('file3', ['zzz', 'yyy', 'xxx']) python_sep = python.replace('\\', '\\\\') expect = test.wrap_stdout("""\ -scons: rebuilding `file3' because the dependency order changed: - old: ['xxx', 'yyy', 'zzz', '%(python_sep)s'] - new: ['zzz', 'yyy', 'xxx', '%(python_sep)s'] +scons: rebuilding `file3' because: + the dependency order changed: + ->Sources + Old:xxx New:zzz + Old:yyy New:yyy + Old:zzz New:xxx + ->Depends + ->Implicit + Old:/usr/bin/python New:/usr/bin/python %(_python_)s %(cat_py)s file3 zzz yyy xxx """ % locals()) -- cgit v0.12