summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/siggen.py
diff options
context:
space:
mode:
authorChristopher Larson <chris_larson@mentor.com>2012-04-03 18:23:49 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-02-14 11:14:06 +0000
commit34571f4c101cb977a038e1b3fc36bd49f08b9282 (patch)
treeccdfd9b056e67afb4bc7d9bb2e94a71b9c7732f3 /bitbake/lib/bb/siggen.py
parent83e101568434a099c8d9a3e626c3a37589c3a233 (diff)
downloadpoky-34571f4c101cb977a038e1b3fc36bd49f08b9282.tar.gz
bitbake: Remove whitelisted vars from non-task deps
Though the value of variables in the BB_BASEHASH_WHITELIST is kept out of the checksums, dependency on them is not, at least for variables and non-task functions. In the code, the whitelist is removed from the overall task dep list, but not the individual variable deps. The result of this is that functions like sysroot_stage_all and oe_runmake end up with whitelisted variables like TERM listed in their dependencies, which means that doing a 'unset TERM' before building will result in all checksums for tasks that depend on those changing, and shared state reuse not behaving correctly. This is only really a potential issue for variables from the environment, as it's the existance/removal of the variable that's an issue, not its value, and the other whitelisted variables are set in our metadata. This which means in practical terms the only cases where this is likely to be an issue are in environments where one of the following are unset: TERM, LOGNAME, HOME, USER, PWD, SHELL. This may seem like an unlikely circumstance, but is in fact a real issue for those of us using autobuilders. Jenkins does not set TERM when executing shell, which means shared state archives produced by your jenkins server would not be fully reused by an actual user. Fixed by removing the whitelisted elements from the individual variable deps, not just the accumulated result. (Bitbake rev: dac12560ac8431ee24609f8de25cb1645572d350) Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/siggen.py')
-rw-r--r--bitbake/lib/bb/siggen.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/bitbake/lib/bb/siggen.py b/bitbake/lib/bb/siggen.py
index ba149402bf..50e4558611 100644
--- a/bitbake/lib/bb/siggen.py
+++ b/bitbake/lib/bb/siggen.py
@@ -98,6 +98,7 @@ class SignatureGeneratorBasic(SignatureGenerator):
98 bb.error("Task %s from %s seems to be empty?!" % (task, fn)) 98 bb.error("Task %s from %s seems to be empty?!" % (task, fn))
99 data = '' 99 data = ''
100 100
101 gendeps[task] -= self.basewhitelist
101 newdeps = gendeps[task] 102 newdeps = gendeps[task]
102 seen = set() 103 seen = set()
103 while newdeps: 104 while newdeps:
@@ -107,12 +108,12 @@ class SignatureGeneratorBasic(SignatureGenerator):
107 for dep in nextdeps: 108 for dep in nextdeps:
108 if dep in self.basewhitelist: 109 if dep in self.basewhitelist:
109 continue 110 continue
111 gendeps[dep] -= self.basewhitelist
110 newdeps |= gendeps[dep] 112 newdeps |= gendeps[dep]
111 newdeps -= seen 113 newdeps -= seen
112 114
113 alldeps = seen - self.basewhitelist 115 alldeps = sorted(seen)
114 116 for dep in alldeps:
115 for dep in sorted(alldeps):
116 data = data + dep 117 data = data + dep
117 if dep in lookupcache: 118 if dep in lookupcache:
118 var = lookupcache[dep] 119 var = lookupcache[dep]
@@ -126,7 +127,7 @@ class SignatureGeneratorBasic(SignatureGenerator):
126 if var: 127 if var:
127 data = data + str(var) 128 data = data + str(var)
128 self.basehash[fn + "." + task] = hashlib.md5(data).hexdigest() 129 self.basehash[fn + "." + task] = hashlib.md5(data).hexdigest()
129 taskdeps[task] = sorted(alldeps) 130 taskdeps[task] = alldeps
130 131
131 self.taskdeps[fn] = taskdeps 132 self.taskdeps[fn] = taskdeps
132 self.gendeps[fn] = gendeps 133 self.gendeps[fn] = gendeps