diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-07-11 17:05:19 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-07-16 13:53:17 +0100 |
commit | 1069c364170ffbf1bff276fd965aeb85efbc22f8 (patch) | |
tree | 5ec3000158c05890b3b5bfc0eaf7bfc2a6ece66d /bitbake/lib/bb/tests/runqueue.py | |
parent | 5333f31fc7555f0a39246d4fcafa71debf71abe2 (diff) | |
download | poky-1069c364170ffbf1bff276fd965aeb85efbc22f8.tar.gz |
bitbake: runqueue: Optimise multiconfig with overlapping setscene
Currently if a multiconfig build contains different configurations which
have overlapping sstate artefacts, it will build them multiple times.
This is clearly suboptimal and not what users want/expect.
This adds code to detect this and stall all but one of the setscne tasks
so that once its built, it can be found by the other tasks.
We take care to iterate the multiconfigs in order so try and avoid
dependency loops. We also match on PN+taskname+taskhash since this is
what we know sstate in OE-Core would use. There are some tasks even within
a multiconfig which match hashes (mostly do_populate_lic tasks) but those
have a much higher chance of circular dependency so aren't work attempting
to optimise.
If a deadlock does occur the build will be slower but there is code to
unbreak such a deadlock so it hopefully doens't break anything.
Comments are injected into the test tasks so they have different task
hashes and a new test for this optimisation is added.
(Bitbake rev: a75c5fd6d4ec56836de0be2fe679c81297a080ad)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/tests/runqueue.py')
-rw-r--r-- | bitbake/lib/bb/tests/runqueue.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/bitbake/lib/bb/tests/runqueue.py b/bitbake/lib/bb/tests/runqueue.py index 4a65b5b6e7..f0cea6483f 100644 --- a/bitbake/lib/bb/tests/runqueue.py +++ b/bitbake/lib/bb/tests/runqueue.py | |||
@@ -198,3 +198,22 @@ class RunQueueTests(unittest.TestCase): | |||
198 | 'b1:packagedata_setscene', 'b1:package_qa_setscene', 'b1:populate_sysroot_setscene'] | 198 | 'b1:packagedata_setscene', 'b1:package_qa_setscene', 'b1:populate_sysroot_setscene'] |
199 | self.assertEqual(set(tasks), set(expected)) | 199 | self.assertEqual(set(tasks), set(expected)) |
200 | 200 | ||
201 | def test_multiconfig_setscene_optimise(self): | ||
202 | with tempfile.TemporaryDirectory(prefix="runqueuetest") as tempdir: | ||
203 | extraenv = { | ||
204 | "BBMULTICONFIG" : "mc1 mc2", | ||
205 | "BB_SIGNATURE_HANDLER" : "basic" | ||
206 | } | ||
207 | cmd = ["bitbake", "b1", "mc:mc1:b1", "mc:mc2:b1"] | ||
208 | setscenetasks = ['package_write_ipk_setscene', 'package_write_rpm_setscene', 'packagedata_setscene', | ||
209 | 'populate_sysroot_setscene', 'package_qa_setscene'] | ||
210 | sstatevalid = "" | ||
211 | tasks = self.run_bitbakecmd(cmd, tempdir, sstatevalid, extraenv=extraenv) | ||
212 | expected = ['a1:' + x for x in self.alltasks] + ['b1:' + x for x in self.alltasks] + \ | ||
213 | ['mc1:b1:' + x for x in setscenetasks] + ['mc1:a1:' + x for x in setscenetasks] + \ | ||
214 | ['mc2:b1:' + x for x in setscenetasks] + ['mc2:a1:' + x for x in setscenetasks] + \ | ||
215 | ['mc1:b1:build', 'mc2:b1:build'] | ||
216 | for x in ['mc1:a1:package_qa_setscene', 'mc2:a1:package_qa_setscene', 'a1:build', 'a1:package_qa']: | ||
217 | expected.remove(x) | ||
218 | self.assertEqual(set(tasks), set(expected)) | ||
219 | |||