diff mbox series

[V4] rust-cross-canadian: Fix file conflicts for arm and aarch64

Message ID 20241104112128.1548308-1-Deepthi.Hemraj@windriver.com
State New
Headers show
Series [V4] rust-cross-canadian: Fix file conflicts for arm and aarch64 | expand

Commit Message

Hemraj, Deepthi Nov. 4, 2024, 11:21 a.m. UTC
From: Deepthi Hemraj <Deepthi.Hemraj@windriver.com>

[YOCTO #15061]
Rust multilib sdks broken because of the conflicts between attempted installs of rust-cross-canadian for arm and aarch64.

Arm and aarch64 target architectures are trying to install cargo.sh and rust.sh in the same path which resulted in the issue

The modification installs the scripts in different folders based on the target acrhitecture and hence prevents the conflicts.

Signed-off-by: Deepthi Hemraj <Deepthi.Hemraj@windriver.com>
---
 meta/recipes-devtools/rust/rust-cross-canadian.inc | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Richard Purdie Nov. 4, 2024, 11:31 a.m. UTC | #1
On Mon, 2024-11-04 at 03:21 -0800, Hemraj, Deepthi via lists.openembedded.org wrote:
> From: Deepthi Hemraj <Deepthi.Hemraj@windriver.com>
> 
> [YOCTO #15061]
> Rust multilib sdks broken because of the conflicts between attempted installs of rust-cross-canadian for arm and aarch64.
> 
> Arm and aarch64 target architectures are trying to install cargo.sh and rust.sh in the same path which resulted in the issue
> 
> The modification installs the scripts in different folders based on the target acrhitecture and hence prevents the conflicts.
> 
> Signed-off-by: Deepthi Hemraj <Deepthi.Hemraj@windriver.com>
> ---
>  meta/recipes-devtools/rust/rust-cross-canadian.inc | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/meta/recipes-devtools/rust/rust-cross-canadian.inc b/meta/recipes-devtools/rust/rust-cross-canadian.inc
> index c34b839d15..81d46a45e0 100644
> --- a/meta/recipes-devtools/rust/rust-cross-canadian.inc
> +++ b/meta/recipes-devtools/rust/rust-cross-canadian.inc
> @@ -52,8 +52,8 @@ do_install () {
>      chmod +x "$outfile"
>      create_sdk_wrapper "${SYS_BINDIR}/target-rust-ccld-wrapper" "CC"
>  
> -    ENV_SETUP_DIR=${D}${base_prefix}/environment-setup.d
> -    mkdir "${ENV_SETUP_DIR}"
> +    ENV_SETUP_DIR=${D}${base_prefix}/environment-setup.d/${TRANSLATED_TARGET_ARCH}
> +    mkdir -p "${ENV_SETUP_DIR}"
>      RUST_ENV_SETUP_SH="${ENV_SETUP_DIR}/rust.sh"
>  
>      RUST_TARGET_TRIPLE=`echo ${RUST_TARGET_SYS} | tr '[:lower:]' '[:upper:]' | sed 's/-/_/g'`
> @@ -89,5 +89,5 @@ do_install () {
>  	EOF
>  }
>  
> -FILES:${PN} += "${base_prefix}/environment-setup.d"
> +FILES:${PN} += "${base_prefix}/environment-setup.d/${TRANSLATED_TARGET_ARCH}"

This has the same issue as the original patch. Instead of renaming the
file, it is being placed in a different directory. This avoids
conflicts but means two scripts are still being installed in a given
environment.

I'm still not seeing an explaintion of which one should "win" in such
cases or how the selection is made.

As far as I can tell the patch "papers over" a build issue and creates
a runtime usage issue instead.

Cheers,

Richard
diff mbox series

Patch

diff --git a/meta/recipes-devtools/rust/rust-cross-canadian.inc b/meta/recipes-devtools/rust/rust-cross-canadian.inc
index c34b839d15..81d46a45e0 100644
--- a/meta/recipes-devtools/rust/rust-cross-canadian.inc
+++ b/meta/recipes-devtools/rust/rust-cross-canadian.inc
@@ -52,8 +52,8 @@  do_install () {
     chmod +x "$outfile"
     create_sdk_wrapper "${SYS_BINDIR}/target-rust-ccld-wrapper" "CC"
 
-    ENV_SETUP_DIR=${D}${base_prefix}/environment-setup.d
-    mkdir "${ENV_SETUP_DIR}"
+    ENV_SETUP_DIR=${D}${base_prefix}/environment-setup.d/${TRANSLATED_TARGET_ARCH}
+    mkdir -p "${ENV_SETUP_DIR}"
     RUST_ENV_SETUP_SH="${ENV_SETUP_DIR}/rust.sh"
 
     RUST_TARGET_TRIPLE=`echo ${RUST_TARGET_SYS} | tr '[:lower:]' '[:upper:]' | sed 's/-/_/g'`
@@ -89,5 +89,5 @@  do_install () {
 	EOF
 }
 
-FILES:${PN} += "${base_prefix}/environment-setup.d"
+FILES:${PN} += "${base_prefix}/environment-setup.d/${TRANSLATED_TARGET_ARCH}"