From patchwork Tue Nov 25 09:00:59 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Schwan X-Patchwork-Id: 75329 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 064C5CFD364 for ; Tue, 25 Nov 2025 09:01:18 +0000 (UTC) Received: from AM0PR83CU005.outbound.protection.outlook.com (AM0PR83CU005.outbound.protection.outlook.com [52.101.69.77]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.13086.1764061274055726105 for ; Tue, 25 Nov 2025 01:01:15 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@phytec.de header.s=selector2 header.b=Zo5fpBHu; spf=pass (domain: phytec.de, ip: 52.101.69.77, mailfrom: m.schwan@phytec.de) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=bSrG7BFAUiuBJgxrva0hqNpmND6De2RMwsZWN6gcaQRryx/6sgXyKGNdXC7ylyUsAYmVNXlXlT+wGuHEq8/500POeJ+q7uW1Wv4lmqaXYw5q0CiMwOtgfO+R5fOnlOsHys6uEVsdUa3JIvH1yHXWEqtQ7W/51mqvp+/kzgDT9DqKSU3kN/P0j8QTghqIn69Exz5pPwSBu3YIyHYAjmqEHBmuIbPA9x7L104xpUEhe2WsUorRMahBQPKsqgwG8mA7xSYDfUnRUPfjInhkLQTgessZc6xpbppEVRv7coc4QoqCF7IW9KgNncBAAgKQlnqniQf6B3V5tFrLr2dF+dP8YQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=dPudlg21DL7Vjkga56z/u3Ugz3xChlOaK50ksOEDJAo=; b=Q3MR8pe3dTuH9Mm3spDObtdy01OVXnzt4hcwqqrpmAKucFQlgrSUGlBTcTeYWeapnTeftZyQK74khfIjq7UwgBjVLi5PGGUqgB+/BGJD7WSd9xynvphAEI49jnmcy98WRixdcqE0uSwlqF0luC26GCBptHFk64Z6YqbVOiTkU40TQUMuijN3BKLIAX7bu982EqJoQM4e2tnpfH0FOOMPWixT2yj7HiGmychqtSxGyHCUqhBCGZmtYGf+q+2PbaeqGU3i5/2Y/99zC9n2TFpzzKNBAGqBlfPrs0U+Zd90JxpD2peZ2Di06eppvjK8ZE8zMdwy0FHkQKQKvkOTKlj0zQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=softfail (sender ip is 91.26.50.189) smtp.rcpttodomain=lists.openembedded.org smtp.mailfrom=phytec.de; dmarc=fail (p=quarantine sp=quarantine pct=100) action=quarantine header.from=phytec.de; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=phytec.de; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=dPudlg21DL7Vjkga56z/u3Ugz3xChlOaK50ksOEDJAo=; b=Zo5fpBHuny7jVa3JsRam1jn5xsc5+IID9tXO1lXTsjoeeXXLET9eOqSnxhJpQkIXW5mW7Oezhr9s9rCrK3e2k+unHAGCgbrWkbcXIQxY8QHszTE/474T80O3Lit/sZMeUckxZC29wiCkqWyACACXyHdQ7szn4av3gLXRNf0fOsMWLour0GWOc9LYYcZxBg873ZLm9j7MSf1cd7ME2kqAXvE7phxAQThX14w+xegGoiSYm3dzRQzmS6gtasue8aUVB6/HLOBXS0n3AvQL4uZ8zXc8D/yhbEgmREh8Funa68Qxh0IxYF36wPWaYDQC+Zmvg+WUnIebiqKpfepd+UJXdg== Received: from AS4P189CA0035.EURP189.PROD.OUTLOOK.COM (2603:10a6:20b:5dd::14) by PRAP195MB1556.EURP195.PROD.OUTLOOK.COM (2603:10a6:102:297::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9343.17; Tue, 25 Nov 2025 09:01:08 +0000 Received: from AMS0EPF000001B2.eurprd05.prod.outlook.com (2603:10a6:20b:5dd:cafe::99) by AS4P189CA0035.outlook.office365.com (2603:10a6:20b:5dd::14) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9366.11 via Frontend Transport; Tue, 25 Nov 2025 09:01:09 +0000 X-MS-Exchange-Authentication-Results: spf=softfail (sender IP is 91.26.50.189) smtp.mailfrom=phytec.de; dkim=none (message not signed) header.d=none;dmarc=fail action=quarantine header.from=phytec.de; Received-SPF: SoftFail (protection.outlook.com: domain of transitioning phytec.de discourages use of 91.26.50.189 as permitted sender) Received: from Postix.phytec.de (91.26.50.189) by AMS0EPF000001B2.mail.protection.outlook.com (10.167.16.166) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9366.7 via Frontend Transport; Tue, 25 Nov 2025 09:01:08 +0000 Received: from augenblix2.phytec.de (172.25.0.51) by Postix.phytec.de (172.25.0.11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.29; Tue, 25 Nov 2025 10:01:08 +0100 From: Martin Schwan To: Subject: [PATCH] cargo-update-recipe-crates: Don't fail for partially empty Cargo.lock Date: Tue, 25 Nov 2025 10:00:59 +0100 Message-ID: <20251125090059.3155853-1-m.schwan@phytec.de> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-Originating-IP: [172.25.0.51] X-ClientProxiedBy: Postix.phytec.de (172.25.0.11) To Postix.phytec.de (172.25.0.11) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AMS0EPF000001B2:EE_|PRAP195MB1556:EE_ X-MS-Office365-Filtering-Correlation-Id: 0bd7193b-18bc-4478-1b89-08de2c012c68 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|82310400026|376014|1800799024; X-Microsoft-Antispam-Message-Info: 30W2u3TZK5RL2/k3b1A3m8mxwhMti+orAv01MPdxr7fD/K82sEIHjUPbz5pzvDQEtQHqfiDOMQnJBU5IObILGjKfu3UfE7vtPZ0r94FAnlCIXIzIAlqW5b4AEWJL1bkubPjdLNnAx5Q9AbfJ+v2vrIKxFHAL7YIOYvDt4D3fVBDspre+h1tSoe3G/UwbFAXusWDoRdozRJR8AlUvnzb5mKKHHg38U9eXwC+WWHrRAR4OWzOtUMR+buI0TvqTXCdlnMa9ZlOUeBy5h4Ue2Aji01Bjne1bGZWtyWagP0xgNUwM815cRM2O6GSx3TywKZJrUytmoRhTtzX5iA9jydZ2YW3SXpnkGunEU6Mxm71jHq/iuEoVyyAvUHQMOSK5/ogdyFFMgZqNSxiGPy98K6fqtMbWlGbdawOJVlgeGZyebXW1f2SPgjlKIYkd2UykELq6S++UpFa4jClSZYdRxuuMrCZMcrDojbxiKAs+smStKNiTcw1fBVwQPsdrOg2JaVlnGGdDAoHsu6zlUah/V1tPU8qIsG2/alY+O/3diqogBeT/SGZW58kJFxfBi5C7ZsYD+Jbuudk1bETZqaDPOP8IL0IoexbZfZHOmfDGflfkL9d7hXKdTKtREFZ/p9KMiSKOIA0l/zrdS0Y09kpz3QBGG7o2w/8eux/7tcjPbD3NjOipQ8Ji/FVl2dPXulrfK9tf2QeMC7wIZYXGu0BQsliw6nJn2TgpIESc7aECH23n1Anpklxynbk1K7NtogAWHkUpsfsbVX/5tj2ATLaV8gL2vpt3o7qbGkVLvby9oZ7/m3W3CLiVmq0e8u8ye47ZyBOPkiEHPSIWMsH1s3YG6TrXVL9YDNGTndPiWaVNLOTgHkji1yHlUjDA/ktLflf5HRlxiZ7QN7G7EMP9dZs4u4ECLkEWPHW3T4i2cgkTfn9S8Pb298xUpowUCQMXLe8rwGjYWwL2va41LtsRsInSqvOheQ9C3zROnDc3aH+G0QG2Qi/DJ+Hy5nLERQDWwl6A404Jo1mfU98/YUD5lYoPQL++CR8s3MOOvlkHE95xCMkA4C+428AgxPRWzkhA3iHgiPCzzpM7pP7tTN0LIeH751ypPpRIrk1Vg3Gg13SwowiAjLCaNozFSQ6n82hRf+EMdEpwTbxrq/RejW4ZBCBnV+u6eB6RLN9f2nZiGkxt/NyDSQEUEHm2qpWmIEpakPM3Vzp7XkUQVsHUHYmKPQTADkBLrGkaRhObkT9up0e+Af0rJlreyP0QJKmYiV/rKzEZKY00SHTjDeoHbsg5RSt6Flsof8TnQ/1LITL0nMUkesg6tvHSFbIoOb6PljZ0tjww1iCoN26xTaL8WCCHoIyp7z+3kByb8bV8QosP7pjgDf5EuEuBtKav2QphBDmpzOwqG7icgroDxdD5Ilw4oooJfCrstc0uU0MubhATnSGGtr61U92Uzjz4k+wrd0qADqxGN7sxf7+BQCF1Dhl1ilsqQA/MA5dpNWDDmLHKPLasZD7yKOi7ozrkl2pWWpW8u7tyooz2wmLL6Pegx6tlwiZR2mG4d3SNOO8NFyVHnaSW4ka3P5c= X-Forefront-Antispam-Report: CIP:91.26.50.189;CTRY:DE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:Postix.phytec.de;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(36860700013)(82310400026)(376014)(1800799024);DIR:OUT;SFP:1102; X-OriginatorOrg: phytec.de X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Nov 2025 09:01:08.4366 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0bd7193b-18bc-4478-1b89-08de2c012c68 X-MS-Exchange-CrossTenant-Id: e609157c-80e2-446d-9be3-9c99c2399d29 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=e609157c-80e2-446d-9be3-9c99c2399d29;Ip=[91.26.50.189];Helo=[Postix.phytec.de] X-MS-Exchange-CrossTenant-AuthSource: AMS0EPF000001B2.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PRAP195MB1556 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 ; Tue, 25 Nov 2025 09:01:18 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/226757 Do not fail if only some Cargo.lock files are empty. Only fail, if there are absolutely no dependencies found in any Cargo.lock. This fixes the following error message, which would occur with "bitbake -c update_crates python3-orjson": ERROR: python3-orjson-3.10.17-r0 do_update_crates: Execution of '.../python3-orjson/3.10.17/temp/run.do_update_crates.70693' failed with exit code 1 ERROR: Logfile of failure stored in: .../python3-orjson/3.10.17/temp/log.do_update_crates.70693 Log data follows: | DEBUG: Executing python function extend_recipe_sysroot | NOTE: Direct dependencies are ['.../sources/oe-core/../oe-core/meta/recipes-devtools/quilt/quilt-native_0.69.bb:do_populate_sysroot', 'virtual:native:.../sources/oe-core/../oe-core/meta/recipes-devtools/patch/patch_2.8.bb:do_populate_sysroot', 'virtual:native:.../sources/oe-core/../oe-core/meta/recipes-devtools/python/python3_3.13.9.bb:do_populate_sysroot'] | NOTE: Installed into sysroot: [] | NOTE: Skipping as already exists in sysroot: ['gettext-minimal-native', 'cmake-native', 'libtool-native', 'quilt-native', 'texinfo-dummy-native', 'openssl-native', 'expat-native', 'ncurses-native', 'util-linux-libuuid-native', 'zlib-native', 'libedit-native', 'make-native', 'patch-native', 'perl-native', 'python3-native', 'bzip2-native', 'xz-native', 'zstd-native', 'attr-native', 'gdbm-native', 'libffi-native', 'sqlite3-native'] | DEBUG: Python function extend_recipe_sysroot finished | DEBUG: Executing shell function do_update_crates | Traceback (most recent call last): | File "", line 41, in | File "", line 12, in get_crates | ValueError: Unable to find any candidate crates that use crates.io | | The above exception was the direct cause of the following exception: | | Traceback (most recent call last): | File "", line 43, in | ValueError: Cannot parse '.../python3-orjson/3.10.17/sources/orjson-3.10.17/include/cargo/simdutf8-0.1.5/Cargo.lock' | WARNING: exit code 1 from a shell command. ERROR: Task (.../sources/oe-core/../meta-openembedded/meta-python/recipes-devtools/python/python3-orjson_3.10.17.bb:do_update_crates) failed with exit code '1' After this change, a working crates include file is produced and warning messages are output instead to inform about potential issues in the corresponding project: WARNING: python3-orjson-3.10.17-r0 do_update_crates: Unable to find any candidate crates that use crates.io WARNING: python3-orjson-3.10.17-r0 do_update_crates: Cannot parse '.../python3-orjson/3.10.17/sources/orjson-3.10.17/include/cargo/simdutf8-0.1.5/Cargo.lock' While at it, restructure do_update_crates() to be a real Python function and use the corresponding code directly inline. Signed-off-by: Martin Schwan --- .../cargo-update-recipe-crates.bbclass | 91 +++++++++---------- 1 file changed, 45 insertions(+), 46 deletions(-) diff --git a/meta/classes-recipe/cargo-update-recipe-crates.bbclass b/meta/classes-recipe/cargo-update-recipe-crates.bbclass index 3251d5ef2e..589f497680 100644 --- a/meta/classes-recipe/cargo-update-recipe-crates.bbclass +++ b/meta/classes-recipe/cargo-update-recipe-crates.bbclass @@ -23,59 +23,58 @@ 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() { + import tomllib - nativepython3 - <