Skip to content

Commit

Permalink
wafsamba: fix dependency calculation for SAMBA_GENERATOR()
Browse files Browse the repository at this point in the history
We need to checksum the rule as string command of the
sourcecode of the python function.

This is stored in the 'ruledeps' envariable on the waf Task.
See exec_rule() in wafadmin/TaskGen.py.

    dep_vars = getattr(self, 'dep_vars', ['ruledeps'])
    if dep_vars:
        tsk.dep_vars = dep_vars
    if isinstance(self.rule, str):
        tsk.env.ruledeps = self.rule
    else:
        # only works if the function is in a global module such as a waf tool
        tsk.env.ruledeps = Utils.h_fun(self.rule)

If there's no 'dep_vars' it defaults to ['ruledeps'].
As we pass our own 'dep_vars' we need to explicitly add
'ruledeps'.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=10472

Signed-off-by: Stefan Metzmacher <[email protected]>
Reviewed-by: Michael Adam <[email protected]>
  • Loading branch information
metze-samba committed Sep 5, 2014
1 parent 210d7de commit ee8fbbd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion buildtools/wafsamba/wafsamba.py
Original file line number Diff line number Diff line change
Expand Up @@ -603,6 +603,7 @@ def SAMBA_GENERATOR(bld, name, rule, source='', target='',
dep_vars = vars.keys()
elif isinstance(vars, list):
dep_vars = vars
dep_vars.append('ruledeps')

bld.SET_BUILD_GROUP(group)
t = bld(
Expand All @@ -614,7 +615,7 @@ def SAMBA_GENERATOR(bld, name, rule, source='', target='',
before='cc',
ext_out='.c',
samba_type='GENERATOR',
dep_vars = [rule] + dep_vars,
dep_vars = dep_vars,
name=name)

if always:
Expand Down

0 comments on commit ee8fbbd

Please sign in to comment.