diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-01-12 15:58:48 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-01-12 15:58:48 +0000 |
commit | 25b3d39612c0bea1d136e346d938abde56aa699f (patch) | |
tree | 55c4218de429a3e5f861734b1d2966a4fb360dff /bitbake | |
parent | 041adc97125189d1d91ecc7de16ff0e3e386e15b (diff) | |
download | poky-25b3d39612c0bea1d136e346d938abde56aa699f.tar.gz |
bitbake/siggen.py: Fix whitelisted variable handling
Even when a variable was whitelisted, any dependencies of that variable
could still creep into the task hash due to the way the whitelisting
code worked. This patch changes thing to ensure that when whitelisted,
that whitelisting applies to the variable and any dependencies it has.
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r-- | bitbake/lib/bb/data.py | 5 | ||||
-rw-r--r-- | bitbake/lib/bb/siggen.py | 27 |
2 files changed, 22 insertions, 10 deletions
diff --git a/bitbake/lib/bb/data.py b/bitbake/lib/bb/data.py index 198b628fad..50f2218a70 100644 --- a/bitbake/lib/bb/data.py +++ b/bitbake/lib/bb/data.py | |||
@@ -313,12 +313,10 @@ def generate_dependencies(d): | |||
313 | shelldeps = set(key for key in keys if d.getVarFlag(key, "export") and not d.getVarFlag(key, "unexport")) | 313 | shelldeps = set(key for key in keys if d.getVarFlag(key, "export") and not d.getVarFlag(key, "unexport")) |
314 | 314 | ||
315 | deps = {} | 315 | deps = {} |
316 | taskdeps = {} | ||
317 | 316 | ||
318 | tasklist = bb.data.getVar('__BBTASKS', d) or [] | 317 | tasklist = bb.data.getVar('__BBTASKS', d) or [] |
319 | for task in tasklist: | 318 | for task in tasklist: |
320 | deps[task] = build_dependencies(task, keys, shelldeps, d) | 319 | deps[task] = build_dependencies(task, keys, shelldeps, d) |
321 | |||
322 | newdeps = deps[task] | 320 | newdeps = deps[task] |
323 | seen = set() | 321 | seen = set() |
324 | while newdeps: | 322 | while newdeps: |
@@ -330,9 +328,8 @@ def generate_dependencies(d): | |||
330 | deps[dep] = build_dependencies(dep, keys, shelldeps, d) | 328 | deps[dep] = build_dependencies(dep, keys, shelldeps, d) |
331 | newdeps |= deps[dep] | 329 | newdeps |= deps[dep] |
332 | newdeps -= seen | 330 | newdeps -= seen |
333 | taskdeps[task] = seen | newdeps | ||
334 | #print "For %s: %s" % (task, str(taskdeps[task])) | 331 | #print "For %s: %s" % (task, str(taskdeps[task])) |
335 | return taskdeps, deps | 332 | return tasklist, deps |
336 | 333 | ||
337 | def inherits_class(klass, d): | 334 | def inherits_class(klass, d): |
338 | val = getVar('__inherit_cache', d) or [] | 335 | val = getVar('__inherit_cache', d) or [] |
diff --git a/bitbake/lib/bb/siggen.py b/bitbake/lib/bb/siggen.py index 4dc09b3f9e..010c2cab26 100644 --- a/bitbake/lib/bb/siggen.py +++ b/bitbake/lib/bb/siggen.py | |||
@@ -57,7 +57,7 @@ class SignatureGeneratorBasic(SignatureGenerator): | |||
57 | self.runtaskdeps = {} | 57 | self.runtaskdeps = {} |
58 | self.gendeps = {} | 58 | self.gendeps = {} |
59 | self.lookupcache = {} | 59 | self.lookupcache = {} |
60 | self.basewhitelist = (data.getVar("BB_HASHBASE_WHITELIST", True) or "").split() | 60 | self.basewhitelist = set((data.getVar("BB_HASHBASE_WHITELIST", True) or "").split()) |
61 | self.taskwhitelist = data.getVar("BB_HASHTASK_WHITELIST", True) or None | 61 | self.taskwhitelist = data.getVar("BB_HASHTASK_WHITELIST", True) or None |
62 | 62 | ||
63 | if self.taskwhitelist: | 63 | if self.taskwhitelist: |
@@ -67,17 +67,31 @@ class SignatureGeneratorBasic(SignatureGenerator): | |||
67 | 67 | ||
68 | def _build_data(self, fn, d): | 68 | def _build_data(self, fn, d): |
69 | 69 | ||
70 | taskdeps, gendeps = bb.data.generate_dependencies(d) | 70 | tasklist, gendeps = bb.data.generate_dependencies(d) |
71 | 71 | ||
72 | taskdeps = {} | ||
72 | basehash = {} | 73 | basehash = {} |
73 | lookupcache = {} | 74 | lookupcache = {} |
74 | 75 | ||
75 | for task in taskdeps: | 76 | for task in tasklist: |
76 | data = d.getVar(task, False) | 77 | data = d.getVar(task, False) |
77 | lookupcache[task] = data | 78 | lookupcache[task] = data |
78 | for dep in sorted(taskdeps[task]): | 79 | |
79 | if dep in self.basewhitelist: | 80 | newdeps = gendeps[task] |
80 | continue | 81 | seen = set() |
82 | while newdeps: | ||
83 | nextdeps = newdeps | ||
84 | seen |= nextdeps | ||
85 | newdeps = set() | ||
86 | for dep in nextdeps: | ||
87 | if dep in self.basewhitelist: | ||
88 | continue | ||
89 | newdeps |= gendeps[dep] | ||
90 | newdeps -= seen | ||
91 | |||
92 | alldeps = seen - self.basewhitelist | ||
93 | |||
94 | for dep in sorted(alldeps): | ||
81 | if dep in lookupcache: | 95 | if dep in lookupcache: |
82 | var = lookupcache[dep] | 96 | var = lookupcache[dep] |
83 | else: | 97 | else: |
@@ -88,6 +102,7 @@ class SignatureGeneratorBasic(SignatureGenerator): | |||
88 | if data is None: | 102 | if data is None: |
89 | bb.error("Task %s from %s seems to be empty?!" % (task, fn)) | 103 | bb.error("Task %s from %s seems to be empty?!" % (task, fn)) |
90 | self.basehash[fn + "." + task] = hashlib.md5(data).hexdigest() | 104 | self.basehash[fn + "." + task] = hashlib.md5(data).hexdigest() |
105 | taskdeps[task] = sorted(alldeps) | ||
91 | 106 | ||
92 | self.taskdeps[fn] = taskdeps | 107 | self.taskdeps[fn] = taskdeps |
93 | self.gendeps[fn] = gendeps | 108 | self.gendeps[fn] = gendeps |