From patchwork Fri Nov 29 08:08:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Hemraj, Deepthi" X-Patchwork-Id: 53360 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 4D6C2D6EBED for ; Fri, 29 Nov 2024 08:08:53 +0000 (UTC) Received: from mx0a-0064b401.pphosted.com (mx0a-0064b401.pphosted.com [205.220.166.238]) by mx.groups.io with SMTP id smtpd.web10.111215.1732867731584015398 for ; Fri, 29 Nov 2024 00:08:51 -0800 Authentication-Results: mx.groups.io; dkim=none (message not signed); 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=20636204d6=deepthi.hemraj@windriver.com) Received: from pps.filterd (m0250810.ppops.net [127.0.0.1]) by mx0a-0064b401.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 4AT7MEaw013053 for ; Fri, 29 Nov 2024 00:08:51 -0800 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-0064b401.pphosted.com (PPS) with ESMTPS id 43671c9u1j-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 29 Nov 2024 00:08:51 -0800 (PST) Received: from m0250810.ppops.net (m0250810.ppops.net [127.0.0.1]) by pps.reinject (8.18.0.8/8.18.0.8) with ESMTP id 4AT88oQO019463 for ; Fri, 29 Nov 2024 00:08:50 -0800 Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2041.outbound.protection.outlook.com [104.47.66.41]) by mx0a-0064b401.pphosted.com (PPS) with ESMTPS id 43671c9u1f-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 29 Nov 2024 00:08:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Bn+Thzikbn4xwA2YqrdAcV437ixpDx8o0kUwCYyp0ODtU7RsJEAWQVtitG7Jsac9CduJkR6kvqwhX7BtEvgqBo6YqYkIsnHvxssH/o8begDq0v4Z6SrJRNnEAKESxd6c74x4BW9kcL3tVx3ITQPaRDgCy7rxmlZlWqF2/aZ/WGOoSH/W96+SzqupCW7BC/HC84mkR1uttblBTLr0Sl2wgfWLrcjUYiY8AnWdJesyguFIylOaNtbhNAmXAikelc2NiKnmggXXpcTV6H7Lw5x06PipPwObBAS+VLqf3Rq4xRdc/OOX1CAKYUoOdw0vPtk/mhRpvZtmFjrAR8yLsKqoew== 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=7H2RtuxlraJ4O3YwO7PU/hPTNmdpWNWXAPwjNmtd0T8=; b=f/ajLLqTRo+GQSgWwLUMLjGcDXiu9DsCK1pwBZVrtgh3gXuAPPPS43A/qMrN77Ub6oks6/+vjqRXSg0zLRwYgj7NWG+fSSwfm0KESB9W1svBjQDJIJzw1Vbt4TlyHrpk8xJzRbgXZvGPNI9SRkOGa9iJtJ1SkKRoajnANBPHTvSnukckiajJhmsDMOY54SuQty2K2PjA6352t69k+ab6GFfs30Hcjoxr47jH7aCAdRprmEsk04FFMUBFBsIZcxhAEuC9vOtt6SGo1FzHxsMcwW9MrfAME1v/4vT4ZQDKc9Q6soN5aYAGbR/OGUajEHiEa5+MW7d6ekvVf5ars43Omw== 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 LV3PR11MB8602.namprd11.prod.outlook.com (2603:10b6:408:1b3::11) by IA1PR11MB8150.namprd11.prod.outlook.com (2603:10b6:208:44c::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8207.13; Fri, 29 Nov 2024 08:08:49 +0000 Received: from LV3PR11MB8602.namprd11.prod.outlook.com ([fe80::5e20:4508:a523:df39]) by LV3PR11MB8602.namprd11.prod.outlook.com ([fe80::5e20:4508:a523:df39%4]) with mapi id 15.20.8207.010; Fri, 29 Nov 2024 08:08:49 +0000 From: Deepthi.Hemraj@windriver.com To: openembedded-core@lists.openembedded.org, richard.purdie@linuxfoundation.org Cc: Randy.MacLeod@windriver.com, Naveen.Gowda@windriver.com, Sundeep.Kokkonda@windriver.com Subject: [PATCH V3 2/2] rust-cross-canadian: Fix environment setup script conflicts for multilibs Date: Fri, 29 Nov 2024 00:08:20 -0800 Message-ID: <20241129080820.330411-2-Deepthi.Hemraj@windriver.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241129080820.330411-1-Deepthi.Hemraj@windriver.com> References: <20241129080820.330411-1-Deepthi.Hemraj@windriver.com> X-ClientProxiedBy: SJ2PR07CA0014.namprd07.prod.outlook.com (2603:10b6:a03:505::7) To LV3PR11MB8602.namprd11.prod.outlook.com (2603:10b6:408:1b3::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: LV3PR11MB8602:EE_|IA1PR11MB8150:EE_ X-MS-Office365-Filtering-Correlation-Id: 6bd1b9be-5eb0-4e46-c897-08dd104d0df3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|366016|52116014|376014|38350700014; X-Microsoft-Antispam-Message-Info: CsHLF6z4Xu2vPxJW3XX5CplDDFw7mhP25ye7tHuE2M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ST+O7qCAk6OZU55/Gmjn9RCU8olir9q++//yUC4A3ZXWe79FyOp3rMUEPo065JRjwotAhXVgQGiwQ1mn9y9FNgHeNtTJ2QObXtaytBIZpYfg5OV1bekvtJobGIJv2JH+Wx07BJusj54gHgXyl8ngwlwoWhZSO8ync+T9Mv6dUajxHwuMQbZ9aVpcbk11BaMw+ymVeLRFXVybOjTH/9uBsZsHq9JPy5/sYefWK9KafcBDiDLc2W23U8tWMNuNX/Nq2SLSN5boS2/N6UIsehZqgElPnt9jf6V+rWznn3xI2A+Bkwtfw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:LV3PR11MB8602.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(52116014)(376014)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: EwmdYVqzsJ/d41/7/3SiMDjP+BZ3SX+vF/G7qIFvbPrD3KBltyLy1Rcq27P8saHJItsxc/KOffJ5qE1ajgWocxSm25jwK+fjNnJNufH5VmD8roWjMi1r6EJ1SyN/KKCWWrG1XSLthsPSjLcIuiIVw1WTDaABH7NQV8clfOvA5EX9LeK+TBBLAgo81ShYGd9gqYVAEYUIj2AyHVm64pmZ/D45ZMbj7aqJyEto1ur8pu2jfivDZxDCSLRnkfYfJkSP1X2sqAWJAUdjYZTE6EMFyKQ2dbK73EgWsKiUiDYgqlRS+DQie0ouTRyO0aRfHYlUfw7z09PMD4SJWjXN9v7SOz/mylk2YIbA6pwRHrnOJL4BHreuJvxPSyZgyBp9uDTsM2l5myhajlJydMxG+l6ReBzSq8wQDZnhXA2XI3CpWDaOurzTxKYTAu69ha5o4NVULEna+TQsLNMVYXk7sWtDIxDEc3sZaUScDJx8o3vjkYeY26tOi9jimOIrkoYabOfXf56kPUTV9oC6zUhlne6kCTTPo3iQF70HTHdOMbjGcX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orOrg: windriver.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6bd1b9be-5eb0-4e46-c897-08dd104d0df3 X-MS-Exchange-CrossTenant-AuthSource: LV3PR11MB8602.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Nov 2024 08:08:48.9837 (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: R/FanB59rxAa1tr5f5GOBFOKtjpYU5IW0LJ0kqX//ygJs6vkjKpLGM96xBm3XAYdEW2p8kyUmWboISUNP74wty47RGq+1wAQLLUxYjx9TG4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR11MB8150 X-Proofpoint-GUID: f1SOP6fy7oxOzcNSKpCsLkxukiQt0GJO X-Proofpoint-ORIG-GUID: c7aTpBodQRNvKjcJWTZgcVbDRgwTMJGq X-Authority-Analysis: v=2.4 cv=QYicvtbv c=1 sm=1 tr=0 ts=67497693 cx=c_pps a=7lEIVCGJCL/qymYIH7Lzhw==:117 a=wKuvFiaSGQ0qltdbU6+NXLB8nM8=:19 a=Ol13hO9ccFRV9qXi2t6ftBPywas=:19 a=xqWC_Br6kY4A:10 a=VlfZXiiP6vEA:10 a=bRTqI5nwn0kA:10 a=t7CeM3EgAAAA:8 a=3hnehoe8rIjwMn6jgKYA:9 a=FdTzh2GWekK77mhwV6Dw:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1057,Hydra:6.0.680,FMLib:17.12.68.34 definitions=2024-11-29_06,2024-11-28_01,2024-11-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 impostorscore=0 clxscore=1015 priorityscore=1501 lowpriorityscore=0 spamscore=0 mlxlogscore=999 suspectscore=0 adultscore=0 mlxscore=0 malwarescore=0 bulkscore=0 classifier=spam authscore=0 adjust=0 reason=mlx scancount=1 engine=8.21.0-2411120000 definitions=main-2411290065 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Fri, 29 Nov 2024 08:08:53 -0000 X-Groupsio-URL: https://lists.openembedded.org/g/openembedded-core/message/208006 From: Deepthi Hemraj YOCTO [#15061] Rust multilib sdks broken because of the conflicts between attempted installs of rust-cross-canadian for multilibs Multilibs trying to install cargo.sh and rust.sh in the same path which resulted in the issue The target dependent variables are retained on the rust-cross-canadian and others are moved to the nativesdk-cargo recipe. By appending ${RUST_TARGET_SYS} to environment script filenames, conflicts between architectures are resolved. Signed-off-by: Deepthi Hemraj --- meta/recipes-devtools/rust/cargo_1.80.1.bb | 2 +- meta/recipes-devtools/rust/rust-cross-canadian.inc | 6 ++---- meta/recipes-devtools/rust/rust_1.80.1.bb | 13 +++++++++++++ 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/meta/recipes-devtools/rust/cargo_1.80.1.bb b/meta/recipes-devtools/rust/cargo_1.80.1.bb index 623cda0471..e67e7e9254 100644 --- a/meta/recipes-devtools/rust/cargo_1.80.1.bb +++ b/meta/recipes-devtools/rust/cargo_1.80.1.bb @@ -61,7 +61,7 @@ do_install:append:class-nativesdk() { export CARGO_TARGET_${RUST_HOST_TRIPLE}_RUNNER="\$OECORE_NATIVE_SYSROOT/lib/${SDKLOADER}" export CARGO_HOME="\$OECORE_TARGET_SYSROOT/home/cargo" mkdir -p "\$CARGO_HOME" - if [ ! -f "\$CARGO_HOME/config" ]; then + if ! grep -q '^\[build\]' "\$CARGO_HOME/config"; then touch "\$CARGO_HOME/config" echo "[build]" >> "\$CARGO_HOME/config" echo 'linker = "target-rust-ccld"' >> "\$CARGO_HOME/config" diff --git a/meta/recipes-devtools/rust/rust-cross-canadian.inc b/meta/recipes-devtools/rust/rust-cross-canadian.inc index b2a212df40..4941914b74 100644 --- a/meta/recipes-devtools/rust/rust-cross-canadian.inc +++ b/meta/recipes-devtools/rust/rust-cross-canadian.inc @@ -54,18 +54,16 @@ do_install () { ENV_SETUP_DIR=${D}${base_prefix}/environment-setup.d mkdir "${ENV_SETUP_DIR}" - RUST_ENV_SETUP_SH="${ENV_SETUP_DIR}/rust.sh" + RUST_ENV_SETUP_SH="${ENV_SETUP_DIR}/${RUST_TARGET_SYS}_rust.sh" RUST_TARGET_TRIPLE=`echo ${RUST_TARGET_SYS} | tr '[:lower:]' '[:upper:]' | sed 's/-/_/g'` SDKLOADER=${@bb.utils.contains('SDK_ARCH', 'x86_64', 'ld-linux-x86-64.so.2', '', d)}${@bb.utils.contains('SDK_ARCH', 'i686', 'ld-linux.so.2', '', d)}${@bb.utils.contains('SDK_ARCH', 'aarch64', 'ld-linux-aarch64.so.1', '', d)}${@bb.utils.contains('SDK_ARCH', 'ppc64le', 'ld64.so.2', '', d)}${@bb.utils.contains('SDK_ARCH', 'riscv64', 'ld-linux-riscv64-lp64d.so.1', '', d)} cat <<- EOF > "${RUST_ENV_SETUP_SH}" export CARGO_TARGET_${RUST_TARGET_TRIPLE}_RUSTFLAGS="--sysroot=\$OECORE_TARGET_SYSROOT/usr -C link-arg=--sysroot=\$OECORE_TARGET_SYSROOT" - export RUST_TARGET_PATH="\$OECORE_NATIVE_SYSROOT/usr/lib/${TARGET_SYS}/rustlib" export CARGO_HOME="\$OECORE_TARGET_SYSROOT/home/cargo" mkdir -p "\$CARGO_HOME" - # Init the default target once, it might be otherwise user modified. - if [ ! -f "\$CARGO_HOME/config" ]; then + if ! grep -q '^\[target.${RUST_TARGET_SYS}]' "\$CARGO_HOME/config"; then touch "\$CARGO_HOME/config" echo 'target = "'${RUST_TARGET_SYS}'"' >> "\$CARGO_HOME/config" echo '# TARGET_SYS' >> "\$CARGO_HOME/config" diff --git a/meta/recipes-devtools/rust/rust_1.80.1.bb b/meta/recipes-devtools/rust/rust_1.80.1.bb index eae1f28bb8..544f2ac8a0 100644 --- a/meta/recipes-devtools/rust/rust_1.80.1.bb +++ b/meta/recipes-devtools/rust/rust_1.80.1.bb @@ -271,8 +271,21 @@ rust_do_install:class-nativesdk() { rm ${D}${libdir}/rustlib/uninstall.sh rm ${D}${libdir}/rustlib/install.log rm ${D}${libdir}/rustlib/manifest* + + ENV_SETUP_DIR=${D}${base_prefix}/environment-setup.d + mkdir "${ENV_SETUP_DIR}" + RUST_ENV_SETUP_SH="${ENV_SETUP_DIR}/rust.sh" + + cat <<- EOF > "${RUST_ENV_SETUP_SH}" + export RUST_TARGET_PATH="\$RUST_TARGET_PATH:\$OECORE_NATIVE_SYSROOT/usr/lib/${TARGET_SYS}/rustlib" + EOF + + chown -R root.root ${D} + } +FILES:${PN} += "${base_prefix}/environment-setup.d" + EXTRA_TOOLS ?= "cargo-clippy clippy-driver rustfmt" rust_do_install:class-target() { export PSEUDO_UNLOAD=1