summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/rust
diff options
context:
space:
mode:
authorHarish Sadineni <Harish.Sadineni@windriver.com>2025-02-06 03:53:17 -0800
committerSteve Sakoman <steve@sakoman.com>2025-02-12 06:25:37 -0800
commitc61736066eaa405dcebcd9721500570004560b21 (patch)
treea65e5d778e37663aaa6bf84d3dc1a063527ad608 /meta/recipes-devtools/rust
parentd1f9cbae402f2e423d9ac31cb063de6f6e6c2b87 (diff)
downloadpoky-c61736066eaa405dcebcd9721500570004560b21.tar.gz
rust: fix for rust multilib sdk configuration
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 (From OE-Core rev: 889cda30baccd43e5c82b38752b462aef4ce626c) Signed-off-by: Harish Sadineni <Harish.Sadineni@windriver.com> Signed-off-by: Steve Sakoman <steve@sakoman.com>
Diffstat (limited to 'meta/recipes-devtools/rust')
-rw-r--r--meta/recipes-devtools/rust/cargo_1.75.0.bb13
-rw-r--r--meta/recipes-devtools/rust/rust-cross-canadian.inc10
-rw-r--r--meta/recipes-devtools/rust/rust_1.75.0.bb12
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() {
50 # sets to libdir but not base_libdir leading to symbol mismatches depending on the 50 # sets to libdir but not base_libdir leading to symbol mismatches depending on the
51 # host OS. Fully set LD_LIBRARY_PATH to contain both to avoid this. 51 # host OS. Fully set LD_LIBRARY_PATH to contain both to avoid this.
52 create_wrapper ${D}/${bindir}/cargo LD_LIBRARY_PATH=${libdir}:${base_libdir} 52 create_wrapper ${D}/${bindir}/cargo LD_LIBRARY_PATH=${libdir}:${base_libdir}
53
54 ENV_SETUP_DIR=${D}${base_prefix}/environment-setup.d
55 mkdir "${ENV_SETUP_DIR}"
56 CARGO_ENV_SETUP_SH="${ENV_SETUP_DIR}/cargo.sh"
57
58 cat <<- EOF > "${CARGO_ENV_SETUP_SH}"
59 # Keep the below off as long as HTTP/2 is disabled.
60 export CARGO_HTTP_MULTIPLEXING=false
61
62 export CARGO_HTTP_CAINFO="\$OECORE_NATIVE_SYSROOT/etc/ssl/certs/ca-certificates.crt"
63 EOF
53} 64}
54 65
66FILES:${PN} += "${base_prefix}/environment-setup.d"
67
55# Disabled due to incompatibility with libgit2 0.28.x (https://github.com/rust-lang/git2-rs/issues/458, https://bugs.gentoo.org/707746#c1) 68# Disabled due to incompatibility with libgit2 0.28.x (https://github.com/rust-lang/git2-rs/issues/458, https://bugs.gentoo.org/707746#c1)
56# as shipped by Yocto Dunfell. 69# as shipped by Yocto Dunfell.
57# According to https://github.com/rust-lang/git2-rs/issues/458#issuecomment-522567539, there are no compatibility guarantees between 70# 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 () {
53 53
54 ENV_SETUP_DIR=${D}${base_prefix}/environment-setup.d 54 ENV_SETUP_DIR=${D}${base_prefix}/environment-setup.d
55 mkdir "${ENV_SETUP_DIR}" 55 mkdir "${ENV_SETUP_DIR}"
56 RUST_ENV_SETUP_SH="${ENV_SETUP_DIR}/rust.sh" 56 RUST_ENV_SETUP_SH="${ENV_SETUP_DIR}/${RUST_TARGET_SYS}_rust.sh"
57 57
58 RUST_TARGET_TRIPLE=`echo ${RUST_TARGET_SYS} | tr '[:lower:]' '[:upper:]' | sed 's/-/_/g'` 58 RUST_TARGET_TRIPLE=`echo ${RUST_TARGET_SYS} | tr '[:lower:]' '[:upper:]' | sed 's/-/_/g'`
59 RUST_HOST_TRIPLE=`echo ${RUST_HOST_SYS} | tr '[:lower:]' '[:upper:]' | sed 's/-/_/g'`
60 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)}
61 59
62 cat <<- EOF > "${RUST_ENV_SETUP_SH}" 60 cat <<- EOF > "${RUST_ENV_SETUP_SH}"
63 export CARGO_TARGET_${RUST_TARGET_TRIPLE}_RUSTFLAGS="--sysroot=\$OECORE_TARGET_SYSROOT/usr -C link-arg=--sysroot=\$OECORE_TARGET_SYSROOT" 61 export CARGO_TARGET_${RUST_TARGET_TRIPLE}_RUSTFLAGS="--sysroot=\$OECORE_TARGET_SYSROOT/usr -C link-arg=--sysroot=\$OECORE_TARGET_SYSROOT"
64 export CARGO_TARGET_${RUST_HOST_TRIPLE}_RUNNER="\$OECORE_NATIVE_SYSROOT/lib/${SDKLOADER}"
65 export RUST_TARGET_PATH="\$OECORE_NATIVE_SYSROOT/usr/lib/${TARGET_SYS}/rustlib" 62 export RUST_TARGET_PATH="\$OECORE_NATIVE_SYSROOT/usr/lib/${TARGET_SYS}/rustlib"
66 EOF 63 EOF
67 64
@@ -80,11 +77,6 @@ do_install () {
80 echo '[target.'${RUST_TARGET_SYS}']' >> "\$CARGO_HOME/config" 77 echo '[target.'${RUST_TARGET_SYS}']' >> "\$CARGO_HOME/config"
81 echo 'linker = "target-rust-ccld"' >> "\$CARGO_HOME/config" 78 echo 'linker = "target-rust-ccld"' >> "\$CARGO_HOME/config"
82 fi 79 fi
83
84 # Keep the below off as long as HTTP/2 is disabled.
85 export CARGO_HTTP_MULTIPLEXING=false
86
87 export CARGO_HTTP_CAINFO="\$OECORE_NATIVE_SYSROOT/etc/ssl/certs/ca-certificates.crt"
88 EOF 80 EOF
89} 81}
90 82
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() {
270 rm ${D}${libdir}/rustlib/uninstall.sh 270 rm ${D}${libdir}/rustlib/uninstall.sh
271 rm ${D}${libdir}/rustlib/install.log 271 rm ${D}${libdir}/rustlib/install.log
272 rm ${D}${libdir}/rustlib/manifest* 272 rm ${D}${libdir}/rustlib/manifest*
273
274 ENV_SETUP_DIR=${D}${base_prefix}/environment-setup.d
275 mkdir "${ENV_SETUP_DIR}"
276 RUST_ENV_SETUP_SH="${ENV_SETUP_DIR}/rust.sh"
277 RUST_HOST_TRIPLE=`echo ${RUST_HOST_SYS} | tr '[:lower:]' '[:upper:]' | sed 's/-/_/g'`
278 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)}
279
280 cat <<- EOF > "${RUST_ENV_SETUP_SH}"
281 export CARGO_TARGET_${RUST_HOST_TRIPLE}_RUNNER="\$OECORE_NATIVE_SYSROOT/lib/${SDKLOADER}"
282 EOF
273} 283}
274 284
285FILES:${PN} += "${base_prefix}/environment-setup.d"
286
275EXTRA_TOOLS ?= "cargo-clippy clippy-driver rustfmt" 287EXTRA_TOOLS ?= "cargo-clippy clippy-driver rustfmt"
276rust_do_install:class-target() { 288rust_do_install:class-target() {
277 export PSEUDO_UNLOAD=1 289 export PSEUDO_UNLOAD=1