diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-07-17 22:46:12 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-07-18 12:16:19 +0100 |
commit | 9881c532c8b1250a6851da2d2290dadc7ae6ef69 (patch) | |
tree | 74339b4706ad5d1068f23865395381fe771440d0 /bitbake | |
parent | d64c2ad24d9e2972db23561df3c22adbb613c2a3 (diff) | |
download | poky-9881c532c8b1250a6851da2d2290dadc7ae6ef69.tar.gz |
bitbake: runqueue: Fix non setscene tasks targets being lost
If you specify both setscene and non-setscene tasks on the commandline, the
non-setscene tasks could be missed, e.g. "bitbake X:do_patch X:do_populate_sysroot"
and do_patch would fail to run.
Fix the problem in runqueue and add a testcase.
(Bitbake rev: 75292fdec5d9c0b5b3c554c4b7474a63656f7e12)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r-- | bitbake/lib/bb/runqueue.py | 10 | ||||
-rw-r--r-- | bitbake/lib/bb/tests/runqueue.py | 9 |
2 files changed, 18 insertions, 1 deletions
diff --git a/bitbake/lib/bb/runqueue.py b/bitbake/lib/bb/runqueue.py index fa848326d8..6a2de240cc 100644 --- a/bitbake/lib/bb/runqueue.py +++ b/bitbake/lib/bb/runqueue.py | |||
@@ -2167,7 +2167,6 @@ class RunQueueExecute: | |||
2167 | return taskdepdata | 2167 | return taskdepdata |
2168 | 2168 | ||
2169 | def scenequeue_process_notcovered(self, task): | 2169 | def scenequeue_process_notcovered(self, task): |
2170 | logger.debug(1, 'Not skipping setscene task %s', task) | ||
2171 | if len(self.rqdata.runtaskentries[task].depends) == 0: | 2170 | if len(self.rqdata.runtaskentries[task].depends) == 0: |
2172 | self.setbuildable(task) | 2171 | self.setbuildable(task) |
2173 | notcovered = set([task]) | 2172 | notcovered = set([task]) |
@@ -2233,6 +2232,7 @@ class RunQueueExecute: | |||
2233 | self.scenequeue_process_unskippable(task) | 2232 | self.scenequeue_process_unskippable(task) |
2234 | 2233 | ||
2235 | if task in self.scenequeue_notcovered: | 2234 | if task in self.scenequeue_notcovered: |
2235 | logger.debug(1, 'Not skipping setscene task %s', task) | ||
2236 | self.scenequeue_process_notcovered(task) | 2236 | self.scenequeue_process_notcovered(task) |
2237 | elif task in self.scenequeue_covered: | 2237 | elif task in self.scenequeue_covered: |
2238 | logger.debug(1, 'Queued setscene task %s', task) | 2238 | logger.debug(1, 'Queued setscene task %s', task) |
@@ -2243,6 +2243,14 @@ class RunQueueExecute: | |||
2243 | logger.debug(1, 'Processing setscene task %s', task) | 2243 | logger.debug(1, 'Processing setscene task %s', task) |
2244 | covered = self.sqdata.sq_covered_tasks[task] | 2244 | covered = self.sqdata.sq_covered_tasks[task] |
2245 | covered.add(task) | 2245 | covered.add(task) |
2246 | |||
2247 | # If a task is in target_tids and isn't a setscene task, we can't skip it. | ||
2248 | cantskip = covered.intersection(self.rqdata.target_tids).difference(self.rqdata.runq_setscene_tids) | ||
2249 | for tid in cantskip: | ||
2250 | self.tasks_notcovered.add(tid) | ||
2251 | self.scenequeue_process_notcovered(tid) | ||
2252 | covered.difference_update(cantskip) | ||
2253 | |||
2246 | # Remove notcovered tasks | 2254 | # Remove notcovered tasks |
2247 | covered.difference_update(self.tasks_notcovered) | 2255 | covered.difference_update(self.tasks_notcovered) |
2248 | self.tasks_covered.update(covered) | 2256 | self.tasks_covered.update(covered) |
diff --git a/bitbake/lib/bb/tests/runqueue.py b/bitbake/lib/bb/tests/runqueue.py index f0cea6483f..f22ad4bd81 100644 --- a/bitbake/lib/bb/tests/runqueue.py +++ b/bitbake/lib/bb/tests/runqueue.py | |||
@@ -97,6 +97,15 @@ class RunQueueTests(unittest.TestCase): | |||
97 | expected = ['a1:fetch', 'a1:unpack', 'a1:patch'] | 97 | expected = ['a1:fetch', 'a1:unpack', 'a1:patch'] |
98 | self.assertEqual(set(tasks), set(expected)) | 98 | self.assertEqual(set(tasks), set(expected)) |
99 | 99 | ||
100 | def test_mix_covered_notcovered(self): | ||
101 | with tempfile.TemporaryDirectory(prefix="runqueuetest") as tempdir: | ||
102 | cmd = ["bitbake", "a1:do_patch", "a1:do_populate_sysroot"] | ||
103 | sstatevalid = self.a1_sstatevalid | ||
104 | tasks = self.run_bitbakecmd(cmd, tempdir, sstatevalid) | ||
105 | expected = ['a1:fetch', 'a1:unpack', 'a1:patch', 'a1:populate_sysroot_setscene'] | ||
106 | self.assertEqual(set(tasks), set(expected)) | ||
107 | |||
108 | |||
100 | # Test targets with intermediate setscene tasks alongside a target with no intermediate setscene tasks | 109 | # Test targets with intermediate setscene tasks alongside a target with no intermediate setscene tasks |
101 | def test_mixed_direct_tasks_setscene_tasks(self): | 110 | def test_mixed_direct_tasks_setscene_tasks(self): |
102 | with tempfile.TemporaryDirectory(prefix="runqueuetest") as tempdir: | 111 | with tempfile.TemporaryDirectory(prefix="runqueuetest") as tempdir: |