From patchwork Sun Aug 16 22:14:45 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: AdrianF X-Patchwork-Id: 95477 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0C1F3C5DF7A for ; Sun, 16 Aug 2026 22:15:21 +0000 (UTC) Received: from mta-64-226.siemens.flowmailer.net (mta-64-226.siemens.flowmailer.net [185.136.64.226]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.18661.1786918513787729393 for ; Sun, 16 Aug 2026 15:15:15 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=adrian.freihofer@siemens.com header.s=fm2 header.b=gLDGg8jD; spf=pass (domain: rts-flowmailer.siemens.com, ip: 185.136.64.226, mailfrom: fm-1329275-2026081622151127603b22800002074b-ixyfkk@rts-flowmailer.siemens.com) Received: by mta-64-226.siemens.flowmailer.net with ESMTPSA id 2026081622151127603b22800002074b for ; Mon, 17 Aug 2026 00:15:11 +0200 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=fm2; d=siemens.com; i=adrian.freihofer@siemens.com; h=Date:From:Subject:To:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:Cc:References:In-Reply-To; bh=EJa+rFJHd+b8IRBuxWlquBJ1y7PKeOSmUlQyuNmQofs=; b=gLDGg8jDo2mfG+bb1BjLnSuduyiGZ/pBe9Td0oDYNV2CZFs2P7ru9dbOLk0RrVzl/969Jy asiBdGpcHiK7MHOangTiZ6BAmM2LwAtl14/xyhDSAtEaHF57ZBEnknHEj7MRa9/gAg9SWQ8j p74nuIf9auyL1zR3+L3x/pEAiRkfRypaal53OsnUg1sTRuhPmFXl6ioTlQrlob4XUQNr3A+g LkxYUNLDtWplMTW018Ok3Sl5r8cR75gfHBAfVGQmMGcyS3GgjuwucnInLbfQyEizJN8Hpp+T hk0JTVF7pvIZ5ArRu3xtupMuBk5f7urWv1kImbS1fLDoqGeaTv0tXZ/w==; From: AdrianF To: bitbake-devel@lists.openembedded.org Cc: Adrian Freihofer Subject: [PATCH v2 6/8] tinfoil: add a prepared task runner Date: Mon, 17 Aug 2026 00:14:45 +0200 Message-ID: <20260816221507.155861-7-adrian.freihofer@siemens.com> In-Reply-To: <20260816221507.155861-1-adrian.freihofer@siemens.com> References: <20260816221507.155861-1-adrian.freihofer@siemens.com> MIME-Version: 1.0 X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-1329275:519-21489:flowmailer List-Id: X-Webhook-Received: from 45-33-107-173.ip.linodeusercontent.com [45.33.107.173] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Sun, 16 Aug 2026 22:15:21 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/bitbake-devel/message/19961 From: Adrian Freihofer Add run_prepared_task() to execute a single recipe task, and nothing else. No dependencies are resolved and no other task of the recipe is run, so everything the task consumes must already be in place. It uses BitBake's normal worker path, retaining the standard dispatch for shell and Python task bodies as well as fakeroot setup. devtool ide-sdk needs to rerun an already prepared BitBake task after a developer changes its source. A normal target build would create a runqueue and resolve dependencies again, and even "bitbake -b" would re-run the task's intra-recipe predecessors. That is wrong for this workflow: the developer intentionally wants to rerun only the prepared task against content the IDE has just produced. Expose the single-task worker path so devtool can reuse it instead of maintaining a separate task executor and pseudo-session setup. AI-Generated: Uses GitHub Copilot Signed-off-by: Adrian Freihofer --- lib/bb/tinfoil.py | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/lib/bb/tinfoil.py b/lib/bb/tinfoil.py index 634d7796f..42385c879 100644 --- a/lib/bb/tinfoil.py +++ b/lib/bb/tinfoil.py @@ -826,20 +826,39 @@ class Tinfoil: else: return None - def build_file(self, buildfile, task, internal=True): + def build_file(self, buildfile, task, internal=True, taskonly=False): """ Runs the specified task for just a single recipe (i.e. no dependencies). This is equivalent to bitbake -b, except with the default internal=True no warning about dependencies will be produced, normal info messages from the runqueue will be silenced and BuildInit, BuildStarted and BuildCompleted events will not be fired. + With taskonly=True the recipe's own task ordering is dropped as well, so + only the requested task runs. """ - return self.run_command('buildFile', buildfile, task, internal) + return self.run_command('buildFile', buildfile, task, internal, taskonly) @wait_for def build_file_sync(self, *args): self.build_file(*args) + def run_prepared_task(self, recipe, task): + """Run *task* for one parsed recipe, and nothing else. + + No dependencies are resolved and no other task of the recipe is run, + so everything the task consumes must already be in place. The task + runs through the normal BitBake worker path, including fakeroot setup + and dispatch of shell or Python task bodies. + + The task is forced to execute rather than being skipped as up to date. + Returns False if the task failed. + """ + self.run_command('setConfig', 'force', True) + try: + return self.build_file_sync(self.get_recipe_file(recipe), task, True, True) + finally: + self.run_command('setConfig', 'force', False) + def build_targets(self, targets, task=None, handle_events=True, extra_events=None, event_callback=None): """ Builds the specified targets. This is equivalent to a normal invocation