From patchwork Wed Jul 29 04:47:11 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Varatharajan, Deepesh" X-Patchwork-Id: 93794 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 280DDC54F55 for ; Wed, 29 Jul 2026 04:47:50 +0000 (UTC) Received: from mx0b-0064b401.pphosted.com (mx0b-0064b401.pphosted.com [205.220.178.238]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.4470.1785300454312511923 for ; Tue, 28 Jul 2026 21:47:39 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@windriver.com header.s=PPS06212021 header.b=YEVRgaJk; 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=26709619c3=deepesh.varatharajan@windriver.com) Received: from pps.filterd (m0250811.ppops.net [127.0.0.1]) by mx0a-0064b401.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 66T4lXBS915002; Wed, 29 Jul 2026 04:47:33 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=windriver.com; h=cc:content-transfer-encoding:content-type:date:from :message-id:mime-version:subject:to; s=PPS06212021; bh=CGHBc6KlL NZGIZLhU2FYl8XVcpCxwrtkgF/h7eGWswk=; b=YEVRgaJk4GPubA6555S/ZIjEO sL2imdGJiELlOVWpruEe4zLP08XOJm4qPq+GAEiOIL4BHivjiK1aE9/9lM8ixVBx IRFaH/nOyEGa6ZQAA+zizxRK5h+8SUuQ9IFzv1VoxOkbrqcTcmqGfahb/T9N/5MD OfRkLaIP2Um+dfar/GkDqE8TdjykJckFVdUZs+v1jZ/xyDaITWWUn+bGBAGfpTwu dRaCFDpFdlu79WvhZ+N4b/PUOnTaCDlPkIFbr7Y9YzzFlMq2Gi9hBo9xBt14CxgZ /nql5tUS2S9Wse/neEhECejBedXQiV3Vy4UTsE064EdioCyDKZm9odQcYSKFw== Received: from bn1pr04cu002.outbound.protection.outlook.com (mail-eastus2azon11010016.outbound.protection.outlook.com [52.101.56.16]) by mx0a-0064b401.pphosted.com (PPS) with ESMTPS id 4fq8crg4kw-1 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Wed, 29 Jul 2026 04:47:32 +0000 (GMT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=bp7k8+21axerGGAISbWGWhRYCJ24oHKX8PFdYUTX2bIxJHsakDIwWcErr9GAnxDp5S0QQO7IIyyVFhg+vL6Z1LHQfBCH9zb+A72gwdM/oWl1xouvfAls8zFBR+M1U0t2NIEr89CptF4XYG4U0D4kvBeABbkGbAL07ZcIfgQFoNdvx0C+M3bxs52sQ/f7+VDWf85a4jIgj7C3VtokgRNHpTf7vHJBtitEx7Cqu09Wrc+LbuO3JB4Eze1WjoEHdYgEGdYNFEfCba82p0I0YIoUFgSaiBVHNopVD8qGVtgZ5w3/yGSznmuqIB8eJ6DUsNrbIQ8e4EMEuzh41Mtjp3/xMg== 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=CGHBc6KlLNZGIZLhU2FYl8XVcpCxwrtkgF/h7eGWswk=; b=d33mWeSMuNiJp+y5pMjD3dYvfoNn45VJh4xoAESaKuAvwhjqCOci+opp7C16jszcrBRex94aK2xg4LEtE6uutYTx5fTo1eQIrYovcUQLeZ+djr5tJ0CveRLVQBnKjjQrbc1KXypmNxLEAB6V4asZXgXMort+OhKVX4RJCLk326Y/fJJobUHQ7NynQdtm8WSBl3OEDXccK0Q/ws0sPB5ZIXI1/UdqyzxRA9lwAUFFRvdp/QHxCwBgtgpdEVelQlJIftDGfr5jqb6QJEf7Jdafc6CLvjsJBMG/WGke/ItAUPeZiv+Wmmgy9DF4Y7S/YNiM1AXVYgl17A9erdgT0+NOLw== 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 Received: from SN7PR11MB6677.namprd11.prod.outlook.com (2603:10b6:806:26b::6) by IA1PR11MB6242.namprd11.prod.outlook.com (2603:10b6:208:3e8::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.245.13; Wed, 29 Jul 2026 04:47:30 +0000 Received: from SN7PR11MB6677.namprd11.prod.outlook.com ([fe80::490a:519b:d657:99ab]) by SN7PR11MB6677.namprd11.prod.outlook.com ([fe80::490a:519b:d657:99ab%4]) with mapi id 15.21.0270.009; Wed, 29 Jul 2026 04:47:30 +0000 From: Deepesh.Varatharajan@windriver.com To: openembedded-core@lists.openembedded.org Cc: Sundeep.Kokkonda@windriver.com, Deepesh.Varatharajan@windriver.com, richard.purdie@linuxfoundation.org Subject: [PATCH v4 1/3] rust: Fix reproducibility with shared source trees Date: Tue, 28 Jul 2026 21:47:11 -0700 Message-ID: <20260729044714.1239545-1-Deepesh.Varatharajan@windriver.com> X-Mailer: git-send-email 2.49.0 X-ClientProxiedBy: BN1PR10CA0022.namprd10.prod.outlook.com (2603:10b6:408:e0::27) To SN7PR11MB6677.namprd11.prod.outlook.com (2603:10b6:806:26b::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN7PR11MB6677:EE_|IA1PR11MB6242:EE_ X-MS-Office365-Filtering-Correlation-Id: 8aeb75ee-e76b-4382-b9b0-08deed2c7eff X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|52116014|1800799024|23010399003|366016|376014|18002099003|10067099003|56012099006|11063799006|6133799003|12006099003|38350700014; X-Microsoft-Antispam-Message-Info: PXxb1M2c6ofWO70TY/n+E5I73oBf9L7minVJsyMmMk2x5NSfEb6B8+YmjWKXKnpao/KxacDecgCknprxCBefc8LHt9QA0scTEsYehg0vgQH2o/PKHinbSAWAVqkxxvSyEDzWFzjKuJ2DQbIiq+UWUYPQSWVQCxoOA4yszPM8wRaJiu0iaXtz5LDaOra7PotccKdWiAjB5si6eDAWlvqvC1BnKKYdluuQ/9NLdUGTxJAt0eSq44yoaz/FFQP2cDjrcabAEmOri9EORrc7yiJwvkyoIS2z9DkzAeMD9MY/rC+I/iF0XZYVB/O4Lm7Sf/UNWQZxqhIKfJW9iR8zWjBH/kSvDGP+rJrVDcAIPnXilLvZaRR9MvCYbUpmqSctBz38y/Dr/QmO2eKYbokGR4kQy1SMw/2ofFI3qgsF9ozyo7dDTbJdPSSXSFWjnwcXh4VvJyhpL6hqrcKObdIfn3RxCeOEKD90LeLyB7/2sxo2GVRx7r1F2Q3wvImWRBvsxeAWGkiPRtdyxb5UZ0hvLNhGVLn6oq2WSQW978JF60igCH8ijUYdcoumdDQH8B4Z5zsBlj5u+1aYMStxb/QNX7aJL+nnpce/i6aJ8O/CDIlE5/bZdq3DzhSuDngKeW+jWKnPBk8U6rBiTg5hsfdFiLLET5t1hOaR2IxRimrhSmMZSLs= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN7PR11MB6677.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(52116014)(1800799024)(23010399003)(366016)(376014)(18002099003)(10067099003)(56012099006)(11063799006)(6133799003)(12006099003)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: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5KakBjpOa+pZDQ== X-OriginatorOrg: windriver.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8aeb75ee-e76b-4382-b9b0-08deed2c7eff X-MS-Exchange-CrossTenant-AuthSource: SN7PR11MB6677.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jul 2026 04:47:29.9769 (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: utGMM2AErEUjnCTkFY6IkW2j97+d7djAqMeCspzwtoueUAtDAMdLQxwqZfsdvDdmQ1AtOrlMP+0KCm+R3zbd+XvL5TuzI/apAa80QZey6UEhC2aQeD5YyN+DFnUgQC9J X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR11MB6242 X-Proofpoint-Reinject: loops=2 maxloops=12 X-Proofpoint-ORIG-GUID: k7S8c2eztfxMYL_NrORjrHBxIVEcj4kv X-Proofpoint-GUID: 9yFj9TXhxsoaPbEmWqfdHelt6q63Aq2z X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzI5MDAzNiBTYWx0ZWRfX2Mwg1IIcXmyK DztVqd6AfpYIfD7JD5RH+GC8HjZfCwc4qjgFaMsiZQTZVtxcvq9xvpk/CZJMKiEG+srUmlp6+0P s8mDvVPoeO4uGs4J62nw527rCVRF7KTIJOSaTlwUfcOI7/BdH1Vpbpv3ymmcRxcFD9ZwKOy+Fgz lO0iq/jTlWUTlb4pqquvGf/PB1UWjuHA089dviurUadaiDhIzmirdH5rquqXGE4/WxW4Kottna0 UgiWjVScua/s1qg/0z2Dkc6LeyowYqQupPP/3oYsJXW6Ue99OPPXV8O9zj6GCdwgallT57ux2sY QjD+S4QgcmsPW+VPvwwL8dxmQgCrG8SXtZ4NUuGAzXpCP4qrtH9PbB8118wv2eZc2MeUCGUyWYs J6SEDi2Xaa6PIWOaM1+t943Z7okJD4kdLzeZSrzI53SgUmy1sDsek5kRoIeujyX85KApw3PKUhw Okr/hCs4cSu/dIzlgig== X-Proofpoint-Spam-Info: AW1haW4tMjYwNzI5MDAzNiBTYWx0ZWRfXxMZDP7Fy1i7G UeVZQ8tu8uvORj70/RUxUlYgz7HMzAPNzCYdZ+nF6gxSU0AQ19euCToLwu6wnd8d+WzN8MSTv8n K5JuIQFM9Fn1qe9h/MTbWTCF9hLa8ekN//3Cn7QSDeq+eiYB6q2/ X-Authority-Analysis: v=2.4 cv=GvByPE1C c=1 sm=1 tr=0 ts=6a6985e4 cx=c_pps a=DYD6gEfmkstUuBQ4PvrWrw==:117 a=6eWqkTHjU83fiwn7nKZWdM+Sl24=:19 a=z/mQ4Ysz8XfWz/Q5cLBRGdckG28=:19 a=lCpzRmAYbLLaTzLvsPZ7Mbvzbb8=:19 a=xqWC_Br6kY4A:10 a=RAioF0-LDSMA:10 a=VkNPw1HP01LnGYTKEx00:22 a=bi6dqmuHe4P4UrxVR6um:22 a=klDOsUkWDRETUCZYPvoE:22 a=NEAV23lmAAAA:8 a=ei4SEBeUAAAA:8 a=t7CeM3EgAAAA:8 a=XTdeb_U8USiAPbms4-gA:9 a=8zIOOLb7Ym0NljyPXbuS:22 a=FdTzh2GWekK77mhwV6Dw:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-07-29_02,2026-07-28_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 priorityscore=1501 impostorscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 lowpriorityscore=0 clxscore=1015 spamscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607290036 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, 29 Jul 2026 04:47:50 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/242228 From: Deepesh Varatharajan Backport an upstream Rust commit to fix a reproducibility issue when Rust family recipes share the same source tree. Signed-off-by: Deepesh Varatharajan --- ...ild-script-path-leakage-in-artifacts.patch | 28 +++++++++++++++++++ meta/recipes-devtools/rust/rust-source.inc | 1 + 2 files changed, 29 insertions(+) create mode 100644 meta/recipes-devtools/rust/files/0005-remap-OUT_DIR-paths-to-fix-build-script-path-leakage-in-artifacts.patch diff --git a/meta/recipes-devtools/rust/files/0005-remap-OUT_DIR-paths-to-fix-build-script-path-leakage-in-artifacts.patch b/meta/recipes-devtools/rust/files/0005-remap-OUT_DIR-paths-to-fix-build-script-path-leakage-in-artifacts.patch new file mode 100644 index 0000000000..8c93624df7 --- /dev/null +++ b/meta/recipes-devtools/rust/files/0005-remap-OUT_DIR-paths-to-fix-build-script-path-leakage-in-artifacts.patch @@ -0,0 +1,28 @@ +Backport a commit that remap OUT_DIR paths to fix build script path leakage in artifacts + +Upstream-Status: Backport [https://github.com/rust-lang/rust/commit/e743a4db62336027dcc1f1a755f4ca35f56b67df] + +Signed-off-by: Deepesh Varatharajan + +diff --git a/src/bootstrap/src/core/builder/cargo.rs b/src/bootstrap/src/core/builder/cargo.rs +index f785254..0264667 100644 +--- a/src/bootstrap/src/core/builder/cargo.rs ++++ b/src/bootstrap/src/core/builder/cargo.rs +@@ -1077,6 +1077,8 @@ impl Builder<'_> { + // rustc creates absolute paths (in part bc of the `rust-src` unremap + // and for working directory) so let's remap the build directory as well. + format!("{}={map_to}", self.build.src.display()), ++ // remap OUT_DIR so they don't leak into artifacts. ++ format!("{}={map_to}/out", self.build.out.display()), + ] + .join("\t"); + cargo.env("RUSTC_DEBUGINFO_MAP", map); +@@ -1097,6 +1099,8 @@ impl Builder<'_> { + // rustc creates absolute paths (in part bc of the `rust-src` unremap + // and for working directory) so let's remap the build directory as well. + format!("{}={map_to}", self.build.src.display()), ++ // remap OUT_DIR so they don't leak into artifacts. ++ format!("{}={map_to}/out", self.build.out.display()), + ] + .join("\t"); + cargo.env("RUSTC_DEBUGINFO_MAP", map); diff --git a/meta/recipes-devtools/rust/rust-source.inc b/meta/recipes-devtools/rust/rust-source.inc index a8d8de7165..5678e00671 100644 --- a/meta/recipes-devtools/rust/rust-source.inc +++ b/meta/recipes-devtools/rust/rust-source.inc @@ -9,6 +9,7 @@ SRC_URI += "https://static.rust-lang.org/dist/rustc-${RUST_VERSION}-src.tar.xz;n file://0002-Fix-rust-build-failure-with-unstable-options.patch;patchdir=${RUSTSRC} \ file://0003-explicit-tail-calls-disable-two-tests.patch;patchdir=${RUSTSRC} \ file://0004-explicit-tail-calls-ignore-tests-on-unsupported-llvm.patch;patchdir=${RUSTSRC} \ + file://0005-remap-OUT_DIR-paths-to-fix-build-script-path-leakage-in-artifacts.patch;patchdir=${RUSTSRC} \ " SRC_URI[rust.sha256sum] = "77a6ff3003a4ad0cb00697b043c879e3e1a15d945b1a1f63818903bfc3fa8b98" From patchwork Wed Jul 29 04:47:12 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Varatharajan, Deepesh" X-Patchwork-Id: 93795 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 41E26C53200 for ; Wed, 29 Jul 2026 04:47:50 +0000 (UTC) Received: from mx0a-0064b401.pphosted.com (mx0a-0064b401.pphosted.com [205.220.166.238]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.4472.1785300459860062337 for ; Tue, 28 Jul 2026 21:47:39 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@windriver.com header.s=PPS06212021 header.b=cgJGioRH; 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.166.238, mailfrom: prvs=26709619c3=deepesh.varatharajan@windriver.com) Received: from pps.filterd (m0250809.ppops.net [127.0.0.1]) by mx0a-0064b401.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 66T4gsbQ687273 for ; Tue, 28 Jul 2026 21:47:39 -0700 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=kpln9eYXxttDwPGe/U9eD31HovBcROBnDH9c2FEfPB0=; b= cgJGioRH4NxHkSLx10Rkm9B7rKgGlzTgQ6rrN1l7DvMFqDaFNWYOvRqkQu+KP7Ue Ag3hs37t4Or6nMXjiQeJp1EAvFrNfY9fjU5fkdPjIoa8ZROmOlg7pZAgFVS7ubZk kYejs2e5b+x0dSKCyn/gg2ESqWUpsG9r9c38lt4XAa+lmTXPfK//BZvHa/Y7s6QG 3ZUp3xWxfDnk8H76FicU+YMEivkSLA0gFSUETxaZVDTkvHLVg5Nye03yMHsAyMvR ETwtPSvRhdSk6tw467u5gNg2jD5MYH8o04taqGEpF6yBF+jIaVJKMfff3c4WNItL eqNNl3dphgO8oMxwwzyJ+A== Received: from dm5pr21cu001.outbound.protection.outlook.com (mail-centralusazon11011063.outbound.protection.outlook.com [52.101.62.63]) by mx0a-0064b401.pphosted.com (PPS) with ESMTPS id 4fq86nr5bw-1 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Tue, 28 Jul 2026 21:47:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=w8GM8sleiG9elHSl6hL7/oduYmv2Y9qG5OJY2/arLpT7tA57mv/w9ZVYIlra/v2yaXckyt/soVYxPYayitV5y3IRoUyhEREuvW/Q3+eCkHeM+J+vYfLKCqvWZpXDmW+sxgFD1899X0wdTuxhrMmmtbNm7mEDjdKtvvPp2XfoHpGOqmW4n98PRS32sgcGOn9h14N1CyCSRL1H2s51NaUwEyjsAHyjUl2ksxs5a83viZsawndtWWS7rMw+TRrU0+ORUCicvWXaKoGfx4GveiWN6nituWJeOyhdOe3lIGEG7UWjBFjY331wzoATJc5TSVRsjqotF1kgnDKnWfGh0vTNfA== 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=kpln9eYXxttDwPGe/U9eD31HovBcROBnDH9c2FEfPB0=; b=OYx7Z32lFTT58mI3iX2/2GpkyE4P39taore758uGoAlkGGPg8aAE65z9RQxlZ5AVLylmnt2vyXFKGSIagBMjOJDPOMNu+51iyEaVXUmDjq+rYW7FX34GbGTxm2F+qNFdXP3kBunMBK9N4Sb0/kOEWoyKfdVTlqDnk0nZl6m6R5BCHbWnqk0ubx0e9U0BmLaJljTCv0SFrctt/1HBa8ZnR3ozQUPigyfCpU60sahBJHAZvtxImQvboCDpCXkxePdwKIMlXyNBlGetDqseLCGc4vBH81q81E3AIn0/j9bbjhIJ24VkKoRECa3b5W/UCpVouWydNQxErAIftJig6g8GAg== 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 Received: from SN7PR11MB6677.namprd11.prod.outlook.com (2603:10b6:806:26b::6) by IA1PR11MB6242.namprd11.prod.outlook.com (2603:10b6:208:3e8::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.245.13; Wed, 29 Jul 2026 04:47:33 +0000 Received: from SN7PR11MB6677.namprd11.prod.outlook.com ([fe80::490a:519b:d657:99ab]) by SN7PR11MB6677.namprd11.prod.outlook.com ([fe80::490a:519b:d657:99ab%4]) with mapi id 15.21.0270.009; Wed, 29 Jul 2026 04:47:33 +0000 From: Deepesh.Varatharajan@windriver.com To: openembedded-core@lists.openembedded.org Cc: Sundeep.Kokkonda@windriver.com, Deepesh.Varatharajan@windriver.com, richard.purdie@linuxfoundation.org Subject: [PATCH v4 2/3] rust: refactor source handling into a shared work-shared recipe Date: Tue, 28 Jul 2026 21:47:12 -0700 Message-ID: <20260729044714.1239545-2-Deepesh.Varatharajan@windriver.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20260729044714.1239545-1-Deepesh.Varatharajan@windriver.com> References: <20260729044714.1239545-1-Deepesh.Varatharajan@windriver.com> X-ClientProxiedBy: BN1PR10CA0022.namprd10.prod.outlook.com (2603:10b6:408:e0::27) To SN7PR11MB6677.namprd11.prod.outlook.com (2603:10b6:806:26b::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN7PR11MB6677:EE_|IA1PR11MB6242:EE_ X-MS-Office365-Filtering-Correlation-Id: 1748c964-e3d4-4ff3-823d-08deed2c80c9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|52116014|1800799024|23010399003|366016|376014|18002099003|22082099003|5023799004|10067099003|56012099006|11063799006|3023799007|6133799003|12006099003|38350700014; X-Microsoft-Antispam-Message-Info: Afy83lidgrotAqP6PhhOZ6Y+MYjYIy9XcM4UCoZcNojcCSnU29MMoUqFbj0BxY3DqqY6nW7xuB4/5uArci2axjn+NUKEtCuLVKLypJSwQHo2ttxfQPajngBJudQlNKrKnHBCD33YJc2g6jldhrfoOuLJpOcYPgl0ruF168v5RFGZQIHhn6Nkk0V3slNmscMVBcCkAVbk3g95kOfUJtycS0/eEGFjH6rycB5Qr6QTU7E2voEQ1jRRb8VjyHCQ7v8pgiIxikdk3lk5j/BP9cRJtTzWb3j0/23pZNO7i7mg3ud/gERTKCUx+LQNIc8MGBozWxfHNokX+Zni7rzuJ1xajt/4MsjQIOUHmf67R1fZXwy3P2NbVQ5GcgaulyDo8j0R8js0k1/f7IIN0HTtRBZgeQMd5HzNbTiu5WcLYVDgOyrZKBMfFF8Nsvb+xNZ8W1sZ4op78CSWX0LRgcgwXJCaVRs/9DyFOMEbHC8zE9tFQNhUcP8tx1mKQH4mMOnm+dhzTtAby7L+3L6B9YyYu84QmJIAHl0Tv4wVRPo2KKLaZrexqgJN31wXakzaBLCxkjcm1QvQSh593BRkQgxpR/QGCaoJmGhRUPvTQLrpQq7TUnEBe3omQjjuHJ7T2uTePpCV3hy/Pz4ObTUEC0jwGPMl9ejdGB971mVnpk4KNZ+l7fI= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN7PR11MB6677.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(52116014)(1800799024)(23010399003)(366016)(376014)(18002099003)(22082099003)(5023799004)(10067099003)(56012099006)(11063799006)(3023799007)(6133799003)(12006099003)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?PlRnCAh1ZuKFSWRA1q/N8iZBoKUu?= =?utf-8?q?mquwafl/AsZz2rJRZbopuVh23RFhOi3hEDsK3uRrB8kt7SfPWNSa15zEjxaLeoCfP?= =?utf-8?q?/jtjFvXVW12cHHDFZviiraWTVLPsPJTIqFQxqpVF7FOSIdSCMc5VVykhxaJ7HKhIG?= =?utf-8?q?oam4a6j3k9WYZxzMlL8HhNh3D81oPVEE86EnTHZKW25uakufw9mU9xkV+rPpXxmqQ?= =?utf-8?q?zS3FnDtUCTspZpBikaysi7Oyg1deo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gCdTxf9L/4cj8KBBJz96mCzfBzTyE98tHY5XVjL?= =?utf-8?q?KaazRYx9vyq00MJyNlaSorKAPgYqHk39Pn6mgOzY4Rex19Q1ReDcu9wBRGppGwijR?= =?utf-8?q?z1K2b3jBbaIyGXFRstRjeQrrjNd8+4Szb/ZMQRbo66cYBnWppywIjXzrsjyT+YOga?= =?utf-8?q?FHmK3wmlp5opkTK4fD3BMNeKybgmKVR3N8MVIsEai32w0IjHrpX/vuM5qgVASPnKo?= =?utf-8?q?0gm8ylaAttOvhrGPGutFqypSxzjz9LjBdcd37DUZYkitU45m0squwYX7shd2gIEfx?= =?utf-8?q?+Po9D4jVqqkib+qX/VwNAA7dLjeCEttUNohuSxxxJJeCh6gQA9aO454OZoqZozQLI?= =?utf-8?q?zyeplK2751Ab5lZTPOLoq3iMGbNQaSuSfApy+2pG0nOngyE7pzwtEATYZPGLeBAnh?= =?utf-8?q?Vu98mUd6gVBqpYGwgN9CELwCraREoGcp08oF6xMB+1q8IlNV81ZPWCHapphDkc9e9?= =?utf-8?q?+9Iz5wJDhQxHadYAMXSUIAQ4y12kKU9n7/yqvt3xvTv/WnQNuDEzPtu2gckXjVziM?= =?utf-8?q?BSFnOMNyfedHYdji/kW1tU4Yfk9yIitrxG8WajlEMDFPFezydEFeCf71OSlPzUZc+?= =?utf-8?q?Fx92esWal?= X-Exchange-RoutingPolicyChecked: nsXXCOPnrBp/klxwYex0Cc0AGesRiNq3rt0VRqpnFYgVxrPNjhPj4VIi1/vLuNngomIXj1d0PiAggrjQ3lqny6ZoDyiHXaXtDhayNvt20csZIuagqQDPO/DZv72olfIQNQJI57Dy/FH89uremNs9QCbq15nlF0NTsLObtw9IhdocMKXDky7PLO/zDS5YVCDtc97sDrlwImA92ERlNzUz3LCQXtnJ3h8Hapy6g9W73rERz7fhXbLOW+2c/o4fHeW7QSVMayWlFXwwKUaqHkk+fGCFA910P32fCdCj7vegRg8jxrpdl1qwBHBPIJfb+XbYFOUC1w8Ne2Ai+BgUVFviLw== X-OriginatorOrg: windriver.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1748c964-e3d4-4ff3-823d-08deed2c80c9 X-MS-Exchange-CrossTenant-AuthSource: SN7PR11MB6677.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jul 2026 04:47:32.9805 (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: LgDrI6HKuVR0Ol42KvNK4Yo8kJCGu/UU7J8eVYVKOU+1W2+n+YthHQkMYrskFq2Ob1/DInLke9VZkDbiw2b+pGw58vvpdYbaMWlzvIUgDv2HScC4mp5WVADgx2OnX6z0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR11MB6242 X-Proofpoint-Reinject: loops=2 maxloops=12 X-Proofpoint-ORIG-GUID: l3-kCTEb4m33mQPMg8lrxF5OFKecVwLy X-Authority-Analysis: v=2.4 cv=f594wuyM c=1 sm=1 tr=0 ts=6a6985ea cx=c_pps a=1HqfSBmQQ8HGCHze6/9uFg==:117 a=6eWqkTHjU83fiwn7nKZWdM+Sl24=:19 a=z/mQ4Ysz8XfWz/Q5cLBRGdckG28=:19 a=lCpzRmAYbLLaTzLvsPZ7Mbvzbb8=:19 a=xqWC_Br6kY4A:10 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=VkNPw1HP01LnGYTKEx00:22 a=bi6dqmuHe4P4UrxVR6um:22 a=iKiJcTA2PjBS6x5JeXcw:22 a=ei4SEBeUAAAA:8 a=t7CeM3EgAAAA:8 a=7CQSdrXTAAAA:8 a=iGHA9ds3AAAA:8 a=8wEic9LhAAAA:8 a=ag1SF4gXAAAA:8 a=CofITuVKK-SS19HQx1UA:9 a=4vBCUijPwtmRX65I:21 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=8zIOOLb7Ym0NljyPXbuS:22 a=FdTzh2GWekK77mhwV6Dw:22 a=a-qgeE7W1pNrGK8U0ZQC:22 a=nM-MV4yxpKKO9kiQg6Ot:22 a=M9VCcFR7d36vLOFuqMn8:22 a=Yupwre4RP9_Eg_Bd0iYG:22 X-Proofpoint-Spam-Info: AW1haW4tMjYwNzI5MDAzNiBTYWx0ZWRfX5ZLjg7e5vpDh rTIEV+wwOBDqrDHSbPm0E4ijCeT9Q86Lj6LXU1u7e0qvdm7HTDkM/Np1ltC6DsjDTrq0FcMPFd7 UJIQ+AxicoHWXgo23jWy2N6A1WRsXlwLALO7uSUheQcr9K1Oel0q X-Proofpoint-GUID: GASg-BarWim9qsYaeBcz8q_s8abz7WQM X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzI5MDAzNiBTYWx0ZWRfX1x1+04q8FaXn F81IPDgqrRsf8Q4ifHrkf4XXf2ZIQLbUla4JrTFedHohk2DjqOSgYSuM95vBNjsHIBQXiKYBqML +sWvxx55NfDyW1TQu/0ECcIAOhUBx9/vgBrrdPbplPdcYiSY7nHZdQGHfyNVN5DVGugqt8pidE8 pdvMydK49lDDZtHRiFQv67kKM0z8jr2F7bf115Mtyd0eDVyyTWsWT5UvUVpz7d9BmcArCr3r0ku ix1gnTPoYsP51g6hYKHzgdBAoXje62OwWaFiu3C1PXtS3cVAHeVleVUiLWeLBqnE75ABCII4Fmk udyEiwT8Scg+5aSI4bzMSP4hI7GlqzYZpjeRJuyZuAAlgSYIDbxT4wCbhXQTXe24bgShC/rLxMt TavzKbnjP46WShKptEIXDm6SiZM7CvwR9zDoi8BVuSANEVmKlDiSOaIUZo8n/HzrRqwkt2r+hjx g+tSU7pDQIj4Y18s2Lw== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-07-29_02,2026-07-28_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 adultscore=0 priorityscore=1501 impostorscore=0 suspectscore=0 bulkscore=0 clxscore=1015 lowpriorityscore=0 phishscore=0 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607290036 X-MIME-Autoconverted: from 8bit to quoted-printable by mx0a-0064b401.pphosted.com id 66T4gsbQ687273 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, 29 Jul 2026 04:47:50 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/242230 From: Deepesh Varatharajan [YOCTO #15808] Consolidate Rust source management across all Rust recipes (rust, cargo, libstd-rs and their native/nativesdk variants) into a single shared source tree using the work-shared pattern. Disk savings: a world build with multilibs enabled, together with nativesdk-rust and nativesdk-cargo, now shares a single ~4.2 GB rustc-src tree instead of maintaining up to 11 independent copies (~46.2 GB total). Performance (clean core-image-sato build, qemux86-64): Before: 68m53.507s After: 65m46.159s Improvement: 3m07.348s (~4.5%) New files: - rust-source_1.96.1.bb: A shared recipe that fetches, unpacks, and patches the rustc source tree into ${TMPDIR}/work-shared/rust-source-${PV}-${PR}. All build/install/packaging tasks are disabled; this recipe exists solely to provide a single copy of the source. Inherits allarch/nopackages, excludes itself from rm_work, and is hidden from world builds. Also defines RUST_BUILD_ARCH locally since this recipe does not inherit rust-common.bbclass but still needs the mapping for snapshot fetching via rust-snapshot.inc. - common-source.inc: Included by consumer recipes (rust, cargo, libstd-rs) to disable their local do_fetch/do_unpack/do_patch tasks, clear SRC_URI, and add task dependencies on rust-source-${PV} for configure, licensing, and SPDX generation. Also provides is_work_shared_spdx() override for correct SPDX shared-workdir detection. Modified files: - rust-source.inc: - Set UNPACKDIR to the work-shared location so all consumers share one source tree via RUSTSRC and S. - rust_1.96.1.bb: - Add 'require common-source.inc' to use the shared source tree. - Set B = ${WORKDIR}/build to separate build artifacts from shared source. - Set CARGO_HOME = ${WORKDIR}/cargo_home to isolate cargo caching. - Set build-dir = "rust-build" in config.toml to distinguish Yocto's build directory (B), which holds config.toml, from the bootstrap's own build output directory. Without this, bootstrap defaults to "build/" inside B, creating an ambiguous build/build/ nesting. - Use absolute ${S}/src/bootstrap/bootstrap.py path since cwd is now B. - Update install functions to reference rust-build/ instead of build/. - Update do_test_compile to use absolute ${S}/src/tools/ path. - Change do_rust_setup_snapshot from 'after do_unpack' to depend on rust-source-${PV}:do_unpack (since local do_unpack is removed). - cargo_1.96.1.bb: - Add 'require common-source.inc' to use the shared source tree. - Change do_cargo_setup_snapshot from 'after do_unpack' to depend on rust-source-${PV}:do_unpack. - libstd-rs_1.96.1.bb: - Add 'require common-source.inc' to use the shared source tree. - rust-common.bbclass: - Add a second --remap-path-prefix for ${TMPDIR}/work-shared so debug info from the shared source tree is correctly remapped. - Retain RUST_BUILD_ARCH definition so that consumer recipes (rust, cargo, libstd-rs) which inherit this class can resolve snapshot directory names used by do_rust_setup_snapshot and do_cargo_setup_snapshot. - lib/oeqa/selftest/cases/rust.py: - Adapt the selftest to the build-dir/source-dir split: use B for build artifacts and RUSTSRC for source paths. - Update remote-test-server copy path from build/ to rust-build/. - Pass --build-dir and --config explicitly to bootstrap.py. - conf/distro/include/maintainers.inc: - Add maintainer entry for the new rust-source recipe. License-Update: recipe file renames only, no license change Signed-off-by: Deepesh Varatharajan --- meta/classes-recipe/rust-common.bbclass | 4 +- meta/conf/distro/include/maintainers.inc | 1 + meta/lib/oeqa/selftest/cases/rust.py | 9 ++- meta/recipes-devtools/rust/cargo_1.96.1.bb | 8 ++- meta/recipes-devtools/rust/common-source.inc | 28 ++++++++++ .../recipes-devtools/rust/libstd-rs_1.96.1.bb | 4 ++ meta/recipes-devtools/rust/rust-source.inc | 6 +- .../rust/rust-source_1.96.1.bb | 56 +++++++++++++++++++ meta/recipes-devtools/rust/rust_1.96.1.bb | 31 +++++++--- 9 files changed, 132 insertions(+), 15 deletions(-) create mode 100644 meta/recipes-devtools/rust/common-source.inc create mode 100644 meta/recipes-devtools/rust/rust-source_1.96.1.bb diff --git a/meta/classes-recipe/rust-common.bbclass b/meta/classes-recipe/rust-common.bbclass index 057aeda67a..6bc42016d1 100644 --- a/meta/classes-recipe/rust-common.bbclass +++ b/meta/classes-recipe/rust-common.bbclass @@ -14,7 +14,9 @@ FILES:${PN}-dev += "${rustlibdir}/*.rlib ${rustlibdir}/*.rmeta" FILES:${PN}-dbg += "${rustlibdir}/.debug" RUSTLIB ?= "-L ${STAGING_DIR_HOST}${rustlibdir}" -RUST_DEBUG_REMAP = "--remap-path-prefix=${WORKDIR}=${TARGET_DBGSRC_DIR}" +RUST_DEBUG_REMAP = "--remap-path-prefix=${WORKDIR}=${TARGET_DBGSRC_DIR} \ + --remap-path-prefix=${TMPDIR}/work-shared=${TARGET_DBGSRC_DIR} \ +" RUSTFLAGS += "${RUSTLIB} ${RUST_DEBUG_REMAP}" RUSTLIB_DEP ??= "libstd-rs" RUST_PANIC_STRATEGY ??= "unwind" diff --git a/meta/conf/distro/include/maintainers.inc b/meta/conf/distro/include/maintainers.inc index e0edfdef7e..1565b18fec 100644 --- a/meta/conf/distro/include/maintainers.inc +++ b/meta/conf/distro/include/maintainers.inc @@ -784,6 +784,7 @@ RECIPE_MAINTAINER:pn-ruby = "Ross Burton " RECIPE_MAINTAINER:pn-run-postinsts = "Ross Burton " RECIPE_MAINTAINER:pn-rust = "Randy MacLeod " RECIPE_MAINTAINER:pn-rust-cross-canadian-${TRANSLATED_TARGET_ARCH} = "Randy MacLeod " +RECIPE_MAINTAINER:pn-rust-source-1.96.1 = "Deepesh Varatharajan " RECIPE_MAINTAINER:pn-rxvt-unicode = "Unassigned " RECIPE_MAINTAINER:pn-sassc = "Simone Weiß " RECIPE_MAINTAINER:pn-sato-icon-theme = "Richard Purdie " diff --git a/meta/lib/oeqa/selftest/cases/rust.py b/meta/lib/oeqa/selftest/cases/rust.py index c961a8f652..4111d72044 100644 --- a/meta/lib/oeqa/selftest/cases/rust.py +++ b/meta/lib/oeqa/selftest/cases/rust.py @@ -46,7 +46,8 @@ class RustSelfTestSystemEmulated(OESelftestTestCase, OEPTestResultTestCase): recipe = "rust" start_time = time.time() bitbake("{} -c test_compile".format(recipe)) - builddir = get_bb_var("RUSTSRC", "rust") + builddir = get_bb_var("B", "rust") + sourcedir = get_bb_var("RUSTSRC", "rust") # build core-image-minimal with required packages default_installed_packages = ["libgcc", "libstdc++", "libatomic", "libgomp", "libzstd", "llvm", "openssl"] features = [] @@ -111,7 +112,7 @@ class RustSelfTestSystemEmulated(OESelftestTestCase, OEPTestResultTestCase): # Copy remote-test-server to image through scp host_sys = get_bb_var("RUST_BUILD_SYS", "rust") ssh = SSHControl(ip=qemu.ip, logfile=qemu.sshlog, user="root") - ssh.copy_to(builddir + "/build/" + host_sys + "/stage2-tools-bin/remote-test-server","~/") + ssh.copy_to(builddir + "/rust-build/" + host_sys + "/stage2-tools-bin/remote-test-server","~/") # Execute remote-test-server on image through background ssh command = '~/remote-test-server --bind 0.0.0.0:12345 -v' sshrun=subprocess.Popen(("ssh", '-o', 'UserKnownHostsFile=/dev/null', '-o', 'StrictHostKeyChecking=no', '-f', "root@%s" % qemu.ip, command), shell=False, stdout=subprocess.PIPE, stderr=subprocess.PIPE) @@ -131,8 +132,10 @@ class RustSelfTestSystemEmulated(OESelftestTestCase, OEPTestResultTestCase): # PowerPC mac99 QEMU has 768MB RAM limit, so we need to minimize test binary sizes cmd = cmd + " export RUSTFLAGS='-C strip=debuginfo -Clink-arg=-lz -Clink-arg=-lzstd';" # Trigger testing. + # Run bootstrap from sourcedir with explicit --build-dir and --config + # pointing to the separate build directory. cmd = cmd + " export TEST_DEVICE_ADDR=\"%s:12345\";" % qemu.ip - cmd = cmd + " cd %s; python3 src/bootstrap/bootstrap.py test %s --target %s" % (builddir, testargs, targetsys) + cmd = cmd + " cd %s; python3 src/bootstrap/bootstrap.py --build-dir %s/rust-build --config %s/config.toml test %s --target %s" % (sourcedir, builddir, builddir, testargs, targetsys) retval = runCmd(cmd) end_time = time.time() diff --git a/meta/recipes-devtools/rust/cargo_1.96.1.bb b/meta/recipes-devtools/rust/cargo_1.96.1.bb index adc1f0d331..16f8a76310 100644 --- a/meta/recipes-devtools/rust/cargo_1.96.1.bb +++ b/meta/recipes-devtools/rust/cargo_1.96.1.bb @@ -13,6 +13,8 @@ LIC_FILES_CHKSUM = " \ require rust-source.inc require rust-snapshot.inc +# Use shared source tree from rust-source.bb; disables local fetch/unpack/patch +require common-source.inc S = "${RUSTSRC}/src/tools/cargo" CARGO_VENDORING_DIRECTORY = "${RUSTSRC}/vendor" @@ -21,6 +23,9 @@ CVE_PRODUCT = "rust-lang:cargo" inherit cargo pkgconfig +# Explicit CARGO_HOME avoids cargo caching in the shared source tree +CARGO_HOME = "${WORKDIR}/cargo_home" + DEBUG_PREFIX_MAP += "-ffile-prefix-map=${RUSTSRC}/vendor=${TARGET_DBGSRC_DIR}" do_cargo_setup_snapshot () { @@ -32,9 +37,10 @@ do_cargo_setup_snapshot () { fi } -addtask cargo_setup_snapshot after do_unpack before do_configure +addtask cargo_setup_snapshot before do_configure do_cargo_setup_snapshot[dirs] += "${WORKDIR}/${CARGO_SNAPSHOT}" do_cargo_setup_snapshot[vardepsexclude] += "UNINATIVE_LOADER" +do_cargo_setup_snapshot[depends] += "rust-source-${PV}:do_unpack" do_compile:prepend () { export RUSTC_BOOTSTRAP="1" diff --git a/meta/recipes-devtools/rust/common-source.inc b/meta/recipes-devtools/rust/common-source.inc new file mode 100644 index 0000000000..a0d4dc542c --- /dev/null +++ b/meta/recipes-devtools/rust/common-source.inc @@ -0,0 +1,28 @@ +# common-source.inc - Disable source tasks for recipes using shared rust-source +# +# Recipes that include this file rely on rust-source-${PV} for fetching, +# unpacking, and patching the Rust source tree. This avoids duplicating the +# ~4.2 GB rustc-src tree per recipe variant (rust, cargo, libstd-rs and their +# native/nativesdk counterparts). + +# Disable local fetch/unpack/patch since rust-source-${PV} handles them +do_fetch() { + : +} +do_fetch[noexec] = "1" +deltask do_unpack +deltask do_patch + +# Clear SRC_URI to prevent fetcher warnings from stale URIs inherited via .inc +SRC_URI = "" + +# Ensure the shared source is fully ready before dependent tasks run +do_configure[depends] += "rust-source-${PV}:do_patch" +do_populate_lic[depends] += "rust-source-${PV}:do_unpack" +do_create_spdx[depends] += "rust-source-${PV}:do_patch" + +# The SPDX class uses is_work_shared_spdx() to detect shared workdirs. +# Since we redirect S rather than WORKDIR, the default detection fails. +# Override to always return True so SPDX processing works correctly. +def is_work_shared_spdx(d): + return True diff --git a/meta/recipes-devtools/rust/libstd-rs_1.96.1.bb b/meta/recipes-devtools/rust/libstd-rs_1.96.1.bb index 1ecd6bff3f..939e5824b3 100644 --- a/meta/recipes-devtools/rust/libstd-rs_1.96.1.bb +++ b/meta/recipes-devtools/rust/libstd-rs_1.96.1.bb @@ -5,6 +5,7 @@ LICENSE = "Unicode-3.0 AND (Apache-2.0 OR MIT)" LIC_FILES_CHKSUM = "file://../../COPYRIGHT;md5=11a3899825f4376896e438c8c753f8dc" require rust-source.inc +require common-source.inc # The dummy crate named `sysroot` represents the standard library target. # @@ -30,6 +31,9 @@ CARGO_FEATURES ?= "panic-unwind backtrace" CARGO_BUILD_FLAGS += "--features '${CARGO_FEATURES}'" CARGO_VENDORING_DIRECTORY = "${RUSTSRC}/vendor" +# Explicit CARGO_HOME avoids cargo caching in the shared source tree +CARGO_HOME = "${WORKDIR}/cargo_home" + do_compile:prepend () { # For Rust 1.13.0 and newer export RUSTC_BOOTSTRAP="1" diff --git a/meta/recipes-devtools/rust/rust-source.inc b/meta/recipes-devtools/rust/rust-source.inc index 5678e00671..7b10eef9a6 100644 --- a/meta/recipes-devtools/rust/rust-source.inc +++ b/meta/recipes-devtools/rust/rust-source.inc @@ -13,7 +13,11 @@ SRC_URI += "https://static.rust-lang.org/dist/rustc-${RUST_VERSION}-src.tar.xz;n " SRC_URI[rust.sha256sum] = "77a6ff3003a4ad0cb00697b043c879e3e1a15d945b1a1f63818903bfc3fa8b98" -RUSTSRC = "${UNPACKDIR}/rustc-${RUST_VERSION}-src" +# Point UNPACKDIR into the work-shared location so rust-source.bb and all +# consumers (via S/RUSTSRC) reference a single shared source tree. +UNPACKDIR = "${TMPDIR}/work-shared/rust-source-${PV}-${PR}/sources" +RUSTSRC = "${UNPACKDIR}/rustc-${PV}-src" +S = "${RUSTSRC}" UPSTREAM_CHECK_URI = "https://forge.rust-lang.org/infra/other-installation-methods.html" UPSTREAM_CHECK_REGEX = "rustc-(?P\d+(\.\d+)+)-src" diff --git a/meta/recipes-devtools/rust/rust-source_1.96.1.bb b/meta/recipes-devtools/rust/rust-source_1.96.1.bb new file mode 100644 index 0000000000..e9163b4a97 --- /dev/null +++ b/meta/recipes-devtools/rust/rust-source_1.96.1.bb @@ -0,0 +1,56 @@ +# rust-source_${PN}.bb - Shared source recipe for the Rust toolchain +# +# This recipe fetches, unpacks, and patches the rustc source tree into a +# work-shared location so that rust, cargo, libstd-rs, and their native/nativesdk +# variants all share a single copy of the source. This eliminates duplication +# (up to 11 copies of the ~4.2 GB source tree in multilib + nativesdk builds) +# and significantly reduces disk usage (~46.2 GB -> ~4.2 GB for rustc-src). +# +# Only do_fetch, do_unpack, and do_patch are meaningful here. All other +# tasks are disabled since this recipe exists solely to provide sources. + +SUMMARY = "Rust sources" +HOMEPAGE = "http://www.rust-lang.org" +SECTION = "devel" +LICENSE = "Unicode-3.0 AND (Apache-2.0 OR MIT)" +LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=11a3899825f4376896e438c8c753f8dc" + +# This recipe only provides source; disable build/install/packaging tasks +deltask do_configure +deltask do_compile +deltask do_install +deltask do_populate_sysroot +deltask do_populate_lic + +# Prevent rm_work from removing the shared source tree +RM_WORK_EXCLUDE += "${PN}" + +require rust-source.inc +require rust-snapshot.inc + +inherit allarch nopackages + +PN = "rust-source-${PV}" +BPN = "rust-source" + +# Place WORKDIR under work-shared so all consumers reference the same location +WORKDIR = "${TMPDIR}/work-shared/rust-source-${PV}-${PR}" +SSTATE_SWSPEC = "sstate:rust-source::${PV}:${PR}::${SSTATE_VERSION}:" + +# Use work-shared stamp directory so sstate is shared across all architectures +STAMP = "${STAMPS_DIR}/work-shared/rust-source-${PV}-${PR}" +STAMPCLEAN = "${STAMPS_DIR}/work-shared/rust-source-${PV}-*" + +DEPENDS = "" +PACKAGES = "" +baselib = "lib" +PACKAGE_ARCH = "all" + +B = "${WORKDIR}/build" + +# rust-source.bb does not inherit rust-common.bbclass (it is allarch/nopackages +# and has no toolchain dependencies), so we define RUST_BUILD_ARCH locally for +# snapshot URL resolution in rust-snapshot.inc. +RUST_BUILD_ARCH = "${@{'ppc': 'powerpc', 'ppc64': 'powerpc64', 'ppc64le': 'powerpc64le', 'riscv64': 'riscv64gc'}.get(d.getVar('BUILD_ARCH'), d.getVar('BUILD_ARCH'))}" + +EXCLUDE_FROM_WORLD = "1" diff --git a/meta/recipes-devtools/rust/rust_1.96.1.bb b/meta/recipes-devtools/rust/rust_1.96.1.bb index fa8777826f..4bbe4ed0bd 100644 --- a/meta/recipes-devtools/rust/rust_1.96.1.bb +++ b/meta/recipes-devtools/rust/rust_1.96.1.bb @@ -4,6 +4,10 @@ SECTION = "devel" LICENSE = "Unicode-3.0 AND (Apache-2.0 OR MIT)" LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=11a3899825f4376896e438c8c753f8dc" +require rust-source.inc +require rust-snapshot.inc +require common-source.inc + inherit rust inherit cargo_common @@ -24,6 +28,9 @@ INHIBIT_DEFAULT_RUST_DEPS:class-native = "1" PROVIDES:class-native = "virtual/${TARGET_PREFIX}rust" S = "${RUSTSRC}" +# Separate build directory from the shared source tree so that multiple +# variants (target, native, nativesdk) don't conflict in the source dir. +B = "${WORKDIR}/build" # Use at your own risk, accepted values are stable, beta and nightly RUST_CHANNEL ?= "stable" @@ -38,6 +45,9 @@ RUST_ALTERNATE_EXE_PATH_NATIVE = "${STAGING_BINDIR_NATIVE}/llvm-config" # own vendoring. CARGO_DISABLE_BITBAKE_VENDORING = "1" +# Explicit CARGO_HOME avoids cargo caching in the shared source tree +CARGO_HOME = "${WORKDIR}/cargo_home" + setup_cargo_environment () { # The first step is to build bootstrap and some early stage tools, # these are build for the same target as the snapshot, e.g. @@ -66,11 +76,11 @@ do_rust_setup_snapshot () { done fi } -addtask rust_setup_snapshot after do_unpack before do_configure +addtask rust_setup_snapshot before do_configure addtask do_test_compile after do_configure do_rust_gen_targets do_rust_setup_snapshot[dirs] += "${WORKDIR}/rust-snapshot" do_rust_setup_snapshot[vardepsexclude] += "UNINATIVE_LOADER" -do_rust_setup_snapshot[depends] += "patchelf-native:do_populate_sysroot" +do_rust_setup_snapshot[depends] += "patchelf-native:do_populate_sysroot rust-source-${PV}:do_unpack" RUSTC_BOOTSTRAP = "${STAGING_BINDIR_NATIVE}/rustc" CARGO_BOOTSTRAP = "${STAGING_BINDIR_NATIVE}/cargo" @@ -173,6 +183,12 @@ python do_configure() { # nothing about when trying to build some stage0 tools (like fabricate) config.set("build", "build", e(d.getVar("RUST_BUILD_SYS"))) + # Yocto's B (${WORKDIR}/build) is where config.toml lives. Rust's + # bootstrap creates its own build output directory inside B; name it + # "rust-build" to avoid ambiguity with Yocto's build directory and + # prevent a confusing build/build/ nesting. + config.set("build", "build-dir", e("rust-build")) + # [install] config.add_section("install") # ./x.py install doesn't have any notion of "destdir" @@ -223,13 +239,10 @@ rust_runx () { oe_cargo_fix_env - python3 src/bootstrap/bootstrap.py ${@oe.utils.parallel_make_argument(d, '-j %d')} "$@" --verbose + python3 ${S}/src/bootstrap/bootstrap.py ${@oe.utils.parallel_make_argument(d, '-j %d')} "$@" --verbose } rust_runx[vardepsexclude] += "PARALLEL_MAKE" -require rust-source.inc -require rust-snapshot.inc - INSANE_SKIP:${PN}:class-native = "already-stripped" FILES:${PN} += "${libdir}/rustlib" FILES:${PN} += "${libdir}/*.so" @@ -241,7 +254,7 @@ do_compile () { do_test_compile[dirs] = "${B}" do_test_compile () { replace_llvm_config_path - rust_runx build src/tools/remote-test-server --target "${RUST_TARGET_SYS}" + rust_runx build ${S}/src/tools/remote-test-server --target "${RUST_TARGET_SYS}" } ALLOW_EMPTY:${PN} = "1" @@ -282,7 +295,7 @@ rust_do_install:class-nativesdk() { install -d ${D}${bindir} for i in cargo-clippy clippy-driver rustfmt; do - cp build/${RUST_BUILD_SYS}/stage2-tools/${RUST_HOST_SYS}/release/$i ${D}${bindir} + cp rust-build/${RUST_BUILD_SYS}/stage2-tools/${RUST_HOST_SYS}/release/$i ${D}${bindir} patchelf --set-rpath "\$ORIGIN/../lib" ${D}${bindir}/$i done @@ -322,7 +335,7 @@ rust_do_install:class-target() { install -d ${D}${bindir} for i in ${EXTRA_TOOLS}; do - cp build/${RUST_BUILD_SYS}/stage2-tools/${RUST_HOST_SYS}/release/$i ${D}${bindir} + cp rust-build/${RUST_BUILD_SYS}/stage2-tools/${RUST_HOST_SYS}/release/$i ${D}${bindir} patchelf --set-rpath "\$ORIGIN/../lib" ${D}${bindir}/$i done From patchwork Wed Jul 29 04:47:13 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Varatharajan, Deepesh" X-Patchwork-Id: 93793 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 0D04EC53219 for ; Wed, 29 Jul 2026 04:47:50 +0000 (UTC) Received: from mx0a-0064b401.pphosted.com (mx0a-0064b401.pphosted.com [205.220.166.238]) by mx.groups.io with SMTP id smtpd.msgproc02-g2.4473.1785300459860822920 for ; Tue, 28 Jul 2026 21:47:39 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@windriver.com header.s=PPS06212021 header.b=L/Olu3oH; 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.166.238, mailfrom: prvs=26709619c3=deepesh.varatharajan@windriver.com) Received: from pps.filterd (m0250809.ppops.net [127.0.0.1]) by mx0a-0064b401.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 66T4blBD677850 for ; Tue, 28 Jul 2026 21:47:39 -0700 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=7iLEv+QfP6EfHuAPTl4L8MUSKosdRJ/9UERB8O4I6l0=; b= L/Olu3oHoQCjYK+HoNL/A9lRhPNzqmnz9SBy1FHe6hgVzeGoUzddBNgIFzPzNigF t6BizKUPVMAPzmtDLzMQ2jfpr5J1T2atFiyM6xA4kHZ/ckHd0bcQsLzdcgizDcXj 4JdCp/f7dRloA94nNgTm7Ub3bSShSGxSafvhRrcdSZBLR6ZEEh3gikWkC11Kr5lY yzMQDSWzgRNxMxmZsPftP7+SBHiZDWscsoVMLBVw6Y5dyr23rMjUs20F2KS9S26s 9o/PDMrgAGuOztbvdwmspqK5BFHqefUlEy+HQM59sLGB0hq3dNJnTRRgKkvHSqXg 5EBTvFZBpy/3Rvoc2/AZyQ== Received: from dm5pr21cu001.outbound.protection.outlook.com (mail-centralusazon11011063.outbound.protection.outlook.com [52.101.62.63]) by mx0a-0064b401.pphosted.com (PPS) with ESMTPS id 4fq86nr5bw-2 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Tue, 28 Jul 2026 21:47:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=cvY3kk2TUt2YNBwgGBEnA3pQeyFXA8wEpGvS2Qtq+WGR8LmPVNsJ+XPO7oVHiS6VhtFBKoWjDzRm2qSJDi7OoEEOefejRbJECc7QB1PDh31hpeqALHsxX3bwcznNGWGtIwYvxFqNzc6Jx8RaUz6b3EOnpgEsFFKJhi8r+JNGTWuQPTodqb9Bd4jDSDaVeCI9c94I3RAVWcxAALkwl56Gi4NpgD7Nlq73ZHiFqjgE+DMC5scOaeOlORGDMXNLtpFJ2lo/4RJeUjYCbHBAaQWN3Skt7rx8a6qGehwMTvp30pThYfDOEiFR3cX1fE0PBSZSXoIl9nfJjnHj5JaTwM6D3g== 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=7iLEv+QfP6EfHuAPTl4L8MUSKosdRJ/9UERB8O4I6l0=; b=lWXipHwzWAg/mDK/LnI1UqhenhzMRvWWU7gbcwAU9EW0gEUh1wPhlEDRjD33kahPjsCz0UqboMVBZT8VXH9qt/zY6Pbr+vNDVDwUg1N9yu9wy7ra4qwNt1a/LuuOOpwMeaTTQ0cKVSPMyFNqohw6J8wRN706MPdCphfSCLhMl1oFi6AC4NNvqI87/Islipxv6pssnXpOGfndQdCxt4/WSj10UcS7LXkfqXbDgkZBHRujis4lN9eys13RFjw64LEbZVpT54/ssk1SkiFpTOiFHWWPmEiCx6Se+ouZxeT3JD00AVQkcgDKythabzQkbEl2OnkjZVpT4V32qS5o1b/xdA== 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 Received: from SN7PR11MB6677.namprd11.prod.outlook.com (2603:10b6:806:26b::6) by IA1PR11MB6242.namprd11.prod.outlook.com (2603:10b6:208:3e8::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.245.13; Wed, 29 Jul 2026 04:47:36 +0000 Received: from SN7PR11MB6677.namprd11.prod.outlook.com ([fe80::490a:519b:d657:99ab]) by SN7PR11MB6677.namprd11.prod.outlook.com ([fe80::490a:519b:d657:99ab%4]) with mapi id 15.21.0270.009; Wed, 29 Jul 2026 04:47:36 +0000 From: Deepesh.Varatharajan@windriver.com To: openembedded-core@lists.openembedded.org Cc: Sundeep.Kokkonda@windriver.com, Deepesh.Varatharajan@windriver.com, richard.purdie@linuxfoundation.org Subject: [PATCH v4 3/3] rust: Move do_update_snapshot to rust-source Date: Tue, 28 Jul 2026 21:47:13 -0700 Message-ID: <20260729044714.1239545-3-Deepesh.Varatharajan@windriver.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20260729044714.1239545-1-Deepesh.Varatharajan@windriver.com> References: <20260729044714.1239545-1-Deepesh.Varatharajan@windriver.com> X-ClientProxiedBy: BN1PR10CA0022.namprd10.prod.outlook.com (2603:10b6:408:e0::27) To SN7PR11MB6677.namprd11.prod.outlook.com (2603:10b6:806:26b::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN7PR11MB6677:EE_|IA1PR11MB6242:EE_ X-MS-Office365-Filtering-Correlation-Id: 9fa3f18d-73df-4a8c-09c2-08deed2c8258 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|52116014|1800799024|23010399003|366016|376014|18002099003|22082099003|10067099003|56012099006|11063799006|6133799003|38350700014; X-Microsoft-Antispam-Message-Info: 68SHy3vNmXbb6Oi0uo64L9x6zLH6VUxUEM+uf/11S5GdKnUqm6UtVaCVRKmWg6IdvVBrfl6p6surMEpUF9bQCRoxPEW6PyEhMEJYmPmjdQLX+wB4RnWAT/kgGHyGKuMxS4UGNUocc4HEGTnokupRSbdmPfWGnQMdLgBNl6TFWwvXACTLXimAT554XSfU6PD5uIRRU28DKWye6nMQEFpK/+YjbMxhFrUSCE/UeDAg5IRrogTTVQs0dpUHJ1QSU0rmLV407NQ9zEpEHXnjyoyR5Zfw6WYgKEjv/omY59cGK7oWMw8dusWwwvZXHQQkAd/d/PdPyo/sNltwK4eLkovwiPXalAL/akNXvU0pHmrF9Na4Qq5QjNNfpocwG4BbMKaqiauk3bsYouYDlQj6L0CYyqRav2kA+MsnUX41moeh/a94Y47u/IsZs5NfFRVh2bri4+yhfZmFXm2NkJYKptqFB71Sn7zgrOS2BgyK3zm9b9psNee/81YKjIJLo7JFVwqpbkHF7/YQJS/uPGILWJFMALNZPNK0441uE0/nlL4QZmcC/nV2flEwTd6kbprBw5fPrLPFtmqRjKb639RUjn62JDmRvEoVnRgpq6KBdiUf4h/ICBGkwzP7uMhzy5Yc8NqaZrx6Wf704GBb/TjM4PoYIsWnhabooKCrevoMXfFv6moC7TmIsl75Itexh4YZqP5fqqEYCZMkZIOnqx5S7ZnixTjuUn7OfkTuOiJQjEisjUo= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SN7PR11MB6677.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(52116014)(1800799024)(23010399003)(366016)(376014)(18002099003)(22082099003)(10067099003)(56012099006)(11063799006)(6133799003)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: W8438jIhkxAdrTI3LV4x/TMxp6miaozV1TMAg+iL4hv3GX5kAr71ffvKp35/9KZSiHbl6kFAceeFKq/uK+zDoYHUI8toT9KEK8jvvZIsyNYIedS4JN1JdQo3zUf5kUWorom+k1z6uj/dyGQBF+MLxHX4UinmplHGyHWxRdaAryzxkeJiQPPd0fE+4DsBITPNpiqr8G+BU8+QV4DgKyeWUDE/x0qFriQuYzsC8l5/2T6lGDiPN1VjRlKCDIZ6fAn8W0oOIwDJ6XwXPMJAJ9/5IKUc+OmOB0TsZ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RGlll1mic1CAK0tqA3sPf4SwjSHo+qhd/OaN/7B8I9j8nGpIGr2TeaDVplhIKn5px1MjhKRW/eMMXV1PMp7gwxvGxz2DnKadyxbzF6K1tg5FeTlg/PjqKO0Z0uYduNRKAQmhVG3NbCpmeQwtRRLfY9l260Uc0iwqI3KZWsWixi7qrlya6XBmi4DFhYTlYuVNiGz1vr23XjVbGGRYFKdH8BTAFsweHsQz8n15daZokcab+ZKl33mSiW5RlvrQiD1aQoGC/HM/T7gLex7SgsSHyT3iCARt5s3sRb821jHf1D55xogNAIxUNylER2rjDnEMqm1bt1neKQJWn+nXUfJ9RXdZpDkoXr1SXNydUdGlt8lCcyVgDMYe34i8StxXmOBxWyGERRoh4Qwd8RqPb4Zo2KdzAQmzNMmSImwoAdx X-Exchange-RoutingPolicyChecked: TSI0npyehqao8aJYYIxBJVaBgrob3KDRcU3aFVszO00u2wFJdkURREgk6JCM1cgj3JUBQHirVdQtkHQs7ttQIOT/dli0+Wexu64tGIQLCuey5cYVFhHAU9sCEjur8vZxYa2xiytjZLbdmVvaBnYFAJMF3MxTmMOPkZ9bws32fJ8qjTHhrOyxvuCPl0+Ray31A8jG7k+am67GLkr+8GXBp4IagwHIUgjAC2XJzGYzG2cEciHuq9w2xEDEVOFvGNl3sCcH1b1luwFoThylsG9z3ynarrztBQPAo8eHsdYJBFf/onRv+miIGwTxBMkeBsBSvFhfH1BS1l6fnO+3vtWVgA== X-OriginatorOrg: windriver.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9fa3f18d-73df-4a8c-09c2-08deed2c8258 X-MS-Exchange-CrossTenant-AuthSource: SN7PR11MB6677.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jul 2026 04:47:35.5893 (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: C1piofR9qo4cmJlTRjdlyTMHYEPzW9ketdVBk6keHXZ3YoYE3fWd+hA/CpetQ4Z/WqgesEdCBj5Ne6vqud6Mm4HRBLcmmmqS7V6zpOteMSD5szJnFVx+qQLcVbqigYKS X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR11MB6242 X-Proofpoint-Reinject: loops=2 maxloops=12 X-Proofpoint-ORIG-GUID: y5zMOyNj8J27ZrIwWZm2eo0_tQz8TLHm X-Authority-Analysis: v=2.4 cv=f594wuyM c=1 sm=1 tr=0 ts=6a6985eb cx=c_pps a=1HqfSBmQQ8HGCHze6/9uFg==:117 a=6eWqkTHjU83fiwn7nKZWdM+Sl24=:19 a=z/mQ4Ysz8XfWz/Q5cLBRGdckG28=:19 a=lCpzRmAYbLLaTzLvsPZ7Mbvzbb8=:19 a=xqWC_Br6kY4A:10 a=RAioF0-LDSMA:10 a=VkNPw1HP01LnGYTKEx00:22 a=bi6dqmuHe4P4UrxVR6um:22 a=iKiJcTA2PjBS6x5JeXcw:22 a=t7CeM3EgAAAA:8 a=M-5mPBX6iDpf5b3w-P8A:9 a=FdTzh2GWekK77mhwV6Dw:22 X-Proofpoint-Spam-Info: AW1haW4tMjYwNzI5MDAzNiBTYWx0ZWRfX5XYh27GVuDNA CGFuzyrRz14KUd/ac2QBXNH8QWsv1FrkmTjTLoidPA9aJ4ZcpoIJMCD11DCeU9ar/vm+JnxMGTU 9dgEQsrdEeP26qvPO7yh+zGNDyvJxjJ3IuHjZK3qjgU+sL+o70k8 X-Proofpoint-GUID: eq9RkurKxOgXXi5hcJCCij1VDYuWVVxo X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzI5MDAzNiBTYWx0ZWRfX3vIGSwf7eM+C Pix60tRAee/mTS5ACmH4zOtMMmP5o3nj/KVvrWx3/XHfoYD6ft/dQCz99gUj8g8++6NVz9Rbq9g 3aJES57d20qbqXOCguzFW8LPBT+5+RfPyy7bvRLvvM+taYJP0Brttme4NgoueCnYyfuvgPA5DGm uXntub0oL/m9+ZMlmqJpypZnEyXsIxJz7rZBBuX/gqsbU6G5TRdX8FcDLoCT2LIhZsV1KcyKGFJ OC317F3uyPxv+KFxVVxqVKn/jFwnegwyIqeE0DCzrPJCMc9L/eZ8/qeP6gBP/Mxit1qOX/F5C3f h8qpEuZ9OpwIVKiJUs+tyDY8f4VE2TafVN+LRK6V8WGYuSPv/hBQTTJJTcC9bzWtiDmBcQFugJz VoZDZIUTt2yUQlivtvAK8V5a6rVYsQ8TPj8GoV1VIUZkPcWObTdarHnnTDpubVCNdsTsLYs57i8 Xk8hGerwN4vQtOc6E7w== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-07-29_02,2026-07-28_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 adultscore=0 priorityscore=1501 impostorscore=0 suspectscore=0 bulkscore=0 clxscore=1015 lowpriorityscore=0 phishscore=0 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607290036 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, 29 Jul 2026 04:47:50 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/242229 From: Deepesh Varatharajan Move do_update_snapshot from rust to rust-source, since rust-source now owns do_fetch/do_unpack/do_patch tasks after the shared source refactoring. Signed-off-by: Deepesh Varatharajan --- .../rust/rust-source_1.96.1.bb | 72 ++++++++++++++++++ meta/recipes-devtools/rust/rust_1.96.1.bb | 73 ------------------- 2 files changed, 72 insertions(+), 73 deletions(-) diff --git a/meta/recipes-devtools/rust/rust-source_1.96.1.bb b/meta/recipes-devtools/rust/rust-source_1.96.1.bb index e9163b4a97..5649c3e937 100644 --- a/meta/recipes-devtools/rust/rust-source_1.96.1.bb +++ b/meta/recipes-devtools/rust/rust-source_1.96.1.bb @@ -54,3 +54,75 @@ B = "${WORKDIR}/build" RUST_BUILD_ARCH = "${@{'ppc': 'powerpc', 'ppc64': 'powerpc64', 'ppc64le': 'powerpc64le', 'riscv64': 'riscv64gc'}.get(d.getVar('BUILD_ARCH'), d.getVar('BUILD_ARCH'))}" EXCLUDE_FROM_WORLD = "1" + +addtask do_update_snapshot after do_patch +do_update_snapshot[nostamp] = "1" + +# Run with `bitbake rust-source-${PV} -c update_snapshot` to update `rust-snapshot.inc` +# with the checksums for the rust snapshot associated with this rustc-src tarball. +python do_update_snapshot() { + import json + import re + import sys + + from collections import defaultdict + + key_value_pairs = {} + with open(os.path.join(d.getVar("S"), "src", "stage0")) as f: + for line in f: + # Skip empty lines or comments + if not line.strip() or line.startswith("#"): + continue + # Split the line into key and value using '=' as separator + match = re.match(r'(\S+)\s*=\s*(\S+)', line.strip()) + if match: + key = match.group(1) + value = match.group(2) + key_value_pairs[key] = value + # Extract the required values from key_value_pairs + config_dist_server = key_value_pairs.get('dist_server', '') + compiler_date = key_value_pairs.get('compiler_date', '') + compiler_version = key_value_pairs.get('compiler_version', '') + + src_uri = defaultdict(list) + # Assuming checksums_sha256 is now a key-value pair like: checksum_key = checksum_value + for k, v in key_value_pairs.items(): + # Match the pattern for checksums + if "dist" in k and "tar.xz" in k: + m = re.search(f"dist/{compiler_date}/(?P.*)-{compiler_version}-(?P.*)-unknown-linux-gnu\\.tar\\.xz", k) + if m: + component = m.group('component') + arch = m.group('arch') + src_uri[arch].append(f"SRC_URI[{component}-snapshot-{arch}.sha256sum] = \"{v}\"") + # Create the snapshot string with the extracted values + snapshot = """\ +## This is information on the rust-snapshot (binary) used to build our current release. +## snapshot info is taken from rust/src/stage0 +## Rust is self-hosting and bootstraps itself with a pre-built previous version of itself. +## The exact (previous) version that has been used is specified in the source tarball. +## The version is replicated here. + +SNAPSHOT_VERSION = "%s" + +""" % compiler_version + # Add the checksum components to the snapshot + for arch, components in src_uri.items(): + snapshot += "\n".join(components) + "\n\n" + # Add the additional snapshot URIs + snapshot += """\ +SRC_URI += " \\ + ${RUST_DIST_SERVER}/dist/${RUST_STD_SNAPSHOT}.tar.xz;name=rust-std-snapshot-${RUST_BUILD_ARCH};subdir=rust-snapshot-components \\ + ${RUST_DIST_SERVER}/dist/${RUSTC_SNAPSHOT}.tar.xz;name=rustc-snapshot-${RUST_BUILD_ARCH};subdir=rust-snapshot-components \\ + ${RUST_DIST_SERVER}/dist/${CARGO_SNAPSHOT}.tar.xz;name=cargo-snapshot-${RUST_BUILD_ARCH};subdir=rust-snapshot-components \\ +" + +RUST_DIST_SERVER = "%s" + +RUST_STD_SNAPSHOT = "rust-std-${SNAPSHOT_VERSION}-${RUST_BUILD_ARCH}-unknown-linux-gnu" +RUSTC_SNAPSHOT = "rustc-${SNAPSHOT_VERSION}-${RUST_BUILD_ARCH}-unknown-linux-gnu" +CARGO_SNAPSHOT = "cargo-${SNAPSHOT_VERSION}-${RUST_BUILD_ARCH}-unknown-linux-gnu" +""" % config_dist_server + # Write the updated snapshot information to the rust-snapshot.inc file + with open(os.path.join(d.getVar("THISDIR"), "rust-snapshot.inc"), "w") as f: + f.write(snapshot) +} diff --git a/meta/recipes-devtools/rust/rust_1.96.1.bb b/meta/recipes-devtools/rust/rust_1.96.1.bb index 4bbe4ed0bd..f8f47b0414 100644 --- a/meta/recipes-devtools/rust/rust_1.96.1.bb +++ b/meta/recipes-devtools/rust/rust_1.96.1.bb @@ -354,79 +354,6 @@ rust_do_install:class-target() { rm ${D}${libdir}/rustlib/${RUST_HOST_SYS}/lib/libstd*.so } -addtask do_update_snapshot after do_patch -do_update_snapshot[nostamp] = "1" - -# Run with `bitbake -c update_snapshot rust` to update `rust-snapshot.inc` -# with the checksums for the rust snapshot associated with this rustc-src -# tarball. -python do_update_snapshot() { - import json - import re - import sys - - from collections import defaultdict - - key_value_pairs = {} - with open(os.path.join(d.getVar("S"), "src", "stage0")) as f: - for line in f: - # Skip empty lines or comments - if not line.strip() or line.startswith("#"): - continue - # Split the line into key and value using '=' as separator - match = re.match(r'(\S+)\s*=\s*(\S+)', line.strip()) - if match: - key = match.group(1) - value = match.group(2) - key_value_pairs[key] = value - # Extract the required values from key_value_pairs - config_dist_server = key_value_pairs.get('dist_server', '') - compiler_date = key_value_pairs.get('compiler_date', '') - compiler_version = key_value_pairs.get('compiler_version', '') - - src_uri = defaultdict(list) - # Assuming checksums_sha256 is now a key-value pair like: checksum_key = checksum_value - for k, v in key_value_pairs.items(): - # Match the pattern for checksums - if "dist" in k and "tar.xz" in k: - m = re.search(f"dist/{compiler_date}/(?P.*)-{compiler_version}-(?P.*)-unknown-linux-gnu\\.tar\\.xz", k) - if m: - component = m.group('component') - arch = m.group('arch') - src_uri[arch].append(f"SRC_URI[{component}-snapshot-{arch}.sha256sum] = \"{v}\"") - # Create the snapshot string with the extracted values - snapshot = """\ -## This is information on the rust-snapshot (binary) used to build our current release. -## snapshot info is taken from rust/src/stage0 -## Rust is self-hosting and bootstraps itself with a pre-built previous version of itself. -## The exact (previous) version that has been used is specified in the source tarball. -## The version is replicated here. - -SNAPSHOT_VERSION = "%s" - -""" % compiler_version - # Add the checksum components to the snapshot - for arch, components in src_uri.items(): - snapshot += "\n".join(components) + "\n\n" - # Add the additional snapshot URIs - snapshot += """\ -SRC_URI += " \\ - ${RUST_DIST_SERVER}/dist/${RUST_STD_SNAPSHOT}.tar.xz;name=rust-std-snapshot-${RUST_BUILD_ARCH};subdir=rust-snapshot-components \\ - ${RUST_DIST_SERVER}/dist/${RUSTC_SNAPSHOT}.tar.xz;name=rustc-snapshot-${RUST_BUILD_ARCH};subdir=rust-snapshot-components \\ - ${RUST_DIST_SERVER}/dist/${CARGO_SNAPSHOT}.tar.xz;name=cargo-snapshot-${RUST_BUILD_ARCH};subdir=rust-snapshot-components \\ -" - -RUST_DIST_SERVER = "%s" - -RUST_STD_SNAPSHOT = "rust-std-${SNAPSHOT_VERSION}-${RUST_BUILD_ARCH}-unknown-linux-gnu" -RUSTC_SNAPSHOT = "rustc-${SNAPSHOT_VERSION}-${RUST_BUILD_ARCH}-unknown-linux-gnu" -CARGO_SNAPSHOT = "cargo-${SNAPSHOT_VERSION}-${RUST_BUILD_ARCH}-unknown-linux-gnu" -""" % config_dist_server - # Write the updated snapshot information to the rust-snapshot.inc file - with open(os.path.join(d.getVar("THISDIR"), "rust-snapshot.inc"), "w") as f: - f.write(snapshot) -} - RUSTLIB_DEP:class-nativesdk = "" # musl builds include libunwind.a