summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/tests/runqueue-tests
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2019-07-11 17:05:19 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-07-16 13:53:17 +0100
commit1069c364170ffbf1bff276fd965aeb85efbc22f8 (patch)
tree5ec3000158c05890b3b5bfc0eaf7bfc2a6ece66d /bitbake/lib/bb/tests/runqueue-tests
parent5333f31fc7555f0a39246d4fcafa71debf71abe2 (diff)
downloadpoky-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-tests')
-rw-r--r--bitbake/lib/bb/tests/runqueue-tests/classes/base.bbclass19
-rw-r--r--bitbake/lib/bb/tests/runqueue-tests/conf/bitbake.conf9
-rw-r--r--bitbake/lib/bb/tests/runqueue-tests/conf/multiconfig/mc1.conf1
-rw-r--r--bitbake/lib/bb/tests/runqueue-tests/conf/multiconfig/mc2.conf1
4 files changed, 27 insertions, 3 deletions
diff --git a/bitbake/lib/bb/tests/runqueue-tests/classes/base.bbclass b/bitbake/lib/bb/tests/runqueue-tests/classes/base.bbclass
index e174c02dd6..cf38d09224 100644
--- a/bitbake/lib/bb/tests/runqueue-tests/classes/base.bbclass
+++ b/bitbake/lib/bb/tests/runqueue-tests/classes/base.bbclass
@@ -4,7 +4,9 @@ SSTATEVALID ??= ""
4def stamptask(d): 4def stamptask(d):
5 import time 5 import time
6 6
7 thistask = d.expand("${PN}:${BB_CURRENTTASK}") 7 thistask = d.expand("${PN}:${BB_CURRENTTASK}")
8 if d.getVar("BB_CURRENT_MC") != "default":
9 thistask = d.expand("${BB_CURRENT_MC}:${PN}:${BB_CURRENTTASK}")
8 if thistask in d.getVar("SLOWTASKS").split(): 10 if thistask in d.getVar("SLOWTASKS").split():
9 bb.note("Slowing task %s" % thistask) 11 bb.note("Slowing task %s" % thistask)
10 time.sleep(0.5) 12 time.sleep(0.5)
@@ -13,48 +15,63 @@ def stamptask(d):
13 f.write(thistask + "\n") 15 f.write(thistask + "\n")
14 16
15python do_fetch() { 17python do_fetch() {
18 # fetch
16 stamptask(d) 19 stamptask(d)
17} 20}
18python do_unpack() { 21python do_unpack() {
22 # unpack
19 stamptask(d) 23 stamptask(d)
20} 24}
21python do_patch() { 25python do_patch() {
26 # patch
22 stamptask(d) 27 stamptask(d)
23} 28}
24python do_populate_lic() { 29python do_populate_lic() {
30 # populate_lic
25 stamptask(d) 31 stamptask(d)
26} 32}
27python do_prepare_recipe_sysroot() { 33python do_prepare_recipe_sysroot() {
34 # prepare_recipe_sysroot
28 stamptask(d) 35 stamptask(d)
29} 36}
30python do_configure() { 37python do_configure() {
38 # configure
31 stamptask(d) 39 stamptask(d)
32} 40}
33python do_compile() { 41python do_compile() {
42 # compile
34 stamptask(d) 43 stamptask(d)
35} 44}
36python do_install() { 45python do_install() {
46 # install
37 stamptask(d) 47 stamptask(d)
38} 48}
39python do_populate_sysroot() { 49python do_populate_sysroot() {
50 # populate_sysroot
40 stamptask(d) 51 stamptask(d)
41} 52}
42python do_package() { 53python do_package() {
54 # package
43 stamptask(d) 55 stamptask(d)
44} 56}
45python do_package_write_ipk() { 57python do_package_write_ipk() {
58 # package_write_ipk
46 stamptask(d) 59 stamptask(d)
47} 60}
48python do_package_write_rpm() { 61python do_package_write_rpm() {
62 # package_write_rpm
49 stamptask(d) 63 stamptask(d)
50} 64}
51python do_packagedata() { 65python do_packagedata() {
66 # packagedata
52 stamptask(d) 67 stamptask(d)
53} 68}
54python do_package_qa() { 69python do_package_qa() {
70 # package_qa
55 stamptask(d) 71 stamptask(d)
56} 72}
57python do_build() { 73python do_build() {
74 # build
58 stamptask(d) 75 stamptask(d)
59} 76}
60do_prepare_recipe_sysroot[deptask] = "do_populate_sysroot" 77do_prepare_recipe_sysroot[deptask] = "do_populate_sysroot"
diff --git a/bitbake/lib/bb/tests/runqueue-tests/conf/bitbake.conf b/bitbake/lib/bb/tests/runqueue-tests/conf/bitbake.conf
index 8c7b754dab..96ee1cd5ec 100644
--- a/bitbake/lib/bb/tests/runqueue-tests/conf/bitbake.conf
+++ b/bitbake/lib/bb/tests/runqueue-tests/conf/bitbake.conf
@@ -6,6 +6,11 @@ PROVIDES = "${PN}"
6PN = "${@bb.parse.vars_from_file(d.getVar('FILE', False),d)[0]}" 6PN = "${@bb.parse.vars_from_file(d.getVar('FILE', False),d)[0]}"
7PF = "${BB_CURRENT_MC}:${PN}" 7PF = "${BB_CURRENT_MC}:${PN}"
8export PATH 8export PATH
9STAMP = "${TOPDIR}/stamps/${PN}" 9TMPDIR ??= "${TOPDIR}"
10T = "${TOPDIR}/workdir/${PN}/temp" 10STAMP = "${TMPDIR}/stamps/${PN}"
11T = "${TMPDIR}/workdir/${PN}/temp"
11BB_NUMBER_THREADS = "4" 12BB_NUMBER_THREADS = "4"
13
14BB_HASHBASE_WHITELIST = "BB_CURRENT_MC"
15
16include conf/multiconfig/${BB_CURRENT_MC}.conf
diff --git a/bitbake/lib/bb/tests/runqueue-tests/conf/multiconfig/mc1.conf b/bitbake/lib/bb/tests/runqueue-tests/conf/multiconfig/mc1.conf
new file mode 100644
index 0000000000..ecf23e1c73
--- /dev/null
+++ b/bitbake/lib/bb/tests/runqueue-tests/conf/multiconfig/mc1.conf
@@ -0,0 +1 @@
TMPDIR = "${TOPDIR}/mc1/"
diff --git a/bitbake/lib/bb/tests/runqueue-tests/conf/multiconfig/mc2.conf b/bitbake/lib/bb/tests/runqueue-tests/conf/multiconfig/mc2.conf
new file mode 100644
index 0000000000..eef338e4cc
--- /dev/null
+++ b/bitbake/lib/bb/tests/runqueue-tests/conf/multiconfig/mc2.conf
@@ -0,0 +1 @@
TMPDIR = "${TOPDIR}/mc2/"