summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2010-10-29 11:51:17 +1100
committerAndrew Tridgell <tridge@samba.org>2010-10-30 23:49:00 +1100
commite97be0860b73270e610757c6c9312106587f7161 (patch)
tree92638b3ae5a3d5c70b7bf53b6798449c5a2bb6c7
parentd489880ecd8b68aaabb6c154c85cc72a454d712a (diff)
downloadsamba-e97be0860b73270e610757c6c9312106587f7161.tar.gz
samba-e97be0860b73270e610757c6c9312106587f7161.tar.bz2
samba-e97be0860b73270e610757c6c9312106587f7161.zip
waf: display the paths in library loops
when we detect a library loop, try to display the paths between the two libraries. This should make it easier to fix. Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
-rw-r--r--buildtools/wafsamba/samba_deps.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/buildtools/wafsamba/samba_deps.py b/buildtools/wafsamba/samba_deps.py
index faac03ef57..bbd945210b 100644
--- a/buildtools/wafsamba/samba_deps.py
+++ b/buildtools/wafsamba/samba_deps.py
@@ -754,6 +754,25 @@ def reduce_objects(bld, tgt_list):
return True
+def show_library_loop(bld, lib1, lib2, path, seen):
+ '''show the detailed path of a library loop between lib1 and lib2'''
+
+ t = bld.name_to_obj(lib1, bld.env)
+ if not lib2 in getattr(t, 'final_libs', set()):
+ return
+
+ for d in t.samba_deps_extended:
+ if d in seen:
+ continue
+ seen.add(d)
+ path2 = path + '=>' + d
+ if d == lib2:
+ Logs.warn('library loop path: ' + path2)
+ return
+ show_library_loop(bld, d, lib2, path2, seen)
+ seen.remove(d)
+
+
def calculate_final_deps(bld, tgt_list, loops):
'''calculate the final library and object dependencies'''
for t in tgt_list:
@@ -798,6 +817,8 @@ def calculate_final_deps(bld, tgt_list, loops):
else:
Logs.error('ERROR: circular library dependency between %s and %s'
% (t.sname, t2.sname))
+ show_library_loop(bld, t.sname, t2.sname, t.sname, set())
+ show_library_loop(bld, t2.sname, t.sname, t2.sname, set())
sys.exit(1)
for loop in loops: