public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: Harish.Sadineni@windriver.com, openembedded-core@lists.openembedded.org
Cc: Randy.MacLeod@windriver.com, Sundeep.Kokkonda@windriver.com,
	 bruce.ashfield@gmail.com, yoann.congal@smile.fr,
	elmehdi.younes@smile.fr
Subject: Re: [OE-core] [PATCH v2 03/15] rust: install Rust library sources for 'make rustavailable' support
Date: Tue, 30 Dec 2025 15:58:09 +0000	[thread overview]
Message-ID: <eb3a975606e2cf27a04c999158a9d39f2cb7a007.camel@linuxfoundation.org> (raw)
In-Reply-To: <20251230141540.1974380-4-Harish.Sadineni@windriver.com>

On Tue, 2025-12-30 at 06:15 -0800, Sadineni, Harish via lists.openembedded.org wrote:
> From: Harish Sadineni <Harish.Sadineni@windriver.com>
> 
> The `make rustavailable` process (1) 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 them available in sdk
> 
> 1) See the kernel tree for Documentation/rust/quick-start.rst in the section: Requirements: Building
> 
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/rust/quick-start.rst#n145
> 
> Signed-off-by: Harish Sadineni <Harish.Sadineni@windriver.com>
> ---
>  meta/recipes-devtools/rust/rust_1.91.1.bb | 17 +++++++++++++++++
>  1 file changed, 17 insertions(+)
> 
> diff --git a/meta/recipes-devtools/rust/rust_1.91.1.bb b/meta/recipes-devtools/rust/rust_1.91.1.bb
> index a25f65f674..7644ecf2d2 100644
> --- a/meta/recipes-devtools/rust/rust_1.91.1.bb
> +++ b/meta/recipes-devtools/rust/rust_1.91.1.bb
> @@ -63,6 +63,16 @@ do_rust_setup_snapshot () {
>          done
>      fi
>  }
> +
> +do_rust_setup_snapshot:append:class-native () {
> +   if ${@bb.utils.contains('DISTRO_FEATURES', 'rust-kernel', 'true', 'false', d)}; then
> +         if [ ! -d "${TMPDIR}/work-shared/rust" ]; then
> +                mkdir -p ${TMPDIR}/work-shared/rust
> +                cp -r ${RUSTSRC}/library ${TMPDIR}/work-shared/rust/.
> +         fi
> +   fi
> +}
> +
>  addtask rust_setup_snapshot after do_unpack before do_configure
>  addtask do_test_compile after do_configure do_rust_gen_targets
>  do_rust_setup_snapshot[dirs] += "${WORKDIR}/rust-snapshot"
> @@ -314,6 +324,13 @@ rust_do_install:class-nativesdk() {
>  	export CARGO_TARGET_${RUST_HOST_TRIPLE}_RUNNER="\$OECORE_NATIVE_SYSROOT/lib/${SDKLOADER}"
>  	export CC_$RUST_HOST_CC="${CCACHE}${HOST_PREFIX}gcc"
>  	EOF
> +    
> +    if ${@bb.utils.contains('DISTRO_FEATURES', 'rust-kernel', 'true', 'false', d)}; then
> +           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
> +    fi
>  }
>  
>  FILES:${PN} += "${base_prefix}/environment-setup.d"

The commit message should mention the size of these files. Does this
make sense as a distro feature or should we just do this all the time?
Do the nativesdk components get packaged separately? If they were, we
could then make that an SDK feature instead. What happens for on target
kernel module development? Shouldn't there be a target package too?

Cheers,

Richard


  reply	other threads:[~2025-12-30 15:58 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-30 14:15 [PATCH v2 00/15] Enable rust support for linux kernel Harish.Sadineni
2025-12-30 14:15 ` [PATCH v2 01/15] bindgen-cli: extend BBCLASSEXTEND to include nativesdk Harish.Sadineni
2026-01-12  0:10   ` [OE-core] " Alistair Francis
2025-12-30 14:15 ` [PATCH v2 02/15] linux-yocto: conditionally add clang/rust/bindgen-cli-native to DEPENDS Harish.Sadineni
2026-01-12  0:12   ` [OE-core] " Alistair Francis
2025-12-30 14:15 ` [PATCH v2 03/15] rust: install Rust library sources for 'make rustavailable' support Harish.Sadineni
2025-12-30 15:58   ` Richard Purdie [this message]
2026-01-05 16:24     ` [OE-core] " Harish Sadineni
2026-01-06 18:59       ` Randy MacLeod
2026-01-07 16:34         ` Harish Sadineni
2026-01-07 18:21           ` Randy MacLeod
2026-01-07 19:03             ` Richard Purdie
2026-01-12  0:42             ` Alistair Francis
2026-01-13 12:14               ` Harish Sadineni
2025-12-30 14:15 ` [PATCH v2 04/15] bitbake.conf: Include "rust-kernel" in native/nativesdk feature filters Harish.Sadineni
2025-12-30 14:15 ` [PATCH v2 05/15] kernel-yocto: enable Rust kernel support via rustavailable and staged rustlib sources Harish.Sadineni
2025-12-30 14:15 ` [PATCH v2 06/15] linux-yocto: enable Rust support in kernel configuration Harish.Sadineni
2025-12-30 14:15 ` [PATCH v2 07/15] kernel-yocto: Fix for buildpaths errors when rust is enabled for kernel Harish.Sadineni
2025-12-30 14:15 ` [PATCH v2 08/15] kernel-yocto.bbclass: Disable ccache when rust-kernel is enabled Harish.Sadineni
2026-01-14 15:41   ` alban.moizan
2025-12-30 14:15 ` [PATCH v2 09/15] kernel-devsrc: copying rust-kernel source to $kerneldir/build Harish.Sadineni
2025-12-30 14:15 ` [PATCH v2 10/15] selftest/cases/runtime_test: Add test for Linux Rust sample Harish.Sadineni
2026-01-05  9:32   ` [OE-core] " Mathieu Dubois-Briand
2026-01-08  9:39     ` Yoann Congal
2025-12-30 14:15 ` [PATCH v2 11/15] kernel.bbclass: Copy include/config/auto.conf in STAGING_KERNEL_BUILDDIR Harish.Sadineni
2025-12-30 14:15 ` [PATCH v2 12/15] kernel.bbclass: Export artifacts needed for out-of-tree Rust compilation Harish.Sadineni
2025-12-30 14:15 ` [PATCH v2 13/15] module.bbclass: Prepare out-of-tree rust module compilation Harish.Sadineni
2025-12-30 14:15 ` [PATCH v2 14/15] meta-skeleton: Add rust-out-of-tree-module recipe Harish.Sadineni
2025-12-30 14:15 ` [PATCH v2 15/15] runtime_test: Add rust-out-of-tree selftest Harish.Sadineni

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=eb3a975606e2cf27a04c999158a9d39f2cb7a007.camel@linuxfoundation.org \
    --to=richard.purdie@linuxfoundation.org \
    --cc=Harish.Sadineni@windriver.com \
    --cc=Randy.MacLeod@windriver.com \
    --cc=Sundeep.Kokkonda@windriver.com \
    --cc=bruce.ashfield@gmail.com \
    --cc=elmehdi.younes@smile.fr \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=yoann.congal@smile.fr \
    /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