summaryrefslogtreecommitdiffstats
path: root/meta/classes/rm_work.bbclass
diff options
context:
space:
mode:
authorPatrick Ohly <patrick.ohly@intel.com>2017-03-14 16:29:32 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-03-22 11:35:21 +0000
commit3c8d045d79b9abe37c3ed0e2869195ec1eda9a57 (patch)
treec1959ae8c5c09d0644a332985954a9a8602e999a /meta/classes/rm_work.bbclass
parente4b5771409bf86fa0b0e5d72151be2b42aeac89c (diff)
downloadpoky-3c8d045d79b9abe37c3ed0e2869195ec1eda9a57.tar.gz
rm_work.bbclass: re-enable recursive do_rm_work_all
When rewriting the do_rm_work injection, do_rm_work_all had been removed because it seemed obsolete, as do_build now always triggers do_rm_work. However, do_build does not get triggered for all recipes and thus do_rm_work was not called for recipes that got built only partially. For example, zlib depends indirectly on zlib-native:do_populate_sysroot. Because of that dependency, zlib-native got compiled, but do_rm_work was never called for it. Re-introducing do_rm_work_all fixes that by making do_build depend on do_rm_work_all, which then recursively depends on do_rm_work of all dependencies. This has the unintended side-effect that do_rm_work then also triggers additional work (like do_populate_lic) that normally doesn't need to be done for a build. This seems like the lesser evil, compared to an incomplete cleanup because it mostly enables the lighter tasks after do_populate_sysroot. The real solution would be to have two kinds of relationships: a weak ordering relationship ("if A and B are enabled, A must run before B, but B can also run without A") and hard dependencies ("B cannot run unless A has run before"). (From OE-Core rev: b3de5d5795767a4b8c331fa5040166e7e410eeec) Signed-off-by: Patrick Ohly <patrick.ohly@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/rm_work.bbclass')
-rw-r--r--meta/classes/rm_work.bbclass11
1 files changed, 8 insertions, 3 deletions
diff --git a/meta/classes/rm_work.bbclass b/meta/classes/rm_work.bbclass
index 054c93716e..2490a69c62 100644
--- a/meta/classes/rm_work.bbclass
+++ b/meta/classes/rm_work.bbclass
@@ -102,6 +102,12 @@ do_rm_work () {
102 rm -f $i 102 rm -f $i
103 done 103 done
104} 104}
105do_rm_work_all () {
106 :
107}
108do_rm_work_all[recrdeptask] = "do_rm_work"
109do_rm_work_all[noexec] = "1"
110addtask rm_work_all after before do_build
105 111
106do_populate_sdk[postfuncs] += "rm_work_populatesdk" 112do_populate_sdk[postfuncs] += "rm_work_populatesdk"
107rm_work_populatesdk () { 113rm_work_populatesdk () {
@@ -138,9 +144,8 @@ python inject_rm_work() {
138 # do_build inherits additional runtime dependencies on 144 # do_build inherits additional runtime dependencies on
139 # other recipes and thus will typically run much later than completion of 145 # other recipes and thus will typically run much later than completion of
140 # work in the recipe itself. 146 # work in the recipe itself.
141 deps = bb.build.preceedtask('do_build', True, d) 147 deps = set(bb.build.preceedtask('do_build', True, d))
142 if 'do_build' in deps: 148 deps.difference_update(('do_build', 'do_rm_work_all'))
143 deps.remove('do_build')
144 # In practice, addtask() here merely updates the dependencies. 149 # In practice, addtask() here merely updates the dependencies.
145 bb.build.addtask('do_rm_work', 'do_build', ' '.join(deps), d) 150 bb.build.addtask('do_rm_work', 'do_build', ' '.join(deps), d)
146} 151}