@@ -338,6 +338,9 @@ python extend_recipe_sysroot() {
start.add(dep2)
start.remove(dep)
+ # Don't stage the sysroots of the recipes the do_rm_work tasks depend on
+ start = set(dep for dep in start if not setscenedeps[dep][1].startswith("do_rm_work"))
+
#bb.note(" start3 is %s" % str(start))
# Create collapsed do_populate_sysroot -> do_populate_sysroot tree
@@ -131,6 +131,20 @@ do_rm_work_all[recrdeptask] = "do_rm_work"
do_rm_work_all[noexec] = "1"
addtask rm_work_all before do_build
+# Remove the work directories of the recipes do_populate_sdk depends on.
+# Only the dependencies on other recipes are copied, so the image isn't built.
+do_rm_work_populate_sdk () {
+ :
+}
+do_rm_work_populate_sdk[recrdeptask] = "do_rm_work"
+do_rm_work_populate_sdk[depends] = "${@d.getVarFlag('do_populate_sdk', 'depends') or ''}"
+do_rm_work_populate_sdk[rdepends] = "${@d.getVarFlag('do_populate_sdk', 'rdepends') or ''}"
+do_rm_work_populate_sdk[noexec] = "1"
+python () {
+ if d.getVarFlag('do_populate_sdk', 'task'):
+ bb.build.addtask('do_rm_work_populate_sdk', 'do_populate_sdk', '', d)
+}
+
do_populate_sdk[postfuncs] += "rm_work_populatesdk"
rm_work_populatesdk () {
:
@@ -39,6 +39,11 @@ def sstate_rundepfilter(siggen, fn, recipename, task, dep, depname, dataCaches):
if task == "do_rm_work":
return False
+ # Skip the do_rm_work_populate_sdk task signature, it only removes work
+ # directories and must not change the do_populate_sdk signature
+ if deptaskname == "do_rm_work_populate_sdk":
+ return False
+
# (Almost) always include our own inter-task dependencies (unless it comes
# from a mcdepends). The exception is the special
# do_kernel_configme->do_unpack_and_patch dependency from archiver.bbclass.
do_rm_work_all only runs before do_build, so "bitbake <image> -c populate_sdk" leaves the work directories of all recipes the SDK depends on behind. Add do_rm_work_populate_sdk before do_populate_sdk to run do_rm_work for those recipes, without building the image itself. Keep it out of the do_populate_sdk signature, and don't let extend_recipe_sysroot stage the sysroots of the recipes the do_rm_work tasks depend on. [YOCTO #15824] AI-Generated: Uses Claude Code (Claude Opus 5.5) Signed-off-by: Sean Nyekjaer <sean@geanix.com> --- meta/classes-global/staging.bbclass | 3 +++ meta/classes/rm_work.bbclass | 14 ++++++++++++++ meta/lib/oe/sstatesig.py | 5 +++++ 3 files changed, 22 insertions(+)