From: Harish Sadineni <harish.sadin...@windriver.com>

YOCTO [#15061]
The rust sdk installs both 'rust.sh' and 'cargo.sh' for lib32 and lib64 in the 
same location.
This causes below error while installing the lib32 & lib64 binaries:

Error: Transaction test error:
  file 
/usr/local/oe-sdk-hardcoded-buildpath/sysroots/x86_64-pokysdk-linux/environment-setup.d/cargo.sh
conflicts between attempted installs of 
rust-cross-canadian-arm-1.67.1-r0.x86_64_nativesdk and
 rust-cross-canadian-aarch64-1.67.1-r0.x86_64_nativesdk
  file 
/usr/local/oe-sdk-hardcoded-buildpath/sysroots/x86_64-pokysdk-linux/environment-setup.d/rust.sh
conflicts between attempted installs of 
rust-cross-canadian-arm-1.67.1-r0.x86_64_nativesdk and
rust-cross-canadian-aarch64-1.67.1-r0.x86_64_nativesdk
ERROR: Task 
(virtual:multilib:lib32:/media/build/poky/meta/recipes-sato/images/core-image-sato.bb:do_populate_sdk)
failed with exit code '1'

The change includes:
- Prepending '${RUST_TARGET_SYS}' to 'rust.sh' to differentiate between target 
systems.
- Moving the non-target-specific environment variables to 'nativesdk-cargo' and 
'nativesdk-rust',
instead of being managed by the cross-canadian recipe.

Backport from oe-core master: 
https://git.openembedded.org/openembedded-core/commit/?id=40eb4bfe2f100ba5301046ca25110fcc55a640bb

Signed-off-by: Harish Sadineni <harish.sadin...@windriver.com>
Signed-off-by: Steve Sakoman <st...@sakoman.com>
---
 meta/recipes-devtools/rust/cargo_1.75.0.bb         | 13 +++++++++++++
 meta/recipes-devtools/rust/rust-cross-canadian.inc | 10 +---------
 meta/recipes-devtools/rust/rust_1.75.0.bb          | 12 ++++++++++++
 3 files changed, 26 insertions(+), 9 deletions(-)

diff --git a/meta/recipes-devtools/rust/cargo_1.75.0.bb 
b/meta/recipes-devtools/rust/cargo_1.75.0.bb
index 50b7e7c7b4..a6d3f1754b 100644
--- a/meta/recipes-devtools/rust/cargo_1.75.0.bb
+++ b/meta/recipes-devtools/rust/cargo_1.75.0.bb
@@ -50,8 +50,21 @@ do_install:append:class-nativesdk() {
        # sets to libdir but not base_libdir leading to symbol mismatches 
depending on the
        # host OS. Fully set LD_LIBRARY_PATH to contain both to avoid this.
        create_wrapper ${D}/${bindir}/cargo 
LD_LIBRARY_PATH=${libdir}:${base_libdir}
+       
+       ENV_SETUP_DIR=${D}${base_prefix}/environment-setup.d
+       mkdir "${ENV_SETUP_DIR}"
+       CARGO_ENV_SETUP_SH="${ENV_SETUP_DIR}/cargo.sh"
+       
+       cat <<- EOF > "${CARGO_ENV_SETUP_SH}"
+       # Keep the below off as long as HTTP/2 is disabled.
+       export CARGO_HTTP_MULTIPLEXING=false
+       
+       export 
CARGO_HTTP_CAINFO="\$OECORE_NATIVE_SYSROOT/etc/ssl/certs/ca-certificates.crt"
+       EOF
 }
 
+FILES:${PN} += "${base_prefix}/environment-setup.d"
+
 # Disabled due to incompatibility with libgit2 0.28.x 
(https://github.com/rust-lang/git2-rs/issues/458, 
https://bugs.gentoo.org/707746#c1)
 # as shipped by Yocto Dunfell.
 # According to 
https://github.com/rust-lang/git2-rs/issues/458#issuecomment-522567539, there 
are no compatibility guarantees between
diff --git a/meta/recipes-devtools/rust/rust-cross-canadian.inc 
b/meta/recipes-devtools/rust/rust-cross-canadian.inc
index 8a51a02293..4e2e051f1d 100644
--- a/meta/recipes-devtools/rust/rust-cross-canadian.inc
+++ b/meta/recipes-devtools/rust/rust-cross-canadian.inc
@@ -53,15 +53,12 @@ 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'`
-    RUST_HOST_TRIPLE=`echo ${RUST_HOST_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 
CARGO_TARGET_${RUST_HOST_TRIPLE}_RUNNER="\$OECORE_NATIVE_SYSROOT/lib/${SDKLOADER}"
        export 
RUST_TARGET_PATH="\$OECORE_NATIVE_SYSROOT/usr/lib/${TARGET_SYS}/rustlib"
        EOF
 
@@ -80,11 +77,6 @@ do_install () {
                echo '[target.'${RUST_TARGET_SYS}']' >> "\$CARGO_HOME/config"
                echo 'linker = "target-rust-ccld"' >> "\$CARGO_HOME/config"
     fi
-
-       # Keep the below off as long as HTTP/2 is disabled.
-       export CARGO_HTTP_MULTIPLEXING=false
-
-       export 
CARGO_HTTP_CAINFO="\$OECORE_NATIVE_SYSROOT/etc/ssl/certs/ca-certificates.crt"
        EOF
 }
 
diff --git a/meta/recipes-devtools/rust/rust_1.75.0.bb 
b/meta/recipes-devtools/rust/rust_1.75.0.bb
index b041a5f8e4..b9348bf050 100644
--- a/meta/recipes-devtools/rust/rust_1.75.0.bb
+++ b/meta/recipes-devtools/rust/rust_1.75.0.bb
@@ -270,8 +270,20 @@ 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"
+    RUST_HOST_TRIPLE=`echo ${RUST_HOST_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_HOST_TRIPLE}_RUNNER="\$OECORE_NATIVE_SYSROOT/lib/${SDKLOADER}"
+       EOF
 }
 
+FILES:${PN} += "${base_prefix}/environment-setup.d"
+
 EXTRA_TOOLS ?= "cargo-clippy clippy-driver rustfmt"
 rust_do_install:class-target() {
     export PSEUDO_UNLOAD=1
-- 
2.43.0

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#211029): 
https://lists.openembedded.org/g/openembedded-core/message/211029
Mute This Topic: https://lists.openembedded.org/mt/111069734/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to