public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
From: Harish.Sadineni@windriver.com
To: openembedded-core@lists.openembedded.org
Cc: Sundeep.Kokkonda@windriver.com
Subject: [RFC PATCH 3/7] rust: install Rust standard library sources for make rustavailable support
Date: Thu, 23 Oct 2025 04:25:43 -0700	[thread overview]
Message-ID: <20251023112547.4044904-4-Harish.Sadineni@windriver.com> (raw)
In-Reply-To: <20251023112547.4044904-1-Harish.Sadineni@windriver.com>

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

The `make rustavailable` process expects the Rust standard library source files (e.g., `lib.rs`) 
to be present in the `library/` directory under `rustlib/src/rust/`.

This patch ensures the required sources are available by:
- Copying the `library/` directory from the Rust source tree into `${TMPDIR}/work-shared/rust` 
  during the snapshot setup.
- Installing the `library/` directory into `${SDKPATHNATIVE}/usr/lib/rustlib/src/rust` for the 
  `nativesdk` class, making them available in the SDK.

Signed-off-by: Harish Sadineni <Harish.Sadineni@windriver.com>
---
 meta/recipes-devtools/rust/rust_1.90.0.bb | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/meta/recipes-devtools/rust/rust_1.90.0.bb b/meta/recipes-devtools/rust/rust_1.90.0.bb
index 0319d73b93..4b9107b23d 100644
--- a/meta/recipes-devtools/rust/rust_1.90.0.bb
+++ b/meta/recipes-devtools/rust/rust_1.90.0.bb
@@ -54,7 +54,11 @@ do_rust_setup_snapshot () {
     # and fail without it there.
     mkdir -p ${RUSTSRC}/build/${RUST_BUILD_SYS}
     ln -sf ${WORKDIR}/rust-snapshot/ ${RUSTSRC}/build/${RUST_BUILD_SYS}/stage0
-
+    
+    if [ ! -d ${TMPDIR}/work-shared/rust ]; then    
+        mkdir -p ${TMPDIR}/work-shared/rust
+        cp -r ${RUSTSRC}/library ${TMPDIR}/work-shared/rust/.
+    fi
     # Need to use uninative's loader if enabled/present since the library paths
     # are used internally by rust and result in symbol mismatches if we don't
     if [ ! -z "${UNINATIVE_LOADER}" -a -e "${UNINATIVE_LOADER}" ]; then
@@ -288,6 +292,13 @@ rust_do_install() {
     rust_runx install
 }
 
+do_install:append:class-nativesdk () {
+    if [ ! -d ${D}${SDKPATHNATIVE}/usr/lib/rustlib/src/rust ]; then
+        mkdir -p ${D}${SDKPATHNATIVE}/usr/lib/rustlib/src/rust
+        cp -r --no-preserve=ownership  ${S}/library ${D}${SDKPATHNATIVE}/usr/lib/rustlib/src/rust/
+    fi
+}
+
 rust_do_install:class-nativesdk() {
     export PSEUDO_UNLOAD=1
     rust_runx install
-- 
2.49.0



  parent reply	other threads:[~2025-10-23 11:27 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-23 11:25 [RFC PATCH 0/7] Enable rust support for linux kernel Harish.Sadineni
2025-10-23 11:25 ` [RFC PATCH 1/7] bindgen-cli: extend BBCLASSEXTEND to include nativesdk Harish.Sadineni
2025-10-23 11:25 ` [RFC PATCH 2/7] linux-yocto: add clang-native and bindgen-cli-native to DEPENDS Harish.Sadineni
2025-10-23 11:25 ` Harish.Sadineni [this message]
2025-10-23 11:25 ` [RFC PATCH 4/7] rust: stage rustlib sources for linux-yocto make rustavailable support Harish.Sadineni
2025-10-23 11:25 ` [RFC PATCH 5/7] kernel-yocto: add rust support via make rustavailable in do_kernel_configme Harish.Sadineni
2025-10-23 11:25 ` [RFC PATCH 6/7] linux-yocto: enable Rust support in kernel configuration Harish.Sadineni
2025-10-23 15:10   ` El Mehdi YOUNES
2025-11-04 17:43   ` [OE-core] " Randy MacLeod
2025-10-23 11:25 ` [RFC PATCH 7/7] kernel-devsrc: copying rust-kernel soucre to $kerneldir/build Harish.Sadineni
2025-10-23 13:00 ` [OE-core] [RFC PATCH 0/7] Enable rust support for linux kernel Bruce Ashfield
2025-10-23 14:57 ` El Mehdi YOUNES
2025-10-27  6:03 ` [OE-core] " Mathieu Dubois-Briand
2025-11-04 19:50   ` Yoann Congal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251023112547.4044904-4-Harish.Sadineni@windriver.com \
    --to=harish.sadineni@windriver.com \
    --cc=Sundeep.Kokkonda@windriver.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox