From patchwork Thu Nov 5 11:32:00 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Dora, Sunil Kumar" X-Patchwork-Id: 103117 Received: from mx0b-0064b401.pphosted.com (mx0b-0064b401.pphosted.com [205.220.178.238]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.32246.1793878352785478610 for ; Thu, 05 Nov 2026 03:32:33 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@windriver.com header.s=PPS06212021 header.b=A2Mu6rqF; spf=permerror, err=parse error for token &{10 18 %{ir}.%{v}.%{d}.spf.has.pphosted.com}: invalid domain name (domain: windriver.com, ip: 205.220.178.238, mailfrom: prvs=576967b061=sunilkumar.dora@windriver.com) Received: from pps.filterd (m0250812.ppops.net [127.0.0.1]) by mx0a-0064b401.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6A59uQCv1187692 for ; Thu, 5 Nov 2026 11:32:31 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=windriver.com; h=cc:content-transfer-encoding:content-type:date:from :in-reply-to:message-id:mime-version:references:subject:to; s= PPS06212021; bh=zHxm6dlk14PqgnoB6wV8HQj7vbHbTKWZTXxs9xCuYFs=; b= A2Mu6rqFugwkAGuEPqSbCiIToTMPDWyrk40E+mBSO/+vNX/R9vhku1jglpFFpZIv XP+p5aEZ2WijLtycb8NNXDQsAFCo+bZ7KXNaZbQpF9S4IDbWohR0zBd4DE8QhV3v hYzfVRtoJGL3huRGMqjuhSI9e/FGl2NjhZtmyMPpT/qsGfV8Bo75+w+4BYq0/SkK eTqlTvY4Ff5c5/nK+Ksg5B5YpNTgDfhIafHNExRkTTL4G43/fHGiL4LpTiyPmrf2 bWViANRK86xmqsnQ5UpcFe07Io1UpVbOW1fgc7LnPHcC7qD3AzQ9MCx1vCjGtGHh 11BqBFnJEwJQ1yt2PAdhZQ== Received: from mw6pr02cu001.outbound.protection.outlook.com (mail-westus2azon11022130.outbound.protection.outlook.com [52.101.48.130]) by mx0a-0064b401.pphosted.com (PPS) with ESMTPS id 4hram4hnn8-2 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Thu, 05 Nov 2026 11:32:31 +0000 (GMT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=gg40i/5pLpxbEOun/wYkxRZABuSb0dUmTx2eqXoEZmXl0yzUpjQenN0ABph3fTi8mEV4ArATUuE8DSS5+ILMoS3ZWCwl/FWa6DGJvsnxtu/PUMsEI0Q4igu6cJ1RpEkEruhc12Kwa/KAAZecqwPgYYKAPRo3bxB5m4s65+Z8vBI9YelU2uU7FF5ei6YIb9L1qyCPM7++b/zFMDb4YXrCgzuCCC5mVIkVj4sJdbBnbsLlWC6//ifAodQFz7gGuDZbBss1LYCjqcWqSwFysYGghIEZMNLZgwqHz4UJjIPD8bsMA1m5rcdnAfH4t1FkuqGXBPVhHM/HayaRXXxtQfkQgg== 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=zHxm6dlk14PqgnoB6wV8HQj7vbHbTKWZTXxs9xCuYFs=; b=muQkhLGs5a0MJWIQsp3I7GHgx3N+G7yRz7TZ2gbFTZDrYR8urkUGiwGijDlRCBqyDdHn9ANInlneqeAtYG5PqSmuS7FWbQ0Jhk4bWIioLvYfASpcsT/11PXYweUO03uLpAdlXjagdgpbE8qjPdy99lowofeDA12/p27q7jM/C2DgJpNAD965Rvt5u1nOUlOICn3brag/woWJV4mybpptK523mkluQ+CbKqxnL0KI6zwVpG8s6ocqCzKiu6Zn6Mb9zD0yR6qZE+mvksJoBxr9ogsUJKpegEDhIncP/4aT9mV6kVZMwO9gKKHSNo8YLjRal/lLMmmnAtAdg1TCQ4kXGA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=windriver.com; dmarc=pass action=none header.from=windriver.com; dkim=pass header.d=windriver.com; arc=none Authentication-Results: mx.microsoft.com 1; dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=windriver.com; Received: from DS0PR11MB7901.namprd11.prod.outlook.com (2603:10b6:8:f4::20) by DS0PR11MB7802.namprd11.prod.outlook.com (2603:10b6:8:de::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.592.8; Thu, 5 Nov 2026 11:32:26 +0000 Received: from DS0PR11MB7901.namprd11.prod.outlook.com ([fe80::4293:7c4b:a0b5:eb5f]) by DS0PR11MB7901.namprd11.prod.outlook.com ([fe80::4293:7c4b:a0b5:eb5f%3]) with mapi id 15.21.0592.007; Thu, 5 Nov 2026 11:32:26 +0000 From: sunilkumar.dora@windriver.com To: openembedded-core@lists.openembedded.org Cc: richard.purdie@linuxfoundation.org, alejandro@enedino.org, sundeep.kokkonda@windriver.com, Randy.MacLeod@windriver.com, sunilkumar.dora@windriver.com Subject: [PATCH 1/3] cargo-c: keep the build host triple out of cargo unit metadata Date: Thu, 5 Nov 2026 03:32:00 -0800 Message-ID: <20261105113205.1571267-2-sunilkumar.dora@windriver.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20261105113205.1571267-1-sunilkumar.dora@windriver.com> References: <20261105113205.1571267-1-sunilkumar.dora@windriver.com> X-ClientProxiedBy: SJ0PR03CA0131.namprd03.prod.outlook.com (2603:10b6:a03:33c::16) To DS0PR11MB7901.namprd11.prod.outlook.com (2603:10b6:8:f4::20) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR11MB7901:EE_|DS0PR11MB7802:EE_ X-MS-Office365-Filtering-Correlation-Id: 96b0acef-d783-44eb-2512-08df3b3077c0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|23010399003|376014|52116014|366016|1800799024|38350700014|260925022911599003|260925021911599003|261102123227099003|260925021311599003|56012099006|261022075727099003|261022105027099003|261021121427099003|11063799006|261009223027099003|261026140227099003|261026121527099003|261028144727099003|10067099003|22082099003|18002099003|6133799003|3023799007; X-Microsoft-Antispam-Message-Info: vw7mqMItNS9/8V+7OXueXFkg3YROQfezl9IiFkzjaVUv3mrIsic1H6FYdwdCCPf5YrMk4mJ1VZO+HIQzB7tkfVRWH1v7ivo2KdA/ZAWreWBWlWGXprmDDsSnlZUVykEJcSZxhdhJ6IJSpkv8sHw6meM5fmbjdYoKTK44F1X52uV1HYnmy8g4PA6KfYujqIvrga1yIjIG8txfJti3A9icSnhAIB0Ep+tdMk+b1pkIXEhgq38dHIfub4UDHPgoazyS5WByfmtqiH6ecA8Skxh/EPQBjcC+icGXUOBIMaRGxJm17r4p9zCdiyey2AZw2VQgIzaX5b5TvdMvoBChx7vIPxFcxwJllfWBkU5Pz4prZFtexWNDn6+BgoP5Qay8F4WRXdV0noIv+sVi/zyBav9N9TJ54uqWSwTu6YfjnhLwxIElpoCniESIK1QiD0KcEjDARW95IGmwDg4PW1wqm9hOskugq0H0z32uDXVgNptiVrTBY3oluQaoYy9lqetiTT749ZCfci986vOHiFp878xvjnIn/TK1Pt4vtU9gtQyeCpC519Q/PFqBfE0+BS+bDiSUzkHrJmuidi9b/uv4LlukQPHF8eC1czIiVeWnC8YSA1R8C/gNnbcdw1WO6bTY6v24GgHz0rKFZn/GzcXkonCDkT14egSJ/s6hWq3xj5BUO/E= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DS0PR11MB7901.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(23010399003)(376014)(52116014)(366016)(1800799024)(38350700014)(260925022911599003)(260925021911599003)(261102123227099003)(260925021311599003)(56012099006)(261022075727099003)(261022105027099003)(261021121427099003)(11063799006)(261009223027099003)(261026140227099003)(261026121527099003)(261028144727099003)(10067099003)(22082099003)(18002099003)(6133799003)(3023799007);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: FNngD2BkdxYuAj3HD2kqYVGDrEUM7lzYASCFSz9c1C5hnHp7bGvLEqN36NM+OscuJqhtiHLclLzf58LZaVQxokkM3nCcJWm04HUt47/KC0tY/SbENlBJILwp5KR3vEby0AL5oDys/HfzIOmodQJfgZcM/DA0eZJpvOKR/xB9z2d5OytFF2+zoc5Bq7GMCy0Zq7pakzyuhwni9/l2jAak5UDuAf5v3MJnO6/L4C4F6q8KpYCCFwzC/r+E2QCFSCVeqBUZel2hIJY6tw2w3XUANwlfcAayR1ITdq3aFTxWCtovH5d8/tmIq8Wx2U056xFB+sOo1i0zxFGbxrT/CehLvEW0nvkV2MVYMh8uTa8e00CUekUKTawWyvrQVoGTBu5PZlrqYHMtZ6sCUxYP58HRTpq7S1edR6snufIaBvmjkhGDzFOdwqPJAEDWwmb7yyhR26wfKnI1XndCLBV/Gh9puC8AF0aODR28E8hPmo7gXPzWHCjfQykdYk/wmJ8H8JQhCO38Hm8CopGfxa7ol2lCeX4p8huYSN7474zaBmPWURBBhk4FoOQYt0aLZlvoHcwR1v1iHmx5lG/JwCg+1XAa/CKX2H/3NmP/i03kDMA36jvKOsqjRrm8ManT4faj/1DWW5JjJXN7eefBePJLK4rp4Zj7ZEKC/AIGSvwxy6HzQa1+84Jke5gDSsY8fC1tW9nSe8FBdM6YIksCwiPISKfH2WIQMmteNosye6zpQdPF80vkn07zPEkto1C3dTYTdyUGF8AQ02L9cFIdOA97SavxaVGINTPlVCRQ9/XfMXkINvbtOTXVHopOBBLAWlrEbw42bTMVj3GgfASAFgkliIeKaN51b1HTM1JAveBtdL3cWzrH4ox3Gqy0qndEnYeG4XFD1IyF0KPX7888+014U+8LD9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WA0Vvj2QDJxiGiZWxciWqcTqUPQjp/GV25lVEiLh4E3Sv7WPgI9tKdqigpiIj4B5sdv0bJAV+V3WRZh9GxAG6txtbug6uZi4QsKNSoqJVFS2KLPekIWQ== X-OriginatorOrg: windriver.com X-MS-Exchange-CrossTenant-Network-Message-Id: 96b0acef-d783-44eb-2512-08df3b3077c0 X-MS-Exchange-CrossTenant-AuthSource: DS0PR11MB7901.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Nov 2026 11:32:26.6269 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8ddb2873-a1ad-4a18-ae4e-4644631433be X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: /elXxiOdPwgusz3shMiN/u7hIDFS+gdhEMb6v3bBi+awz2MJvntIGcVX0ngW7ug2G8Sfg73WUHpH7Sxc7GmPrbmWaMarGVp+5ernqNuFPu0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR11MB7802 X-Proofpoint-Reinject: loops=2 maxloops=12 X-Authority-Analysis: v=2.4 cv=cpMOAF4i c=1 sm=1 tr=0 ts=6aec694f cx=c_pps a=5U2/TfBw33PfA2YBhd8Q5Q==:117 a=6eWqkTHjU83fiwn7nKZWdM+Sl24=:19 a=z/mQ4Ysz8XfWz/Q5cLBRGdckG28=:19 a=lCpzRmAYbLLaTzLvsPZ7Mbvzbb8=:19 a=xqWC_Br6kY4A:10 a=zJRp6_cAMcgA:10 a=VkNPw1HP01LnGYTKEx00:22 a=bi6dqmuHe4P4UrxVR6um:22 a=fTW__CHxibyLmBMfj2wP:22 a=NEAV23lmAAAA:8 a=Q4-j1AaZAAAA:8 a=t7CeM3EgAAAA:8 a=zjtiufAZAAAA:8 a=TrGZlGhXKWsQoEPy0aEA:9 a=9H3Qd4_ONW2Ztcrla5EB:22 a=FdTzh2GWekK77mhwV6Dw:22 a=2tRhtM0yMehlNRDZlsEQ:22 X-Proofpoint-GUID: j16htTy_rIk0XGREb44zElOKdPhlW3qE X-Proofpoint-Spam-Info: AW1haW4tMjYxMTA1MDA0NSBTYWx0ZWRfX9fSGZsHVxtKR 3u7GtyD+8yFRZh2IETseYK6BEwH18SpyS1hi7msRCenlUiuwFXVA5BtvqFTP1SiE5U/0f3lzrHC V0Srs8XvWYX1hfpytkMXnhFY4RDNW8bKRsN+yRJA7awopABTWSdo X-Proofpoint-ORIG-GUID: rebsG0RfMfunyr7YaitpCUzpEAptBIvO X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMTA1MDA0NSBTYWx0ZWRfXxqPufyc3F76q izBp95jG3Idx3+Aha8SnYQ5K3eKUfzWPAsVU7/YNOZ8AwACjxTyD2A4x46DWsn05LYzk+TVM1or 6fFJuCi4EckS7KZ6htK+BYhXOnK9tf53kw618KphbyqWa8JjVI8S2L/5pgbSh/N3jFlkVJzvAtg Ch6c3vl7C85825O3+tCdnRzyAAeiMCebxM4MJed6zLj4UM/gvzNmjoou2G4BRzTop8moUuObweW R6XvenSMW7pFG+lD0ulHnv5v7MGGlE95XrsZx2PGbRpHWQq6uj+liY0FZ3RP0i8trVEp+C3mfY5 uzB5LJWx6t4MncD8EOwLF5hOQdt/HFuNsy90bX5Bj6vBvZkjlOG3UXllcF/UKPOqonzqHtaEjjf SGGpMVvj7S08gMRnE0/mRveFgfknIWjEbqkJKKamd/RzjyzREqMumKOgX1lH1BOqrlCijvSMeHx 6VWQF6+c3bUU1c+EgUg== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.138,FMLib:17.12.100.49 definitions=2026-11-05_03,2026-11-04_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 phishscore=0 adultscore=0 clxscore=1015 lowpriorityscore=0 priorityscore=1501 impostorscore=0 spamscore=0 malwarescore=0 bulkscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2610300000 definitions=main-2611050045 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 ; Thu, 05 Nov 2026 11:32:41 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/249539 From: Sunil Dora rust-source.inc carries 0004-cargo-omit-host-triple-from-unit-metadata-hash.patch so that cargo does not hash the "host:" line of rustc -vV into the unit metadata of build scripts and proc-macros. That line goes into both hashes of a host unit, so without the patch every target crate that has a build script or uses a proc-macro gets a different unit_id, and with that a different -C extra-filename and OUT_DIR path, on an x86_64 and on an aarch64 build host. The cargo-c copy of rust/files/0006-cargo-keep-host-deps-*.patch, later in this series, takes care of the -C metadata (symbol names) side; this one is still needed for the file names and OUT_DIR, which end up in some binaries as strings. cargo-c does not use that cargo binary. It links its own copy of the cargo crate (from crates.io), so recipes built with cargo-cbuild still have the problem. Carry the same patch here for that crate, only the paths are different. Drop this together with rust/files/0004-cargo-omit-host-triple-*.patch. [YOCTO #16376] Signed-off-by: Sunil Dora --- ...-host-triple-from-unit-metadata-hash.patch | 64 +++++++++++++++++++ .../cargo-c/cargo-c_0.10.26+cargo-0.100.0.bb | 1 + 2 files changed, 65 insertions(+) create mode 100644 meta/recipes-devtools/cargo-c/cargo-c/0002-cargo-omit-host-triple-from-unit-metadata-hash.patch diff --git a/meta/recipes-devtools/cargo-c/cargo-c/0002-cargo-omit-host-triple-from-unit-metadata-hash.patch b/meta/recipes-devtools/cargo-c/cargo-c/0002-cargo-omit-host-triple-from-unit-metadata-hash.patch new file mode 100644 index 0000000000..339317d486 --- /dev/null +++ b/meta/recipes-devtools/cargo-c/cargo-c/0002-cargo-omit-host-triple-from-unit-metadata-hash.patch @@ -0,0 +1,64 @@ +From 5c4fd7d8b85f4de5be387777a782fc3ddd1227d8 Mon Sep 17 00:00:00 2001 +From: Alejandro Enedino Hernandez Samaniego +Date: Tue, 15 Sep 2026 17:05:36 +0530 +Subject: [PATCH] cargo: keep the build host triple out of unit metadata + +cargo hashes the "host:" line of "rustc -vV" into the metadata of host +units, that is build scripts and proc-macros. Every target crate that +depends on one picks that up through its own metadata, so the same crate +gets a different -C metadata and StableCrateId on an x86_64 and an aarch64 +build host. Drop the host from the hash. The same class of problem is +reported upstream, framed as OS differences, in +https://github.com/rust-lang/cargo/issues/8140. + +Patch by Alejandro Enedino Hernandez Samaniego, from his strict-version-hash +v5 series for openembedded-core: +https://lists.openembedded.org/g/openembedded-core/topic/120939810 + +This is the patch carried in rust-source.inc for the cargo binary, applied +here to the cargo library crate that cargo-c links against, so that +recipes built through cargo-cbuild get the same behaviour. + +Upstream-Status: Inappropriate [OE-specific] + +Signed-off-by: Alejandro Enedino Hernandez Samaniego +Signed-off-by: Sunil Dora +--- + +diff --git a/src/compiler/build_runner/compilation_files.rs b/src/compiler/build_runner/compilation_files.rs +index 88cab85..9dbd203 100644 +--- a/src/compiler/build_runner/compilation_files.rs ++++ b/src/compiler/build_runner/compilation_files.rs +@@ -877,7 +877,7 @@ fn has_remap_path_prefix(args: &[String]) -> bool { + } + + /// Hash the version of rustc being used during the build process. +-fn hash_rustc_version(bcx: &BuildContext<'_, '_>, hasher: &mut StableHasher, unit: &Unit) { ++fn hash_rustc_version(bcx: &BuildContext<'_, '_>, hasher: &mut StableHasher, _unit: &Unit) { + let vers = &bcx.rustc().version; + if vers.pre.is_empty() || bcx.gctx.cli_unstable().separate_nightlies { + // For stable, keep the artifacts separate. This helps if someone is +@@ -886,7 +886,7 @@ fn hash_rustc_version(bcx: &BuildContext<'_, '_>, hasher: &mut StableHasher, uni + // omitted since rustc should produce the same output for each target + // regardless of the host. + for line in bcx.rustc().verbose_version.lines() { +- if unit.kind.is_host() || !line.starts_with("host: ") { ++ if !line.starts_with("host: ") { + line.hash(hasher); + } + } +@@ -899,12 +899,6 @@ fn hash_rustc_version(bcx: &BuildContext<'_, '_>, hasher: &mut StableHasher, uni + // This assumes that the first segment is the important bit ("nightly", + // "beta", "dev", etc.). Skip other parts like the `.3` in `-beta.3`. + vers.pre.split('.').next().hash(hasher); +- // Keep "host" since some people switch hosts to implicitly change +- // targets, (like gnu vs musl or gnu vs msvc). In the future, we may want +- // to consider hashing `unit.kind.short_name()` instead. +- if unit.kind.is_host() { +- bcx.rustc().host.hash(hasher); +- } + // None of the other lines are important. Currently they are: + // binary: rustc <-- or "rustdoc" + // commit-hash: 38114ff16e7856f98b2b4be7ab4cd29b38bed59a +-- +2.43.0 diff --git a/meta/recipes-devtools/cargo-c/cargo-c_0.10.26+cargo-0.100.0.bb b/meta/recipes-devtools/cargo-c/cargo-c_0.10.26+cargo-0.100.0.bb index 722a128d43..37d6a59aca 100644 --- a/meta/recipes-devtools/cargo-c/cargo-c_0.10.26+cargo-0.100.0.bb +++ b/meta/recipes-devtools/cargo-c/cargo-c_0.10.26+cargo-0.100.0.bb @@ -7,6 +7,7 @@ LIC_FILES_CHKSUM = " \ SRC_URI = "crate://crates.io/cargo-c/${PV};name=cargo-c \ file://0001-parking-lot-Use-libc-SYS_futex_time64-on-riscv32.patch;patchdir=../parking_lot_core-0.9.12/ \ + file://0002-cargo-omit-host-triple-from-unit-metadata-hash.patch;patchdir=../cargo-0.100.0/ \ " SRC_URI[cargo-c.sha256sum] = "5ff6e05531e58286d3c02ec0adb7f254e5d532a8d4b667f30b9942d802e1db25" S = "${CARGO_VENDORING_DIRECTORY}/cargo-c-${PV}" From patchwork Thu Nov 5 11:32:01 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Dora, Sunil Kumar" X-Patchwork-Id: 103118 Received: from mx0b-0064b401.pphosted.com (mx0b-0064b401.pphosted.com [205.220.178.238]) by mx.groups.io with SMTP id smtpd.msgproc01-g2.32247.1793878353229786867 for ; Thu, 05 Nov 2026 03:32:33 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@windriver.com header.s=PPS06212021 header.b=Oezr7/sr; spf=permerror, err=parse error for token &{10 18 %{ir}.%{v}.%{d}.spf.has.pphosted.com}: invalid domain name (domain: windriver.com, ip: 205.220.178.238, mailfrom: prvs=576967b061=sunilkumar.dora@windriver.com) Received: from pps.filterd (m0250812.ppops.net [127.0.0.1]) by mx0a-0064b401.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6A59uOTm1187682 for ; Thu, 5 Nov 2026 11:32:32 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=windriver.com; h=cc:content-transfer-encoding:content-type:date:from :in-reply-to:message-id:mime-version:references:subject:to; s= PPS06212021; bh=u3DqpM+1rCtzBoP4T5reY/kHilD0w2KvsOGJWpC3Xpg=; b= Oezr7/srcKeykjoiu+6nnhRngW67d4rBBzvZTwJH6I5YD+xuPNA9Ugfr6ZU+gW3z 2Ccz17w5ov65RC6dwfTlYFDSOdRUNzOCp/RSGQKdBAsnDJ8PgTl2sPzx3H3LEQ1T nO1mhAWaH8dJj+JOkwJ+zdrIlKnKTTGPincgIy4PZADP6WBrft+elb755P2yMFcE L2IDVawzcEzhO6EZCtIOFMeE+wgshvJ61tDjTyNga4Qu67zL/WZirL2fidYvOfmA g9wL6vgBJrHnVWYvwlsZxtVK5r3iDgXrNU9C8RDYAvZ1EfgUVd9oCdGItoFdzAXQ PRbBazt+jibBb3O9yn1N+g== Received: from mw6pr02cu001.outbound.protection.outlook.com (mail-westus2azon11022130.outbound.protection.outlook.com [52.101.48.130]) by mx0a-0064b401.pphosted.com (PPS) with ESMTPS id 4hram4hnn8-3 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Thu, 05 Nov 2026 11:32:31 +0000 (GMT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=pfM3Alf5j5uAZiCgQ9QU2ZxY5vL9ZXOqVvw+K1Spc7yj8m4py4iYjLz+VqemBOU8OwSH73Jpg2aTHNXKbFpbFfI9fFMQckBCq9lO2IWZEvGNrPPkDiFjlZaGAcD2zrcFuYSzCV7lAjcXZSC+/Zqmqg3CoUkQJ/mmva3F39ovXlV+qBUYpx3hO0ke1pCfCnEqq+FItMmlXb7eOs4YLwPrweGcUiS0aduYUrwWbVZ4lC20ipj/HgOz4OZSiKVKQrt+d4+WOMYmnkLVZQWYbpzBNNsmaQEcsC3V/N4KtlZlXOWZpS2KH547DbiIxc34hXJ3vUTHfcZn+wFrlJmbAtMT2Q== 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=u3DqpM+1rCtzBoP4T5reY/kHilD0w2KvsOGJWpC3Xpg=; b=jpPzueu9KWats7R6+UiFiqNoy79srYfNjy3yzGVUGWFDSrUxZ8F5gCseurdQuDivsFb0XSTjTSMv1tvHmavN9IaF+oErcpBiqyHTuIPz7srpOhLRfYMAKyn8cCP7naIw+2L60RILNfJEH50zTcLr8CoRG09pTZKb090IJykM3Lz5+KHmSQzE4Rjy1VUWEmE8Orhd7GQhoxGSFnS11ex8eX1NxwZD3jxWbTxYwHvQljh3yy3MY0NqDuIN+hvMVXcYUfg50I4s72MmCC5xk/D6JOJG5g+XdVKS8D917grJ58454Qa9M4wl9J7Cr93W7oD/hN1LzW9rY2jH8tVXE5M0SQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=windriver.com; dmarc=pass action=none header.from=windriver.com; dkim=pass header.d=windriver.com; arc=none Authentication-Results: mx.microsoft.com 1; dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=windriver.com; Received: from DS0PR11MB7901.namprd11.prod.outlook.com (2603:10b6:8:f4::20) by DS0PR11MB7802.namprd11.prod.outlook.com (2603:10b6:8:de::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.592.8; Thu, 5 Nov 2026 11:32:28 +0000 Received: from DS0PR11MB7901.namprd11.prod.outlook.com ([fe80::4293:7c4b:a0b5:eb5f]) by DS0PR11MB7901.namprd11.prod.outlook.com ([fe80::4293:7c4b:a0b5:eb5f%3]) with mapi id 15.21.0592.007; Thu, 5 Nov 2026 11:32:28 +0000 From: sunilkumar.dora@windriver.com To: openembedded-core@lists.openembedded.org Cc: richard.purdie@linuxfoundation.org, alejandro@enedino.org, sundeep.kokkonda@windriver.com, Randy.MacLeod@windriver.com, sunilkumar.dora@windriver.com Subject: [PATCH 2/3] rust: keep host-kind dependency metadata out of target -C metadata Date: Thu, 5 Nov 2026 03:32:01 -0800 Message-ID: <20261105113205.1571267-3-sunilkumar.dora@windriver.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20261105113205.1571267-1-sunilkumar.dora@windriver.com> References: <20261105113205.1571267-1-sunilkumar.dora@windriver.com> X-ClientProxiedBy: SJ0PR03CA0131.namprd03.prod.outlook.com (2603:10b6:a03:33c::16) To DS0PR11MB7901.namprd11.prod.outlook.com (2603:10b6:8:f4::20) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR11MB7901:EE_|DS0PR11MB7802:EE_ X-MS-Office365-Filtering-Correlation-Id: 2f591e6f-d12c-4c3a-ef37-08df3b307836 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|23010399003|376014|52116014|366016|1800799024|38350700014|260925022911599003|260925021911599003|261102123227099003|260925021311599003|56012099006|261022075727099003|261021121427099003|11063799006|5023799004|261009223027099003|261026121527099003|10067099003|12006099003|25016099003|22082099003|18002099003|29003799003|6133799003|13003099007; X-Microsoft-Antispam-Message-Info: dqsC3YduUkJ5MXK/0mw+ZuRUHK1uKmKtmZaP7Nr2z8Ig+UodBJm0DC0WyZmjhA40lMP3JBJc3UN+WIvvRf424ZSx1xTaIwO3zu+uaN3S/FWJKt9cfelsqA6xtR0R39FxxjIuinl8Qzma5+J3VH8BhiHJzdVg2rMXJbG/E9xOdUyrLB+lLE/TzMMr91L9YIpcP8OoEO+knrJ4sVyCbmMNxcaMn8zh8tNnyMXLto4pvHPE4S6DTUpXdumhBvpsb85YGmWhn6UjEpMjzLG/L2dEcLemx18QS4WZ4Pn2FgYxqXJwUjqism+rfY0aYOwkExVd/E7r7j3VCXdrqEmFN++0NsSLtgEQXCZ/ELzuiPlETjDu85ho66Pflo/gSrkcmqLCqOt77Sms7UsUCXOEPm87L17Lpo0o+hKNaRkuaII3/2I3/VF8hIWNMOykgkQMhxnj1zBGau9BpLs/PMb7DThv3MwOT9eECieXQJFKQC/L/4z4gdSqpYzaOXNzqivH7EwwcpKhyu1l0pdBnpZK2PXnDUYQLdjsnB3xn91zY8l9zyasiHFBDd9Ise5ewWhk8+jeqO76IgcF3E+mgh8XvAmmIkvWr1EzvfyhO5ZNXFWHAO3PBGggiHLoOOOm6SPnsroKpzLUKbX5QTGBjoDBl9woF0IGmYwKgvqHrcEFhSY8yMQ= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DS0PR11MB7901.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(23010399003)(376014)(52116014)(366016)(1800799024)(38350700014)(260925022911599003)(260925021911599003)(261102123227099003)(260925021311599003)(56012099006)(261022075727099003)(261021121427099003)(11063799006)(5023799004)(261009223027099003)(261026121527099003)(10067099003)(12006099003)(25016099003)(22082099003)(18002099003)(29003799003)(6133799003)(13003099007);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?KW2qZrOoMooRIlHT34hsUSqB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iTaCqMKxBoudIttWtI24RccXdZyx/OOrWU4uXJfcInm5FiJBuoTsn8q6mgF1V2FIqOLLEXLDwsSzIVhf+G49Wa4sZEPuHFFE2QBnKmojJxEbe80/YMlLG7uRU3RptORnonJhzRYyBi6pwXtOZFea/h/iiE3D1LjzlzkP11RhI4YnA+omM1gcVkCno8nfnpDinaYRjheY8Hczt7baMYSWBhdegjoxOzvZ9LKgabVLy2CgySaf2iQQVLmVF+vm3YP9mpFWzkp53osuECYwWvwZMFQ== X-OriginatorOrg: windriver.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2f591e6f-d12c-4c3a-ef37-08df3b307836 X-MS-Exchange-CrossTenant-AuthSource: DS0PR11MB7901.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Nov 2026 11:32:27.2345 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8ddb2873-a1ad-4a18-ae4e-4644631433be X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Zj0QfNEqDMcafMlwlwi86KkADBBfJvWQyIor3d9XPmhjIMFgQVIt6qCCoy8UQhKtxD91jxoxQ3yBKO359gYFpNGtAl8d83jZMu1DxnUJ/As= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR11MB7802 X-Proofpoint-Reinject: loops=2 maxloops=12 X-Authority-Analysis: v=2.4 cv=cpMOAF4i c=1 sm=1 tr=0 ts=6aec694f cx=c_pps a=5U2/TfBw33PfA2YBhd8Q5Q==:117 a=6eWqkTHjU83fiwn7nKZWdM+Sl24=:19 a=z/mQ4Ysz8XfWz/Q5cLBRGdckG28=:19 a=lCpzRmAYbLLaTzLvsPZ7Mbvzbb8=:19 a=xqWC_Br6kY4A:10 a=IkcTkHD0fZMA:10 a=zJRp6_cAMcgA:10 a=VkNPw1HP01LnGYTKEx00:22 a=bi6dqmuHe4P4UrxVR6um:22 a=fTW__CHxibyLmBMfj2wP:22 a=NEAV23lmAAAA:8 a=ei4SEBeUAAAA:8 a=t7CeM3EgAAAA:8 a=psDUkV7eLCA45ejDN5cA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=8zIOOLb7Ym0NljyPXbuS:22 a=FdTzh2GWekK77mhwV6Dw:22 X-Proofpoint-GUID: ORZHBVCTDaTN_16-wIAF8PEBMsacw1Xq X-Proofpoint-Spam-Info: AW1haW4tMjYxMTA1MDA0NSBTYWx0ZWRfXxvsafXFjGYY9 JxuOtaLFqx1HwUeEnc3VUsv/Z8QbdZoaIIZf2RIzAEBu47ZPLnbDe/XE9JL0JxbWPQ+oEoXVQUs JdT23W9piGPs3o5zgLGEkw4Os2TAPeW8wW1jLFmntCd/+O7c1zOr X-Proofpoint-ORIG-GUID: wPWMeZGrH9rWtg0l57Q-oaZSaF70If7p X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMTA1MDA0NSBTYWx0ZWRfX3XxoJOl9Y1CS P/xoaCEfTXEIs5iPNTGO39EDmQe32LmMH3QaNGelQ2RPnE7O4lJDn9fZ5oRhQ9DwDbzxH/4Nzcu cNdfP7bgcABgNi1Am8RKDjeBwpxF3QeLWsgrIma337Iw71l4pJbGSHeRPCUylflhMalXDZVb09u dzJOOxkrOmHwlF5oTZkwGy4CBddFIJNs+Z6617/v2sU9kC4rYgQDWRmCpEfJrPJ6ObZLyVbak4J XRJAVwgs4UM5DdKQXSzM/okYYEB/5+xBeHSepMoA4xm0dkwnQpNmzpppOSuvgPZ4cR4p5f5kZjN O9s9S+sn3TYeycBONpNHNXNcwQrf0lXsNcAI70LbtudnHgmysqkCxQrtKS/lBFNotiT50oAY6Mf dp53gBZnM64YiCU/nabk+SniX12yX/w5HOomYqu0CFIHy+ZSrfaB64f1GuRVXQCyDjzLO9QnGm3 2gnl1NnWf+masF7toGA== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.138,FMLib:17.12.100.49 definitions=2026-11-05_03,2026-11-04_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 phishscore=0 adultscore=0 clxscore=1015 lowpriorityscore=0 priorityscore=1501 impostorscore=0 spamscore=0 malwarescore=0 bulkscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2610300000 definitions=main-2611050045 X-MIME-Autoconverted: from 8bit to quoted-printable by mx0a-0064b401.pphosted.com id 6A59uOTm1187682 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 ; Thu, 05 Nov 2026 11:32:42 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/249540 From: Sunil Dora On the autobuilder the rust-rustdoc and librust-lib-example packages were not reproducible between the x86_64 and the aarch64 workers. Every symbol of librustdoc had a different hash on the aarch64 host, nothing else in the package was different. The reason is in how cargo computes -C metadata for a crate. It mixes in the -C metadata of all the dependencies of the crate, including the build script and the proc-macros. Those are built for the build host, so their dependency tree can differ from one host to another. For rustdoc the build script depends on sha2 -> cpufeatures, and cpufeatures pulls in libc only on aarch64-linux. That one extra crate changes the hash of the build script, from there the hash of librustdoc itself, and with it every symbol in it. Carry the fix sent upstream (rust-lang/cargo#17522)[1]: for a target unit, host-kind dependencies contribute only their package id to -C metadata instead of their full hash. They are not linked into the target artifact anyway, so nothing is lost. unit_id, -C extra-filename and fingerprints are not touched, so file names and rebuild decisions stay as they are. Host units and builds without --target are not affected. The upstream discussion is in rust-lang/cargo#8140[2]. The PR is still a draft, the cargo team would rather solve this as part of a bigger rework of fingerprinting (rust-lang/cargo#17439)[3], so we may have to carry this for some time. Drop it on the rust upgrade that has the fix. [YOCTO #16376] [1] https://github.com/rust-lang/cargo/pull/17522/ [2] https://github.com/rust-lang/cargo/issues/8140 [3] https://github.com/rust-lang/cargo/issues/17439 Signed-off-by: Sunil Dora --- ...ps-out-of-the-target-C-metadata-hash.patch | 123 ++++++++++++++++++ meta/recipes-devtools/rust/rust-source.inc | 1 + 2 files changed, 124 insertions(+) create mode 100644 meta/recipes-devtools/rust/files/0006-cargo-keep-host-deps-out-of-the-target-C-metadata-hash.patch diff --git a/meta/recipes-devtools/rust/files/0006-cargo-keep-host-deps-out-of-the-target-C-metadata-hash.patch b/meta/recipes-devtools/rust/files/0006-cargo-keep-host-deps-out-of-the-target-C-metadata-hash.patch new file mode 100644 index 0000000000..5e796b0164 --- /dev/null +++ b/meta/recipes-devtools/rust/files/0006-cargo-keep-host-deps-out-of-the-target-C-metadata-hash.patch @@ -0,0 +1,123 @@ +From f936d6a954455eff3a60968d155852f9de730228 Mon Sep 17 00:00:00 2001 +From: Sunil Dora +Date: Sun, 27 Sep 2026 08:47:23 +0530 +Subject: [PATCH] fix(compile): Keep host deps out of the target `-C metadata` + hash + +A target unit's `-C metadata` mixed in the `c_metadata` of its +host-kind dependencies (build scripts, proc-macros). Their dependency +graph depends on the host `cfg`, e.g. `cpufeatures` pulls in `libc` +only on aarch64-linux, so the build host leaked into the symbols of +cross-compiled crates such as rustdoc. + +Host-kind dependencies are not linked into the target artifact, so use +their package id instead. `unit_id`, `-C extra-filename` and +fingerprints are unchanged, as are host units and builds without +`--target`. The upstream PR also adds a testsuite test that fakes the +reported host; it is not carried here. + +Upstream-Status: Submitted [https://github.com/rust-lang/cargo/pull/17522] +Signed-off-by: Sunil Dora +--- + +diff --git a/src/tools/cargo/src/compiler/build_runner/compilation_files.rs b/src/tools/cargo/src/compiler/build_runner/compilation_files.rs +index 593e57e..63855f3 100644 +--- a/src/tools/cargo/src/compiler/build_runner/compilation_files.rs ++++ b/src/tools/cargo/src/compiler/build_runner/compilation_files.rs +@@ -89,6 +89,8 @@ impl fmt::Debug for UnitHash { + /// mangled symbols need to be stable between different builds with different + /// settings. For example, profile-guided optimizations need to swap + /// `RUSTFLAGS` between runs, but needs to keep the same symbol names. ++/// Likewise a target unit only mixes the package id of its host-kind ++/// dependencies into `c_metadata`, see `compute_metadata`. + #[derive(Copy, Clone, Debug)] + pub struct Metadata { + unit_id: UnitHash, +@@ -744,7 +746,7 @@ fn compute_metadata( + let deps_metadata = build_runner + .unit_deps(unit) + .iter() +- .map(|dep| *metadata_of(&dep.unit, build_runner, metas)) ++ .map(|dep| (&dep.unit, *metadata_of(&dep.unit, build_runner, metas))) + .collect::>(); + let c_extra_filename = use_extra_filename(bcx, unit); + let pkg_dir = use_pkg_dir(bcx, unit); +@@ -843,16 +845,28 @@ fn compute_metadata( + + let mut c_metadata_hasher = shared_hasher.clone(); + // Mix in the target-metadata of all the dependencies of this target. ++ // Host-kind deps of a target unit (build scripts, proc-macros) are not ++ // linked into it, and their metadata depends on the build host, so use ++ // a host independent stand-in for them (rust-lang/cargo#8140). + let mut dep_c_metadata_hashes = deps_metadata + .iter() +- .map(|m| m.c_metadata) ++ .map(|(dep, m)| { ++ if !unit.kind.is_host() && dep.kind.is_host() { ++ host_independent_c_metadata(dep, ws_root) ++ } else { ++ m.c_metadata ++ } ++ }) + .collect::>(); + dep_c_metadata_hashes.sort(); + dep_c_metadata_hashes.hash(&mut c_metadata_hasher); + + let mut unit_id_hasher = shared_hasher.clone(); + // Mix in the target-metadata of all the dependencies of this target. +- let mut dep_unit_id_hashes = deps_metadata.iter().map(|m| m.unit_id).collect::>(); ++ let mut dep_unit_id_hashes = deps_metadata ++ .iter() ++ .map(|(_, m)| m.unit_id) ++ .collect::>(); + dep_unit_id_hashes.sort(); + dep_unit_id_hashes.hash(&mut unit_id_hasher); + // Avoid trashing the caches on RUSTFLAGS changing via `unit_id` +@@ -884,6 +898,15 @@ fn compute_metadata( + } + } + ++/// Stand-in `c_metadata` for a host-kind dependency of a target unit: ++/// only the dependency's package id, see `compute_metadata`. ++fn host_independent_c_metadata(dep: &Unit, ws_root: &Path) -> UnitHash { ++ let mut hasher = StableHasher::new(); ++ METADATA_VERSION.hash(&mut hasher); ++ dep.pkg.package_id().stable_hash(ws_root).hash(&mut hasher); ++ UnitHash(Hasher::finish(&hasher)) ++} ++ + /// HACK: Detect the *potential* presence of `--remap-path-prefix` + /// + /// As CLI parsing is contextual and dependent on the CLI definition to understand the context, we +diff --git a/src/tools/cargo/src/compiler/fingerprint/mod.rs b/src/tools/cargo/src/compiler/fingerprint/mod.rs +index 172165d..d7f1e55 100644 +--- a/src/tools/cargo/src/compiler/fingerprint/mod.rs ++++ b/src/tools/cargo/src/compiler/fingerprint/mod.rs +@@ -74,7 +74,7 @@ + //! `TargetKind` (bin/lib/etc.) | ✓ | ✓ | ✓ + //! Enabled Features | ✓ | ✓ | ✓ + //! Declared Features | ✓ | | +-//! Immediate dependency’s hashes | ✓[^1] | ✓ | ✓ ++//! Immediate dependency’s hashes | ✓[^1] | ✓ | ✓[^9] + //! [`CompileKind`] (host/target) | ✓ | ✓ | ✓ + //! `__CARGO_DEFAULT_LIB_METADATA`[^4] | | ✓ | ✓ + //! `__CARGO_RUSTC_BOOTSTRAP_WS_REMAP`[^2] | ✓ | | +@@ -91,7 +91,7 @@ + //! `[lints.rust.unexpected_cfgs.check-cfg]` | ✓ | | + //! `--extern priv:` | ✓ | | + //! +-//! [^1]: Bin dependencies are not included. ++//! [^1]: Bin dependencies other than artifact dependencies are not included. + //! + //! [^2]: `__CARGO_RUSTC_BOOTSTRAP_WS_REMAP` is set by rustc bootstrap + //! to customize remap-path-prefix +@@ -111,6 +111,9 @@ + //! + //! [^8]: including `-Cextra-filename` + //! ++//! [^9]: For a target-kind unit, host-kind dependencies (build scripts, ++//! proc-macros) contribute only their `package_id`. ++//! + //! When deciding what should go in the Metadata vs the Fingerprint, consider + //! that some files (like dylibs) do not have a hash in their filename. Thus, + //! if a value changes, only the fingerprint will detect the change (consider, diff --git a/meta/recipes-devtools/rust/rust-source.inc b/meta/recipes-devtools/rust/rust-source.inc index b384a0c76e..42d45a1ca6 100644 --- a/meta/recipes-devtools/rust/rust-source.inc +++ b/meta/recipes-devtools/rust/rust-source.inc @@ -8,6 +8,7 @@ SRC_URI += "https://static.rust-lang.org/dist/rustc-${RUST_VERSION}-src.tar.xz;n file://0003-bootstrap-skip-StdarchVerify-when-remote-testing.patch;patchdir=${RUSTSRC} \ file://0004-cargo-omit-host-triple-from-unit-metadata-hash.patch;patchdir=${RUSTSRC} \ file://0005-rustc-span-make-hygiene-encoding-order-deterministic.patch;patchdir=${RUSTSRC} \ + file://0006-cargo-keep-host-deps-out-of-the-target-C-metadata-hash.patch;patchdir=${RUSTSRC} \ " SRC_URI[rust.sha256sum] = "6451598a99e77f07571960f6b21d577399d3a30f33e80cbd2e3a4aae6535d265" From patchwork Thu Nov 5 11:32:02 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Dora, Sunil Kumar" X-Patchwork-Id: 103116 Received: from mx0b-0064b401.pphosted.com (mx0b-0064b401.pphosted.com [205.220.178.238]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.32436.1793878353491142116 for ; Thu, 05 Nov 2026 03:32:33 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@windriver.com header.s=PPS06212021 header.b=QfpxVKhp; spf=permerror, err=parse error for token &{10 18 %{ir}.%{v}.%{d}.spf.has.pphosted.com}: invalid domain name (domain: windriver.com, ip: 205.220.178.238, mailfrom: prvs=576967b061=sunilkumar.dora@windriver.com) Received: from pps.filterd (m0250812.ppops.net [127.0.0.1]) by mx0a-0064b401.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6A59uQCw1187692 for ; Thu, 5 Nov 2026 11:32:32 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=windriver.com; h=cc:content-transfer-encoding:content-type:date:from :in-reply-to:message-id:mime-version:references:subject:to; s= PPS06212021; bh=D6I0z1gqqJ52SIlmea6yoWr/ThCmChdtiZC9yo5Q3hQ=; b= QfpxVKhpWhPTuBmBDY5lrz0GuamQliGzMjbQUxKFUMMRYGqaIorqx5uJ0AGOrYn5 /T9YeuyCwuRvKvcwCXQYv5DrjOc+6Lg1iChaF6FYtPOu1MdgG9rYyOmb+fkfufcC RCiRERLYhonFUdz0COPGez7cr41rljcXfMqlhPmfPaSTXx9CXV2yyq9J/Ojs1UzJ vPBCTTKiZn8AC6ZAPzDPUIFYye0v0vN7ke3dxOVwUT+j1fPJEVgHxckbCa10tgHg u4dNzuJT6Sw5UlWNB4lOBXJAzuMjT9u95/FZFLcR9WwvtSlT/yoVKk0roXNuoW3o 5bqpJdZTsD6rLKYquEgLUQ== Received: from mw6pr02cu001.outbound.protection.outlook.com (mail-westus2azon11022130.outbound.protection.outlook.com [52.101.48.130]) by mx0a-0064b401.pphosted.com (PPS) with ESMTPS id 4hram4hnn8-4 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Thu, 05 Nov 2026 11:32:31 +0000 (GMT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=PkODLVbrGCfz4nrPoIln56i/ULI0FfZpe/NxmVxLiSnb6nCFIRtYIH89CvM97x25ASdwPb9C4YB686KuQbUT2LvPYYXEKULPz3FpA1Crmt9xTCmaNnRIz7me2O1a8H9v/pgUJLg7YEi312C7u3wOXFo9joEjEBVVfpkscyaviNFPYXO9fYUcoh4lgcnOsKC0JIPFpq6q+iZfI4hkFuVVRBH6DnKDjpAg5o8Arq375CZSyGtbLlLMbIZIkxvYmas649kdF6tV1g35p3/nUKMy859Dco6c8a5K1JE7P0Nc0rHx5itMtmjb6ptXJUrvrKeJhVwfNHetDc5IrUscoLyrdg== 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=D6I0z1gqqJ52SIlmea6yoWr/ThCmChdtiZC9yo5Q3hQ=; b=mEZZzJoyaidZfJHw3KmaWIgnsm0MgFijfQvpkBIOS+g8Ss9q/ufDxZOxnpr/t1fywgVgKuqNsxIr6ioZCXq5zSRvylJntc1QEy6NzWP1jB6910qosUqDEGYyxUqAhctNCOVnZuCT746+Svxe1EeTOAYgbA9IbNiLTrFBpeKqB81emWE+A06eceH4TvYXO35Dc/9u6O9Uul8m4EaVxaM61WDfvIkEvls/tzfqdG8G0SluXyHSrX4G0h6iOKhkbpG7bWUIGRjH0v6+6/0NtkX48E8Xplux6auEzOolK06OkcnqUW0WronBd9RJtsPEwkKmljL5pdvyBvz+mrJR90OAJg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=windriver.com; dmarc=pass action=none header.from=windriver.com; dkim=pass header.d=windriver.com; arc=none Authentication-Results: mx.microsoft.com 1; dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=windriver.com; Received: from DS0PR11MB7901.namprd11.prod.outlook.com (2603:10b6:8:f4::20) by DS0PR11MB7802.namprd11.prod.outlook.com (2603:10b6:8:de::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.592.8; Thu, 5 Nov 2026 11:32:28 +0000 Received: from DS0PR11MB7901.namprd11.prod.outlook.com ([fe80::4293:7c4b:a0b5:eb5f]) by DS0PR11MB7901.namprd11.prod.outlook.com ([fe80::4293:7c4b:a0b5:eb5f%3]) with mapi id 15.21.0592.007; Thu, 5 Nov 2026 11:32:28 +0000 From: sunilkumar.dora@windriver.com To: openembedded-core@lists.openembedded.org Cc: richard.purdie@linuxfoundation.org, alejandro@enedino.org, sundeep.kokkonda@windriver.com, Randy.MacLeod@windriver.com, sunilkumar.dora@windriver.com Subject: [PATCH 3/3] cargo-c: keep host-kind dependency metadata out of target -C metadata Date: Thu, 5 Nov 2026 03:32:02 -0800 Message-ID: <20261105113205.1571267-4-sunilkumar.dora@windriver.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20261105113205.1571267-1-sunilkumar.dora@windriver.com> References: <20261105113205.1571267-1-sunilkumar.dora@windriver.com> X-ClientProxiedBy: SJ0PR03CA0131.namprd03.prod.outlook.com (2603:10b6:a03:33c::16) To DS0PR11MB7901.namprd11.prod.outlook.com (2603:10b6:8:f4::20) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR11MB7901:EE_|DS0PR11MB7802:EE_ X-MS-Office365-Filtering-Correlation-Id: cdb77a7d-3f3c-47c5-ee54-08df3b307890 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|23010399003|376014|52116014|366016|1800799024|38350700014|260925022911599003|260925021911599003|261102123227099003|260925021311599003|56012099006|261021121427099003|11063799006|261009223027099003|261026121527099003|10067099003|22082099003|18002099003|6133799003|13003099007; X-Microsoft-Antispam-Message-Info: jdVzl5uWeDFMgCjHI1y5nRfWlPsyIyLjyQjI+2BdKFHrQJ/NmmNksvKW1r6iWu5j5b2VYkNxAvmS5ikNOYT7aIeWbiwBb7g11S7wuXoUPaC6sEzv1ztIDwz0YaMYjUq1wutlEuAR553Pl9tTdkCW+Xi4VQX/WAMDhy1IDn3oIfq94Hky/rUUIlyceUjKDvI7o+T4rx0g1NuYoj1PtzzXh2vLyziBP23kJaKpY09pct4haA7veXQ7C1JFdMh+dbc6TTvnWM8yKDAAxS+3QOYZ172JXyd80oWVg0pWv8pNlXJ5HnWoEEIqV05H8om2AvagOWV0uPNCVvl5DjXqMMGgutmLQIIygSRTBno72kXlx0z1g0g5TuIf7mtzmJyz3+eAetPGQCVBswl9pRi0YutklK3vsSx7bfLzV2U1l/ozHIDIs2j8XdHEihfDZ8ZmdBqgI1OO5GDIXagONU8BGXB5IlpCqaq4SNx5PhZWwRaoqFIz8v+c9yxWzCV0upAM8ahKDEUVKMNZv5SXlQseu/49hOt6gynaRTDwweGZ+qKEd7MDsQOD/gG2YEst0hNJEiDbXHNLjC/FtzgTdsxkAwEmvMEeb/lqK+JsPQywZM2okNnB7pAhD1Bblom48GGmFaP628HYuD2P6ZDV3cE8Oc8aVZIuc/+fh6HjrQgz60oFEYLt1Zl8NvXku2QfCRxvJ+EVB+QpUNGWBxayB/L0REwLAsLxN8LMiqwmMoD5DZ8r/o8= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DS0PR11MB7901.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(23010399003)(376014)(52116014)(366016)(1800799024)(38350700014)(260925022911599003)(260925021911599003)(261102123227099003)(260925021311599003)(56012099006)(261021121427099003)(11063799006)(261009223027099003)(261026121527099003)(10067099003)(22082099003)(18002099003)(6133799003)(13003099007);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?QjuJM9huFpGlsW4SaLPLVh+Q/JZM?= =?utf-8?q?2jT4OQA+e5m6CJixRXnxNbcFmsshtVxC/+BPKRgBl8P7e9vTsjVgBCMJezFZjCSnw?= =?utf-8?q?kf73GVAF49v6IzA0AAs2jDgVczMaKIPvjFA4RRD630Ewi6Uc4DxDi9Z52gXxeZKAi?= =?utf-8?q?V1+Sg/6hTA+rdc2G5r92pERiZmVv0X9OiUP5KcJdYPcswHs+DD//ckFbTbm75Buy1?= =?utf-8?q?xP2AzIHXfEYW4JjHsy2NegD8lsAK485kMZ+GNdkArx+U7Hbhsywq06DpZZxxCYMZq?= =?utf-8?q?P9O9vASoNCZd7mwzl/jwRKRuNVqgKvgy2LE1XqEQYfAqz/Bbwz3WhOQAGH+2glQFE?= =?utf-8?q?sD344Tr28B+oHxMQhhnJyzENLnY8nvOwOE/Q6ODTSMBBvx56WmbD/YhWx2+yBasUj?= =?ut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?q?mzmYepXOQvLRmCzjrYAY4vjRsotKLjMUZzVWI8bLZo8mR0RUB94380yWWWr0Kpqjx?= =?utf-8?q?bnrIGMB1YwnJNbLn/cJOvmr8hAD0BK9lj7EaE3G+IzTQ7VVJTpzJnBFjcoUF5A3od?= =?utf-8?q?F+pw/O+60E2yvBg0Dc4leXH3eBeoZO8Rhc4NrmnfITwGJTcRrGcHutyS5znUFO0xI?= =?utf-8?q?Cuw4BKbbTWhAK+DDgl5WRjSBPouga8y5GK2MFflAM63N6D7jgaOcf9XBHzFeLa/Uf?= =?utf-8?q?i9wYOGmJqETTLbwaJBYTV4hFm+3HCu4lrZ9ZlISOPG3aVVekNhqiQDVsPBz1kEJ5Y?= =?utf-8?q?4aLDNGJO0+bwQlynzmAPaXDLMKjhDPM9Uvkk8w6T+1wbPteGB5jBjX2Rkb5BczY9w?= =?utf-8?q?GDkmMptWFjdrLnw4zyre/fqtXVMaE7MxOkYGOcxJeTWRgHaCc6H34=3D?= X-Exchange-RoutingPolicyChecked: rVXwXNyZ+80z3TQi3Npm7VoHuoV47rQ4wqLglvovIdV5ovMUHQa5ltWE0JNfpZHKAymuMvPu0I/14LoSa0LmbvSPkBenDpdOpARqcJjlW91mKJP3o24aCIom/+KDRsN4ole1tGWXjRcK5Uy8v44QyjEEdnbMtRuXnIw973ZhVKlbA0AYOdGuAB1QrlPt+IcEc8zX52XtSXFLlZS0V7E1pJZ/QhLpf+cb2R0fx74hisj9Jy0zCH6mpztpYO6nHrjTgN55MnFgaN4LynzYTn+kFOyFhKc8O7EYV7oVBeOli/k9L+f5bUIRzN//kR/+PERnoJGdY1WWabddGjbXJ9scTg== X-OriginatorOrg: windriver.com X-MS-Exchange-CrossTenant-Network-Message-Id: cdb77a7d-3f3c-47c5-ee54-08df3b307890 X-MS-Exchange-CrossTenant-AuthSource: DS0PR11MB7901.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Nov 2026 11:32:27.8062 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8ddb2873-a1ad-4a18-ae4e-4644631433be X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 5NgU2uxwx83AXULNOZ87Tdu1iPZCtzVbl5/EviGSlQ72GRsrEESO6WxzSxk9tmfXoUsgaOb9EhmFlBIqX38PBYsXLToG053agBnObjhDVzo= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR11MB7802 X-Proofpoint-Reinject: loops=2 maxloops=12 X-Authority-Analysis: v=2.4 cv=cpMOAF4i c=1 sm=1 tr=0 ts=6aec6950 cx=c_pps a=5U2/TfBw33PfA2YBhd8Q5Q==:117 a=6eWqkTHjU83fiwn7nKZWdM+Sl24=:19 a=z/mQ4Ysz8XfWz/Q5cLBRGdckG28=:19 a=lCpzRmAYbLLaTzLvsPZ7Mbvzbb8=:19 a=xqWC_Br6kY4A:10 a=IkcTkHD0fZMA:10 a=zJRp6_cAMcgA:10 a=VkNPw1HP01LnGYTKEx00:22 a=bi6dqmuHe4P4UrxVR6um:22 a=fTW__CHxibyLmBMfj2wP:22 a=NEAV23lmAAAA:8 a=t7CeM3EgAAAA:8 a=gVYdgmCXAPvokO4GIiEA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=FdTzh2GWekK77mhwV6Dw:22 X-Proofpoint-GUID: JpD3A7MY3L3SD1BORcRtOPrN1aLI9owT X-Proofpoint-Spam-Info: AW1haW4tMjYxMTA1MDA0NSBTYWx0ZWRfX5ec+JUnpG0g9 CxQW/FWxD4HXsuLC9fFPmknjxYLTZ6AQ8IZ6Rok5hAnch5VRhmR8gUVOGJYbPzRK6pDCZS0BNmo liW3JpoLDT6FYUhOY+4IUc2Hj9XL01G7wv2vdhM0ZiyGP8owLPf0 X-Proofpoint-ORIG-GUID: TMROmLs731S_qzDCzz21o11PlpQWAkbM X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMTA1MDA0NSBTYWx0ZWRfX4jdSAzIaK2rK hYW9UTbqO4McC6+NPt4D8pj6kLu1H3NOXNsg3UyPk3995lMSmKMQv6n+8wgzb4I4O35wzxDby1C no3aR0no8VjT76PPZ1RDlHc/STrA05t5p+ibkEYPWJumW0qdoDT3J7JSAUTPWHZq83HkMKJIN4f JOzOl3joXNpVzTkriGCOkR+9kK2Klu1Q9K8yAHgFPxYlQG4ENcap0iprYk7BqgN3pLgfTdIgKxs nviA7F01xy1oNPNBgKJYzEVJneAnmfCV5ADtp4/JDX/HST9pFI6WzlfuWRCYV73KvZLHoaHA+7p EeTZz9Gw/pleen+/k9zyyLMWQAArvSUKkPItcaSuRLKe28B5ddF6Dvd+HgGuzc4Qsy19LwNrFoF CJKZj0LPfMcoFXmPdWquTFJ8+llbz87pbtSagJBotlUS+KraNGQZzZ7jhVaGSRzvmSdR8GHfduS g6hoQxIpSpfUGAag/Uw== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.138,FMLib:17.12.100.49 definitions=2026-11-05_03,2026-11-04_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 phishscore=0 adultscore=0 clxscore=1015 lowpriorityscore=0 priorityscore=1501 impostorscore=0 spamscore=0 malwarescore=0 bulkscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2610300000 definitions=main-2611050045 X-MIME-Autoconverted: from 8bit to quoted-printable by mx0a-0064b401.pphosted.com id 6A59uQCw1187692 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 ; Thu, 05 Nov 2026 11:32:41 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/249541 From: Sunil Dora Same fix as rust/files/0006-cargo-keep-host-deps-*.patch (rust-lang/cargo#17522)[1], for the cargo crate that cargo-c links. Without it cargo-cbuild still mixes the hashes of the host side dependencies (build script, proc-macros) into the -C metadata of target crates, so the symbol names depend on the build host. Only the paths differ from the rust copy. Drop this together with rust/files/0006-cargo-keep-host-deps-*.patch. [YOCTO #16376] [1] https://github.com/rust-lang/cargo/pull/17522/ Signed-off-by: Sunil Dora --- ...ps-out-of-the-target-C-metadata-hash.patch | 123 ++++++++++++++++++ .../cargo-c/cargo-c_0.10.26+cargo-0.100.0.bb | 1 + 2 files changed, 124 insertions(+) create mode 100644 meta/recipes-devtools/cargo-c/cargo-c/0003-cargo-keep-host-deps-out-of-the-target-C-metadata-hash.patch diff --git a/meta/recipes-devtools/cargo-c/cargo-c/0003-cargo-keep-host-deps-out-of-the-target-C-metadata-hash.patch b/meta/recipes-devtools/cargo-c/cargo-c/0003-cargo-keep-host-deps-out-of-the-target-C-metadata-hash.patch new file mode 100644 index 0000000000..a3caaa609e --- /dev/null +++ b/meta/recipes-devtools/cargo-c/cargo-c/0003-cargo-keep-host-deps-out-of-the-target-C-metadata-hash.patch @@ -0,0 +1,123 @@ +From f936d6a954455eff3a60968d155852f9de730228 Mon Sep 17 00:00:00 2001 +From: Sunil Dora +Date: Sun, 27 Sep 2026 08:47:23 +0530 +Subject: [PATCH] fix(compile): Keep host deps out of the target `-C metadata` + hash + +A target unit's `-C metadata` mixed in the `c_metadata` of its +host-kind dependencies (build scripts, proc-macros). Their dependency +graph depends on the host `cfg`, e.g. `cpufeatures` pulls in `libc` +only on aarch64-linux, so the build host leaked into the symbols of +cross-compiled crates such as rustdoc. + +Host-kind dependencies are not linked into the target artifact, so use +their package id instead. `unit_id`, `-C extra-filename` and +fingerprints are unchanged, as are host units and builds without +`--target`. The upstream PR also adds a testsuite test that fakes the +reported host; it is not carried here. + +Upstream-Status: Submitted [https://github.com/rust-lang/cargo/pull/17522] +Signed-off-by: Sunil Dora +--- + +diff --git a/src/compiler/build_runner/compilation_files.rs b/src/compiler/build_runner/compilation_files.rs +index 593e57e..63855f3 100644 +--- a/src/compiler/build_runner/compilation_files.rs ++++ b/src/compiler/build_runner/compilation_files.rs +@@ -89,6 +89,8 @@ impl fmt::Debug for UnitHash { + /// mangled symbols need to be stable between different builds with different + /// settings. For example, profile-guided optimizations need to swap + /// `RUSTFLAGS` between runs, but needs to keep the same symbol names. ++/// Likewise a target unit only mixes the package id of its host-kind ++/// dependencies into `c_metadata`, see `compute_metadata`. + #[derive(Copy, Clone, Debug)] + pub struct Metadata { + unit_id: UnitHash, +@@ -744,7 +746,7 @@ fn compute_metadata( + let deps_metadata = build_runner + .unit_deps(unit) + .iter() +- .map(|dep| *metadata_of(&dep.unit, build_runner, metas)) ++ .map(|dep| (&dep.unit, *metadata_of(&dep.unit, build_runner, metas))) + .collect::>(); + let c_extra_filename = use_extra_filename(bcx, unit); + let pkg_dir = use_pkg_dir(bcx, unit); +@@ -843,16 +845,28 @@ fn compute_metadata( + + let mut c_metadata_hasher = shared_hasher.clone(); + // Mix in the target-metadata of all the dependencies of this target. ++ // Host-kind deps of a target unit (build scripts, proc-macros) are not ++ // linked into it, and their metadata depends on the build host, so use ++ // a host independent stand-in for them (rust-lang/cargo#8140). + let mut dep_c_metadata_hashes = deps_metadata + .iter() +- .map(|m| m.c_metadata) ++ .map(|(dep, m)| { ++ if !unit.kind.is_host() && dep.kind.is_host() { ++ host_independent_c_metadata(dep, ws_root) ++ } else { ++ m.c_metadata ++ } ++ }) + .collect::>(); + dep_c_metadata_hashes.sort(); + dep_c_metadata_hashes.hash(&mut c_metadata_hasher); + + let mut unit_id_hasher = shared_hasher.clone(); + // Mix in the target-metadata of all the dependencies of this target. +- let mut dep_unit_id_hashes = deps_metadata.iter().map(|m| m.unit_id).collect::>(); ++ let mut dep_unit_id_hashes = deps_metadata ++ .iter() ++ .map(|(_, m)| m.unit_id) ++ .collect::>(); + dep_unit_id_hashes.sort(); + dep_unit_id_hashes.hash(&mut unit_id_hasher); + // Avoid trashing the caches on RUSTFLAGS changing via `unit_id` +@@ -884,6 +898,15 @@ fn compute_metadata( + } + } + ++/// Stand-in `c_metadata` for a host-kind dependency of a target unit: ++/// only the dependency's package id, see `compute_metadata`. ++fn host_independent_c_metadata(dep: &Unit, ws_root: &Path) -> UnitHash { ++ let mut hasher = StableHasher::new(); ++ METADATA_VERSION.hash(&mut hasher); ++ dep.pkg.package_id().stable_hash(ws_root).hash(&mut hasher); ++ UnitHash(Hasher::finish(&hasher)) ++} ++ + /// HACK: Detect the *potential* presence of `--remap-path-prefix` + /// + /// As CLI parsing is contextual and dependent on the CLI definition to understand the context, we +diff --git a/src/compiler/fingerprint/mod.rs b/src/compiler/fingerprint/mod.rs +index 172165d..d7f1e55 100644 +--- a/src/compiler/fingerprint/mod.rs ++++ b/src/compiler/fingerprint/mod.rs +@@ -74,7 +74,7 @@ + //! `TargetKind` (bin/lib/etc.) | ✓ | ✓ | ✓ + //! Enabled Features | ✓ | ✓ | ✓ + //! Declared Features | ✓ | | +-//! Immediate dependency’s hashes | ✓[^1] | ✓ | ✓ ++//! Immediate dependency’s hashes | ✓[^1] | ✓ | ✓[^9] + //! [`CompileKind`] (host/target) | ✓ | ✓ | ✓ + //! `__CARGO_DEFAULT_LIB_METADATA`[^4] | | ✓ | ✓ + //! `__CARGO_RUSTC_BOOTSTRAP_WS_REMAP`[^2] | ✓ | | +@@ -91,7 +91,7 @@ + //! `[lints.rust.unexpected_cfgs.check-cfg]` | ✓ | | + //! `--extern priv:` | ✓ | | + //! +-//! [^1]: Bin dependencies are not included. ++//! [^1]: Bin dependencies other than artifact dependencies are not included. + //! + //! [^2]: `__CARGO_RUSTC_BOOTSTRAP_WS_REMAP` is set by rustc bootstrap + //! to customize remap-path-prefix +@@ -111,6 +111,9 @@ + //! + //! [^8]: including `-Cextra-filename` + //! ++//! [^9]: For a target-kind unit, host-kind dependencies (build scripts, ++//! proc-macros) contribute only their `package_id`. ++//! + //! When deciding what should go in the Metadata vs the Fingerprint, consider + //! that some files (like dylibs) do not have a hash in their filename. Thus, + //! if a value changes, only the fingerprint will detect the change (consider, diff --git a/meta/recipes-devtools/cargo-c/cargo-c_0.10.26+cargo-0.100.0.bb b/meta/recipes-devtools/cargo-c/cargo-c_0.10.26+cargo-0.100.0.bb index 37d6a59aca..be69393a7a 100644 --- a/meta/recipes-devtools/cargo-c/cargo-c_0.10.26+cargo-0.100.0.bb +++ b/meta/recipes-devtools/cargo-c/cargo-c_0.10.26+cargo-0.100.0.bb @@ -8,6 +8,7 @@ LIC_FILES_CHKSUM = " \ SRC_URI = "crate://crates.io/cargo-c/${PV};name=cargo-c \ file://0001-parking-lot-Use-libc-SYS_futex_time64-on-riscv32.patch;patchdir=../parking_lot_core-0.9.12/ \ file://0002-cargo-omit-host-triple-from-unit-metadata-hash.patch;patchdir=../cargo-0.100.0/ \ + file://0003-cargo-keep-host-deps-out-of-the-target-C-metadata-hash.patch;patchdir=../cargo-0.100.0/ \ " SRC_URI[cargo-c.sha256sum] = "5ff6e05531e58286d3c02ec0adb7f254e5d532a8d4b667f30b9942d802e1db25" S = "${CARGO_VENDORING_DIRECTORY}/cargo-c-${PV}"