mirror of
https://git.yoctoproject.org/poky
synced 2026-07-16 15:57:04 +00:00
bitbake: Implement signatures
Includes functionality to find out what changes between two different singature data dumps. Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
This commit is contained in:
@@ -178,6 +178,7 @@ class RunQueueData:
|
||||
self.runq_task = []
|
||||
self.runq_depends = []
|
||||
self.runq_revdeps = []
|
||||
self.runq_hash = []
|
||||
|
||||
def runq_depends_names(self, ids):
|
||||
import re
|
||||
@@ -477,6 +478,7 @@ class RunQueueData:
|
||||
self.runq_task.append(taskData.tasks_name[task])
|
||||
self.runq_depends.append(set(depends))
|
||||
self.runq_revdeps.append(set())
|
||||
self.runq_hash.append("")
|
||||
|
||||
runq_build.append(0)
|
||||
runq_recrdepends.append(recrdepends)
|
||||
@@ -589,6 +591,7 @@ class RunQueueData:
|
||||
del self.runq_depends[listid-delcount]
|
||||
del runq_build[listid-delcount]
|
||||
del self.runq_revdeps[listid-delcount]
|
||||
del self.runq_hash[listid-delcount]
|
||||
delcount = delcount + 1
|
||||
maps.append(-1)
|
||||
|
||||
@@ -686,6 +689,20 @@ class RunQueueData:
|
||||
#bb.note("Found setscene for %s %s" % (self.taskData.fn_index[self.runq_fnid[task]], self.runq_task[task]))
|
||||
self.runq_setscene.append(task)
|
||||
|
||||
# Interate over the task list and call into the siggen code
|
||||
|
||||
dealtwith = set()
|
||||
todeal = set(range(len(self.runq_fnid)))
|
||||
while len(todeal) > 0:
|
||||
for task in todeal.copy():
|
||||
if len(self.runq_depends[task] - dealtwith) == 0:
|
||||
dealtwith.add(task)
|
||||
todeal.remove(task)
|
||||
procdep = []
|
||||
for dep in self.runq_depends[task]:
|
||||
procdep.append(self.taskData.fn_index[self.runq_fnid[dep]] + "." + self.runq_task[dep])
|
||||
self.runq_hash[task] = bb.parse.siggen.get_taskhash(self.taskData.fn_index[self.runq_fnid[task]], self.runq_task[task], procdep, self.dataCache)
|
||||
|
||||
return len(self.runq_fnid)
|
||||
|
||||
def dump_data(self, taskQueue):
|
||||
@@ -885,7 +902,10 @@ class RunQueue:
|
||||
self.state = runQueueSceneInit
|
||||
|
||||
if self.state is runQueueSceneInit:
|
||||
self.rqexe = RunQueueExecuteScenequeue(self)
|
||||
if self.cooker.configuration.dump_signatures:
|
||||
self.dump_signatures()
|
||||
else:
|
||||
self.rqexe = RunQueueExecuteScenequeue(self)
|
||||
|
||||
if self.state is runQueueSceneRun:
|
||||
self.rqexe.execute()
|
||||
@@ -926,6 +946,20 @@ class RunQueue:
|
||||
else:
|
||||
self.rqexe.finish()
|
||||
|
||||
def dump_signatures(self):
|
||||
self.state = runQueueComplete
|
||||
done = set()
|
||||
bb.note("Reparsing files to collect dependency data")
|
||||
for task in range(len(self.rqdata.runq_fnid)):
|
||||
if self.rqdata.runq_fnid[task] not in done:
|
||||
fn = self.rqdata.taskData.fn_index[self.rqdata.runq_fnid[task]]
|
||||
the_data = self.cooker.bb_cache.loadDataFull(fn, self.cooker.get_file_appends(fn), self.cooker.configuration.data)
|
||||
done.add(self.rqdata.runq_fnid[task])
|
||||
|
||||
bb.parse.siggen.dump_sigs(self.rqdata.dataCache)
|
||||
|
||||
return
|
||||
|
||||
|
||||
class RunQueueExecute:
|
||||
|
||||
@@ -1007,6 +1041,8 @@ class RunQueueExecute:
|
||||
comps = var.split("=")
|
||||
env[comps[0]] = comps[1]
|
||||
|
||||
env['BB_TASKHASH'] = self.rqdata.runq_hash[task]
|
||||
|
||||
sys.stdout.flush()
|
||||
sys.stderr.flush()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user