Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH v2 1/5] Revert "rust: remove redundant cargo config file"
@ 2025-09-15 10:27 Harish.Sadineni
  2025-09-15 10:27 ` [PATCH v2 2/5] toolchain-scripts.bbclass: Support target-specific environment setup scripts Harish.Sadineni
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Harish.Sadineni @ 2025-09-15 10:27 UTC (permalink / raw)
  To: openembedded-core; +Cc: Sundeep.Kokkonda

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

The 'cargo build' is supposed to build binary for the target but it is
building for Host.
Reverting below commit to make 'cargo build' to built for target as
default in sdk
commit# 37fea972a6fafe360bfbb2d1ac472fa9e060c733.

Signed-off-by: Harish Sadineni <Harish.Sadineni@windriver.com>
---
 meta/recipes-devtools/rust/rust-cross-canadian.inc | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/meta/recipes-devtools/rust/rust-cross-canadian.inc b/meta/recipes-devtools/rust/rust-cross-canadian.inc
index df8b78d326..fcfd178f34 100644
--- a/meta/recipes-devtools/rust/rust-cross-canadian.inc
+++ b/meta/recipes-devtools/rust/rust-cross-canadian.inc
@@ -64,6 +64,20 @@ do_install () {
 
     chown -R root.root ${D}
 
+    CARGO_ENV_SETUP_SH="${ENV_SETUP_DIR}/cargo.sh"
+    cat <<- EOF > "${CARGO_ENV_SETUP_SH}"
+	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
+		touch "\$CARGO_HOME/config"
+		echo "[build]" >> "\$CARGO_HOME/config"
+		echo 'target = "'${RUST_TARGET_SYS}'"' >> "\$CARGO_HOME/config"
+		echo '# TARGET_SYS' >> "\$CARGO_HOME/config"
+		echo '[target.'${RUST_TARGET_SYS}']' >> "\$CARGO_HOME/config"
+		echo 'linker = "target-rust-ccld"' >> "\$CARGO_HOME/config"
+    fi
+	EOF
 }
 
 FILES:${PN} += "${base_prefix}/environment-setup.d"
-- 
2.49.0



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

end of thread, other threads:[~2025-09-23 12:15 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-15 10:27 [PATCH v2 1/5] Revert "rust: remove redundant cargo config file" Harish.Sadineni
2025-09-15 10:27 ` [PATCH v2 2/5] toolchain-scripts.bbclass: Support target-specific environment setup scripts Harish.Sadineni
2025-09-18 15:59   ` [OE-core] " Ross Burton
2025-09-23 12:14     ` Harish Sadineni
2025-09-15 10:27 ` [PATCH v2 3/5] rust-cross-canadian: Add target-specific environment setup support Harish.Sadineni
2025-09-15 10:27 ` [PATCH v2 4/5] oeqa/sdk/cases/rust.py: Add test to verify cargo build builds for target Harish.Sadineni
2025-09-18 16:07   ` [OE-core] " Ross Burton
2025-09-15 10:27 ` [PATCH v2 5/5] rust-cross-canadian: fix cargo run failure for target in sdk Harish.Sadineni

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