summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulien Stephan <jstephan@baylibre.com>2023-09-25 10:04:49 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-09-28 12:38:26 +0100
commit8eeb58cf4a34546ca0c5dd6518ece317d8706c40 (patch)
tree42d7fff81a4156291cdc39a59909ace17140fca4
parentfc5a15cc646b994edd26cd9d5040c8bad6634dc3 (diff)
downloadpoky-8eeb58cf4a34546ca0c5dd6518ece317d8706c40.tar.gz
bitbake: bitbake: cooker: add a new function to retrieve task signatures
adding a new command in cooker to compute and get task signatures this commit also add the associated command and event needed to get the signatures using tinfoil (Bitbake rev: 05c15162de90c41dad67e37a95ec9fdb440a7864) Signed-off-by: Julien Stephan <jstephan@baylibre.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--bitbake/lib/bb/command.py6
-rw-r--r--bitbake/lib/bb/cooker.py31
-rw-r--r--bitbake/lib/bb/event.py8
3 files changed, 45 insertions, 0 deletions
diff --git a/bitbake/lib/bb/command.py b/bitbake/lib/bb/command.py
index 8663eed933..f2ee587161 100644
--- a/bitbake/lib/bb/command.py
+++ b/bitbake/lib/bb/command.py
@@ -781,3 +781,9 @@ class CommandsAsync:
781 bb.event.fire(bb.event.FindSigInfoResult(res), command.cooker.databuilder.mcdata[mc]) 781 bb.event.fire(bb.event.FindSigInfoResult(res), command.cooker.databuilder.mcdata[mc])
782 command.finishAsyncCommand() 782 command.finishAsyncCommand()
783 findSigInfo.needcache = False 783 findSigInfo.needcache = False
784
785 def getTaskSignatures(self, command, params):
786 res = command.cooker.getTaskSignatures(params[0], params[1])
787 bb.event.fire(bb.event.GetTaskSignatureResult(res), command.cooker.data)
788 command.finishAsyncCommand()
789 getTaskSignatures.needcache = True
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py
index 87aa71bb65..599c7ddaa2 100644
--- a/bitbake/lib/bb/cooker.py
+++ b/bitbake/lib/bb/cooker.py
@@ -1442,6 +1442,37 @@ class BBCooker:
1442 1442
1443 self.idleCallBackRegister(buildFileIdle, rq) 1443 self.idleCallBackRegister(buildFileIdle, rq)
1444 1444
1445 def getTaskSignatures(self, target, tasks):
1446 sig = []
1447 getAllTaskSignatures = False
1448
1449 if not tasks:
1450 tasks = ["do_build"]
1451 getAllTaskSignatures = True
1452
1453 for task in tasks:
1454 taskdata, runlist = self.buildTaskData(target, task, self.configuration.halt)
1455 rq = bb.runqueue.RunQueue(self, self.data, self.recipecaches, taskdata, runlist)
1456 rq.rqdata.prepare()
1457
1458 for l in runlist:
1459 mc, pn, taskname, fn = l
1460
1461 taskdep = rq.rqdata.dataCaches[mc].task_deps[fn]
1462 for t in taskdep['tasks']:
1463 if t in taskdep['nostamp'] or "setscene" in t:
1464 continue
1465 tid = bb.runqueue.build_tid(mc, fn, t)
1466
1467 if t in task or getAllTaskSignatures:
1468 try:
1469 rq.rqdata.prepare_task_hash(tid)
1470 sig.append([pn, t, rq.rqdata.get_task_unihash(tid)])
1471 except KeyError:
1472 sig.append(self.getTaskSignatures(target, [t])[0])
1473
1474 return sig
1475
1445 def buildTargets(self, targets, task): 1476 def buildTargets(self, targets, task):
1446 """ 1477 """
1447 Attempt to build the targets specified 1478 Attempt to build the targets specified
diff --git a/bitbake/lib/bb/event.py b/bitbake/lib/bb/event.py
index 0d0e0a68aa..f8acacd80d 100644
--- a/bitbake/lib/bb/event.py
+++ b/bitbake/lib/bb/event.py
@@ -857,6 +857,14 @@ class FindSigInfoResult(Event):
857 Event.__init__(self) 857 Event.__init__(self)
858 self.result = result 858 self.result = result
859 859
860class GetTaskSignatureResult(Event):
861 """
862 Event to return results from GetTaskSignatures command
863 """
864 def __init__(self, sig):
865 Event.__init__(self)
866 self.sig = sig
867
860class ParseError(Event): 868class ParseError(Event):
861 """ 869 """
862 Event to indicate parse failed 870 Event to indicate parse failed