summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2010-04-15 13:59:51 +1000
committerAndrew Tridgell <tridge@samba.org>2010-04-15 14:01:06 +1000
commit34887de6b0615f0f63f497f9020d1c059643f8ec (patch)
tree13d81b40c13bb95478d602a62b9e9a83e3f22c9b
parent167ba0eac902238d970b8312a6cbc87cf48af91a (diff)
downloadsamba-34887de6b0615f0f63f497f9020d1c059643f8ec.tar.gz
samba-34887de6b0615f0f63f497f9020d1c059643f8ec.tar.bz2
samba-34887de6b0615f0f63f497f9020d1c059643f8ec.zip
build: ensure we don't recreate library loops in expansions
after removing library loops from the dependeny graph, we re-add parent dependencies. We need to ensure that we don't re-add a dependency which re-creates the loop we so carefully removed. This also adds a final check for library dependency loops, and shows an appropriate error if one is found.
-rw-r--r--buildtools/wafsamba/samba_deps.py27
1 files changed, 26 insertions, 1 deletions
diff --git a/buildtools/wafsamba/samba_deps.py b/buildtools/wafsamba/samba_deps.py
index fbc322383f..7beec29c1e 100644
--- a/buildtools/wafsamba/samba_deps.py
+++ b/buildtools/wafsamba/samba_deps.py
@@ -605,6 +605,8 @@ def reduce_objects(bld, tgt_list):
t2 = bld.name_to_obj(l, bld.env)
t2_obj = extended_objects(bld, t2, set())
dup = new.intersection(t2_obj)
+ if t.sname in rely_on:
+ dup = dup.difference(rely_on[t.sname])
if dup:
debug('deps: removing dups from %s of type %s: %s also in %s %s',
t.sname, t.samba_type, dup, t2.samba_type, l)
@@ -669,8 +671,18 @@ def calculate_final_deps(bld, tgt_list, loops):
diff = loops[loop].difference(t.final_libs)
if t.sname in diff:
diff.remove(t.sname)
+ if t.sname in diff:
+ diff.remove(t.sname)
+ # make sure we don't recreate the loop again!
+ for d in diff.copy():
+ t2 = bld.name_to_obj(d, bld.env)
+ if t2.samba_type == 'LIBRARY':
+ if t.sname in t2.final_libs:
+ debug('deps: removing expansion %s from %s', d, t.sname)
+ diff.remove(d)
if diff:
- debug('deps: Expanded target %s by loop %s libraries %s', t.sname, loop, diff)
+ debug('deps: Expanded target %s by loop %s libraries (loop %s) %s', t.sname, loop,
+ loops[loop], diff)
t.final_libs = t.final_libs.union(diff)
# remove objects that are also available in linked libs
@@ -697,6 +709,19 @@ def calculate_final_deps(bld, tgt_list, loops):
syslibs = syslibs.union(t2.direct_syslibs)
t.final_syslibs = syslibs
+
+ # find any unresolved library loops
+ lib_loop_error = False
+ for t in tgt_list:
+ if t.samba_type in ['LIBRARY', 'PYTHON']:
+ for l in t.final_libs.copy():
+ t2 = bld.name_to_obj(l, bld.env)
+ if t.sname in t2.final_libs:
+ Logs.error('ERROR: Unresolved library loop %s from %s' % (t.sname, t2.sname))
+ lib_loop_error = True
+ if lib_loop_error:
+ sys.exit(1)
+
debug('deps: removed duplicate dependencies')