diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-03-18 17:57:45 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-03-23 22:51:25 +0000 |
commit | 86ec266d912b574c2e2f2057c9c438b13c5c5f98 (patch) | |
tree | 80081147a8547c9496b45fd562754e3114878e60 | |
parent | ab55f8bfec37dac8750c5d55b585332fc3f9b135 (diff) | |
download | poky-86ec266d912b574c2e2f2057c9c438b13c5c5f98.tar.gz |
bitbake: runqueue/event: Add an event for notifying of stale setscene tasks
Use the new functionality in build.py to identify stale setscene tasks
and send an event to the metadata listing them. The metadata then
has the option of performing cleanup operations if it thinks that
appropriate.
(Bitbake rev: ef8c980a3ae92c168b7ca16a4d19cd38a9574761)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | bitbake/lib/bb/event.py | 11 | ||||
-rw-r--r-- | bitbake/lib/bb/runqueue.py | 14 |
2 files changed, 25 insertions, 0 deletions
diff --git a/bitbake/lib/bb/event.py b/bitbake/lib/bb/event.py index 31e7c2a4d2..0454c75332 100644 --- a/bitbake/lib/bb/event.py +++ b/bitbake/lib/bb/event.py | |||
@@ -670,6 +670,17 @@ class ReachableStamps(Event): | |||
670 | Event.__init__(self) | 670 | Event.__init__(self) |
671 | self.stamps = stamps | 671 | self.stamps = stamps |
672 | 672 | ||
673 | class StaleSetSceneTasks(Event): | ||
674 | """ | ||
675 | An event listing setscene tasks which are 'stale' and will | ||
676 | be rerun. The metadata may use to clean up stale data. | ||
677 | tasks is a mapping of tasks and matching stale stamps. | ||
678 | """ | ||
679 | |||
680 | def __init__(self, tasks): | ||
681 | Event.__init__(self) | ||
682 | self.tasks = tasks | ||
683 | |||
673 | class FilesMatchingFound(Event): | 684 | class FilesMatchingFound(Event): |
674 | """ | 685 | """ |
675 | Event when a list of files matching the supplied pattern has | 686 | Event when a list of files matching the supplied pattern has |
diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py index 3008b7ad4f..80d7f6ca6b 100644 --- a/bitbake/lib/bb/runqueue.py +++ b/bitbake/lib/bb/runqueue.py | |||
@@ -2781,6 +2781,20 @@ def build_scenequeue_data(sqdata, rqdata, rq, cooker, stampcache, sqrq): | |||
2781 | 2781 | ||
2782 | update_scenequeue_data(sqdata.sq_revdeps, sqdata, rqdata, rq, cooker, stampcache, sqrq, summary=True) | 2782 | update_scenequeue_data(sqdata.sq_revdeps, sqdata, rqdata, rq, cooker, stampcache, sqrq, summary=True) |
2783 | 2783 | ||
2784 | # Compute a list of 'stale' sstate tasks where the current hash does not match the one | ||
2785 | # in any stamp files. Pass the list out to metadata as an event. | ||
2786 | found = {} | ||
2787 | for tid in rqdata.runq_setscene_tids: | ||
2788 | (mc, fn, taskname, taskfn) = split_tid_mcfn(tid) | ||
2789 | stamps = bb.build.find_stale_stamps(taskname, rqdata.dataCaches[mc], taskfn) | ||
2790 | if stamps: | ||
2791 | if mc not in found: | ||
2792 | found[mc] = {} | ||
2793 | found[mc][tid] = stamps | ||
2794 | for mc in found: | ||
2795 | event = bb.event.StaleSetSceneTasks(found[mc]) | ||
2796 | bb.event.fire(event, cooker.databuilder.mcdata[mc]) | ||
2797 | |||
2784 | def update_scenequeue_data(tids, sqdata, rqdata, rq, cooker, stampcache, sqrq, summary=True): | 2798 | def update_scenequeue_data(tids, sqdata, rqdata, rq, cooker, stampcache, sqrq, summary=True): |
2785 | 2799 | ||
2786 | tocheck = set() | 2800 | tocheck = set() |