summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/bb/cooker.py4
-rw-r--r--bitbake/lib/bb/parse/__init__.py4
-rw-r--r--bitbake/lib/bb/siggen.py29
3 files changed, 22 insertions, 15 deletions
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py
index 5cea9dba9d..44b9b2c31a 100644
--- a/bitbake/lib/bb/cooker.py
+++ b/bitbake/lib/bb/cooker.py
@@ -497,7 +497,7 @@ class BBCooker:
497 try: 497 try:
498 data = self.configuration.data 498 data = self.configuration.data
499 499
500 bb.parse.init_parser(data) 500 bb.parse.init_parser(data, self.configuration.dump_signatures)
501 for f in files: 501 for f in files:
502 data = bb.parse.handle(f, data) 502 data = bb.parse.handle(f, data)
503 503
@@ -550,7 +550,7 @@ class BBCooker:
550 bb.fetch.fetcher_init(self.configuration.data) 550 bb.fetch.fetcher_init(self.configuration.data)
551 bb.codeparser.parser_cache_init(self.configuration.data) 551 bb.codeparser.parser_cache_init(self.configuration.data)
552 552
553 bb.parse.init_parser(data) 553 bb.parse.init_parser(data, self.configuration.dump_signatures)
554 554
555 bb.event.fire(bb.event.ConfigParsed(), self.configuration.data) 555 bb.event.fire(bb.event.ConfigParsed(), self.configuration.data)
556 556
diff --git a/bitbake/lib/bb/parse/__init__.py b/bitbake/lib/bb/parse/__init__.py
index c7249ef050..da160ceb27 100644
--- a/bitbake/lib/bb/parse/__init__.py
+++ b/bitbake/lib/bb/parse/__init__.py
@@ -80,8 +80,8 @@ def init(fn, data):
80 if h['supports'](fn): 80 if h['supports'](fn):
81 return h['init'](data) 81 return h['init'](data)
82 82
83def init_parser(d): 83def init_parser(d, dumpsigs):
84 bb.parse.siggen = bb.siggen.init(d) 84 bb.parse.siggen = bb.siggen.init(d, dumpsigs)
85 85
86def resolve_file(fn, d): 86def resolve_file(fn, d):
87 if not os.path.isabs(fn): 87 if not os.path.isabs(fn):
diff --git a/bitbake/lib/bb/siggen.py b/bitbake/lib/bb/siggen.py
index eb624311a0..2948372c6a 100644
--- a/bitbake/lib/bb/siggen.py
+++ b/bitbake/lib/bb/siggen.py
@@ -7,26 +7,26 @@ except ImportError:
7 import pickle 7 import pickle
8 bb.msg.note(1, bb.msg.domain.Cache, "Importing cPickle failed. Falling back to a very slow implementation.") 8 bb.msg.note(1, bb.msg.domain.Cache, "Importing cPickle failed. Falling back to a very slow implementation.")
9 9
10def init(d): 10def init(d, dumpsigs):
11 siggens = [obj for obj in globals().itervalues() 11 siggens = [obj for obj in globals().itervalues()
12 if type(obj) is type and issubclass(obj, SignatureGenerator)] 12 if type(obj) is type and issubclass(obj, SignatureGenerator)]
13 13
14 desired = bb.data.getVar("BB_SIGNATURE_HANDLER", d, True) or "noop" 14 desired = bb.data.getVar("BB_SIGNATURE_HANDLER", d, True) or "noop"
15 for sg in siggens: 15 for sg in siggens:
16 if desired == sg.name: 16 if desired == sg.name:
17 return sg(d) 17 return sg(d, dumpsigs)
18 break 18 break
19 else: 19 else:
20 bb.error("Invalid signature generator '%s', using default 'noop' generator" % desired) 20 bb.error("Invalid signature generator '%s', using default 'noop' generator" % desired)
21 bb.error("Available generators: %s" % ", ".join(obj.name for obj in siggens)) 21 bb.error("Available generators: %s" % ", ".join(obj.name for obj in siggens))
22 return SignatureGenerator(d) 22 return SignatureGenerator(d, dumpsigs)
23 23
24class SignatureGenerator(object): 24class SignatureGenerator(object):
25 """ 25 """
26 """ 26 """
27 name = "noop" 27 name = "noop"
28 28
29 def __init__(self, data): 29 def __init__(self, data, dumpsigs):
30 return 30 return
31 31
32 def finalise(self, fn, d): 32 def finalise(self, fn, d):
@@ -37,7 +37,7 @@ class SignatureGeneratorBasic(SignatureGenerator):
37 """ 37 """
38 name = "basic" 38 name = "basic"
39 39
40 def __init__(self, data): 40 def __init__(self, data, dumpsigs):
41 self.basehash = {} 41 self.basehash = {}
42 self.taskhash = {} 42 self.taskhash = {}
43 self.taskdeps = {} 43 self.taskdeps = {}
@@ -52,17 +52,19 @@ class SignatureGeneratorBasic(SignatureGenerator):
52 else: 52 else:
53 self.twl = None 53 self.twl = None
54 54
55 self.dumpsigs = dumpsigs
56
55 def _build_data(self, fn, d): 57 def _build_data(self, fn, d):
56 58
57 self.taskdeps[fn], self.gendeps[fn] = bb.data.generate_dependencies(d) 59 taskdeps, gendeps = bb.data.generate_dependencies(d)
58 60
59 basehash = {} 61 basehash = {}
60 lookupcache = {} 62 lookupcache = {}
61 63
62 for task in self.taskdeps[fn]: 64 for task in taskdeps:
63 data = d.getVar(task, False) 65 data = d.getVar(task, False)
64 lookupcache[task] = data 66 lookupcache[task] = data
65 for dep in sorted(self.taskdeps[fn][task]): 67 for dep in sorted(taskdeps[task]):
66 if dep in self.basewhitelist: 68 if dep in self.basewhitelist:
67 continue 69 continue
68 if dep in lookupcache: 70 if dep in lookupcache:
@@ -75,20 +77,25 @@ class SignatureGeneratorBasic(SignatureGenerator):
75 self.basehash[fn + "." + task] = hashlib.md5(data).hexdigest() 77 self.basehash[fn + "." + task] = hashlib.md5(data).hexdigest()
76 #bb.note("Hash for %s is %s" % (task, tashhash[task])) 78 #bb.note("Hash for %s is %s" % (task, tashhash[task]))
77 79
78 self.lookupcache[fn] = lookupcache 80 if self.dumpsigs:
81 self.taskdeps[fn] = taskdeps
82 self.gendeps[fn] = gendeps
83 self.lookupcache[fn] = lookupcache
84
85 return taskdeps
79 86
80 def finalise(self, fn, d, variant): 87 def finalise(self, fn, d, variant):
81 88
82 if variant: 89 if variant:
83 fn = "virtual:" + variant + ":" + fn 90 fn = "virtual:" + variant + ":" + fn
84 91
85 self._build_data(fn, d) 92 taskdeps = self._build_data(fn, d)
86 93
87 #Slow but can be useful for debugging mismatched basehashes 94 #Slow but can be useful for debugging mismatched basehashes
88 #for task in self.taskdeps[fn]: 95 #for task in self.taskdeps[fn]:
89 # self.dump_sigtask(fn, task, d.getVar("STAMP", True), False) 96 # self.dump_sigtask(fn, task, d.getVar("STAMP", True), False)
90 97
91 for task in self.taskdeps[fn]: 98 for task in taskdeps:
92 d.setVar("BB_BASEHASH_task-%s" % task, self.basehash[fn + "." + task]) 99 d.setVar("BB_BASEHASH_task-%s" % task, self.basehash[fn + "." + task])
93 100
94 def get_taskhash(self, fn, task, deps, dataCache): 101 def get_taskhash(self, fn, task, deps, dataCache):