From patchwork Wed Sep 9 15:19:06 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 97743 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 6C5EAC79FB6 for ; Wed, 9 Sep 2026 15:19:15 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.14843.1788967152751756578 for ; Wed, 09 Sep 2026 08:19:12 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@arm.com header.s=foss header.b=eTr4XelC; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: ross.burton@arm.com) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 97865176B for ; Wed, 9 Sep 2026 08:19:08 -0700 (PDT) Received: from cesw-amp-gbt-1s-m12830-04.lab.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 160983FA32 for ; Wed, 9 Sep 2026 08:19:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1788967152; bh=yjBGZBa7blXwNbve7MVLtRTUp1MLlWqVYVgehnNJc5k=; h=From:To:Subject:Date:In-Reply-To:References:From; b=eTr4XelCgzYtlFrb5nxsVeGz3g4qFBnB3j5/s8JbUHiN7AKywEiBHECS5rKnk1jHx xPLQVNXil8eamMitGRRzi6YkRpb02Hr1XdXMaJFNb+XlXcp08YwYzt3elJO9uZA6ID N2E81wcs20q8ibvrtRZ4+urmXpZoO6q+oRj2RObM= From: Ross Burton To: openembedded-core@lists.openembedded.org Subject: [PATCH 2/2] classes/cargo-update-recipe-crates: use tomllib directly Date: Wed, 9 Sep 2026 16:19:06 +0100 Message-ID: <20260909151906.3417094-2-ross.burton@arm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260909151906.3417094-1-ross.burton@arm.com> References: <20260909151906.3417094-1-ross.burton@arm.com> MIME-Version: 1.0 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 ; Wed, 09 Sep 2026 15:19:15 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/245479 Now that BitBake vendors in a copy of tomli for when the host Python is too old to support tomllib, we can do the crate update logic directly in the task instead of passing an large inline script to python3-native. The only changes are the removal of nativepython3 and not relying on bitbake's shell expansion to expand variable names. [1] bitbake 69810e0c0a ("lib/bb/_vendor: resync to add tomli") Signed-off-by: Ross Burton --- .../cargo-update-recipe-crates.bbclass | 101 ++++++++++-------- 1 file changed, 54 insertions(+), 47 deletions(-) diff --git a/meta/classes-recipe/cargo-update-recipe-crates.bbclass b/meta/classes-recipe/cargo-update-recipe-crates.bbclass index 47e845c8221..e62039208c1 100644 --- a/meta/classes-recipe/cargo-update-recipe-crates.bbclass +++ b/meta/classes-recipe/cargo-update-recipe-crates.bbclass @@ -14,7 +14,6 @@ ## To perform the update: bitbake -c update_crates recipe-name addtask do_update_crates after do_patch -do_update_crates[depends] = "python3-native:do_populate_sysroot" do_update_crates[nostamp] = "1" do_update_crates[doc] = "Update the recipe by reading Cargo.lock and write in ${THISDIR}/${BPN}-crates.inc" @@ -23,58 +22,66 @@ RECIPE_UPGRADE_EXTRA_TASKS += "do_update_crates" # The directory where to search for Cargo.lock files CARGO_LOCK_SRC_DIR ??= "${S}" -do_update_crates() { - TARGET_FILE="${THISDIR}/${BPN}-crates.inc" +python do_update_crates() { + cargo_lock_src_dir = d.getVar("CARGO_LOCK_SRC_DIR") - nativepython3 - <