From patchwork Fri Dec 4 08:32:53 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Nyekjaer X-Patchwork-Id: 107273 Received: from mail-43172.protonmail.ch (mail-43172.protonmail.ch [185.70.43.172]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.3710.1796373191819764406 for ; Fri, 04 Dec 2026 00:33:13 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@geanix.com header.s=protonmail header.b=62zD4DYR; spf=pass (domain: geanix.com, ip: 185.70.43.172, mailfrom: sean@geanix.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=geanix.com; s=protonmail; t=1796373189; x=1796632389; bh=GOhFhBMgD0ZlFuHsyhrTZn6kCdaxFMuRTEJ5eMr6cic=; h=From:To:Cc:Subject:Date:Message-ID:From:To:Cc:Date:Subject: Reply-To:Feedback-ID:Message-ID:BIMI-Selector; b=62zD4DYRSSiIQRvGGxhhNZQg289NQ14A2uKpGz0ADqFgFejR9T12IGWnlBpJaWwox sg8WZRLCaM8YsOsvr+tChdRyaZbmIxY8cv77+Pv8DoMehUQIXG1yNNexciFcU5rt2R i99sLcnEZLpMyZQJPcKiqDg7Q3iuCfSL53nbMwsOP6nRpbIc9QTr2IZ8qOxAQd3OH0 YpnreRQ7YSvi+Vn9nJlbL6CBuwrcet/dIedG8qCMXGgyx3p4+XELdpVenfifwnJv2e 0VdJE40hrTYDCGk9leZQE3usEkN0/cwH60YdD+RWHzHDGXIpWkY0z+ZVRDg9L8YMeh JvGAjmK/WjIYQ== X-Pm-Submission-Id: 4jglBB6nndz1DDXX From: Sean Nyekjaer To: openembedded-core@lists.openembedded.org Cc: Sean Nyekjaer Subject: [PATCH] rm_work: don't remove WORKDIR while do_populate_sdk is running Date: Fri, 4 Dec 2026 09:32:53 +0100 Message-ID: <20261204083254.1215409-1-sean@geanix.com> X-Mailer: git-send-email 2.56.0 MIME-Version: 1.0 List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by lin-tor-korg-lkml-alma10-1 with HTTPS for ; Fri, 04 Dec 2026 08:33:22 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/251944 When an image and its SDK are built in the same run, e.g. "bitbake :do_populate_sdk", nothing orders the image's do_rm_work against do_populate_sdk(_ext), so do_rm_work can remove the work directory while the SDK is being populated: Package foobar:core2-64 disappeared on us! Serialize them with a lock in ${T}, which do_rm_work keeps. Ordering do_rm_work after do_populate_sdk isn't an option, as that would build the SDK with every image. The SDK tasks take the lock from a TaskStarted handler, so it also covers their prefuncs and postfuncs, which [lockfiles] does not. AI-Generated: Uses Claude Code (Claude Opus 5.5) Signed-off-by: Sean Nyekjaer --- I was suggested to order do_rm_work after do_populate_sdk instead. A plain "after" would build the SDK with every image, what is missing is a weak ordering in bitbake, i.e. "run after X only if X is part of this build". Any suggestions? meta/classes/rm_work.bbclass | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/meta/classes/rm_work.bbclass b/meta/classes/rm_work.bbclass index 7cb8a325b2..c189d6fea8 100644 --- a/meta/classes/rm_work.bbclass +++ b/meta/classes/rm_work.bbclass @@ -124,6 +124,15 @@ do_rm_work () { } do_rm_work[vardepsexclude] += "SSTATETASKS" +do_rm_work[lockfiles] += "${T}/rm_work.lock" + +addhandler rm_work_sdk_lock +rm_work_sdk_lock[eventmask] = "bb.build.TaskStarted" +python rm_work_sdk_lock() { + if e.taskname in ("do_populate_sdk", "do_populate_sdk_ext"): + d.setVar("_RM_WORK_SDK_LOCK", bb.utils.lockfile(d.expand("${T}/rm_work.lock"))) +} + do_rm_work_all () { : }