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 | |
parent | 041adc97125189d1d91ecc7de16ff0e3e386e15b (diff) | |
download | openembedded-core-25b3d39612c0bea1d136e346d938abde56aa699f.tar.gz openembedded-core-25b3d39612c0bea1d136e346d938abde56aa699f.tar.bz2 openembedded-core-25b3d39612c0bea1d136e346d938abde56aa699f.zip |
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>
-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): shelldeps = set(key for key in keys if d.getVarFlag(key, "export") and not d.getVarFlag(key, "unexport")) deps = {} - taskdeps = {} tasklist = bb.data.getVar('__BBTASKS', d) or [] for task in tasklist: deps[task] = build_dependencies(task, keys, shelldeps, d) - newdeps = deps[task] seen = set() while newdeps: @@ -330,9 +328,8 @@ def generate_dependencies(d): deps[dep] = build_dependencies(dep, keys, shelldeps, d) newdeps |= deps[dep] newdeps -= seen - taskdeps[task] = seen | newdeps #print "For %s: %s" % (task, str(taskdeps[task])) - return taskdeps, deps + return tasklist, deps def inherits_class(klass, d): 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): self.runtaskdeps = {} self.gendeps = {} self.lookupcache = {} - self.basewhitelist = (data.getVar("BB_HASHBASE_WHITELIST", True) or "").split() + self.basewhitelist = set((data.getVar("BB_HASHBASE_WHITELIST", True) or "").split()) self.taskwhitelist = data.getVar("BB_HASHTASK_WHITELIST", True) or None if self.taskwhitelist: @@ -67,17 +67,31 @@ class SignatureGeneratorBasic(SignatureGenerator): def _build_data(self, fn, d): - taskdeps, gendeps = bb.data.generate_dependencies(d) + tasklist, gendeps = bb.data.generate_dependencies(d) + taskdeps = {} basehash = {} lookupcache = {} - for task in taskdeps: + for task in tasklist: data = d.getVar(task, False) lookupcache[task] = data - for dep in sorted(taskdeps[task]): - if dep in self.basewhitelist: - continue + + newdeps = gendeps[task] + seen = set() + while newdeps: + nextdeps = newdeps + seen |= nextdeps + newdeps = set() + for dep in nextdeps: + if dep in self.basewhitelist: + continue + newdeps |= gendeps[dep] + newdeps -= seen + + alldeps = seen - self.basewhitelist + + for dep in sorted(alldeps): if dep in lookupcache: var = lookupcache[dep] else: @@ -88,6 +102,7 @@ class SignatureGeneratorBasic(SignatureGenerator): if data is None: bb.error("Task %s from %s seems to be empty?!" % (task, fn)) self.basehash[fn + "." + task] = hashlib.md5(data).hexdigest() + taskdeps[task] = sorted(alldeps) self.taskdeps[fn] = taskdeps self.gendeps[fn] = gendeps |