public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
* [PATCH] cargo: Drop cargo wrapper to ensure successfull cargo builds in SDK
@ 2025-01-21 10:54 Yash.Shinde
  2025-01-21 11:02 ` [OE-core] " Richard Purdie
  0 siblings, 1 reply; 2+ messages in thread
From: Yash.Shinde @ 2025-01-21 10:54 UTC (permalink / raw)
  To: openembedded-core; +Cc: Randy.MacLeod, Sundeep.Kokkonda

From: Yash Shinde <Yash.Shinde@windriver.com>

- The SDK uses a cargo wrapper that sets LD_LIBRARY_PATH to point to SDK target library directory.
  This wrapper was added to resolve library path errors by including libdir and base_dir paths
  in LD_LIBRARY_PATH for tumbleweed-ty-3 distro.
  (https://git.openembedded.org/openembedded-core/commit/?id=388e7cac9f90e79ce8c3c1683d8ee0f4df1bc907)

- But, a simple 'cargo build' in SDK env caused failures for certain crates due to
  undefined symbol and broken C compiler in SDK. Removing the cargo wrapper builds the crate
  successfully.

- With tumbleweed no longer being part of the tested distributions, drop the cargo wrapper that was
  previously added to address library loading issues on it.
  This resolves the errors seen with 'cargo build' in SDK env.

References:
Tumbleweed removal: https://git.yoctoproject.org/yocto-autobuilder2/commit/?id=96e82ce670c02b166398500435c2df455b09b951
List of tested distros: https://git.yoctoproject.org/yocto-autobuilder2/tree/config.py?id=694d2a9bae523d9396b37da9cc6535a558e04d81#n168

Fixes [YOCTO #15579]
https://bugzilla.yoctoproject.org/show_bug.cgi?id=15579

Signed-off-by: Yash Shinde <Yash.Shinde@windriver.com>
---
 meta/recipes-devtools/rust/cargo_1.81.0.bb | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/meta/recipes-devtools/rust/cargo_1.81.0.bb b/meta/recipes-devtools/rust/cargo_1.81.0.bb
index 123032cdf7..091ac3ae97 100644
--- a/meta/recipes-devtools/rust/cargo_1.81.0.bb
+++ b/meta/recipes-devtools/rust/cargo_1.81.0.bb
@@ -44,14 +44,6 @@ do_install () {
 	install -m 755 "${B}/target/${CARGO_TARGET_SUBDIR}/cargo" "${D}${bindir}"
 }
 
-do_install:append:class-nativesdk() {
-	# To quote the cargo docs, "Cargo also sets the dynamic library path when compiling
-	# and running binaries with commands like `cargo run` and `cargo test`". Sadly it
-	# 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}
-}
-
 # 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
-- 
2.43.0



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-01-21 11:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-21 10:54 [PATCH] cargo: Drop cargo wrapper to ensure successfull cargo builds in SDK Yash.Shinde
2025-01-21 11:02 ` [OE-core] " Richard Purdie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox