public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
From: Paul Barker <paul@pbarker.dev>
To: Harish.Sadineni@windriver.com, bruce.ashfield@gmail.com
Cc: Randy.MacLeod@windriver.com, Sundeep.Kokkonda@windriver.com,
	 alistair.francis@wdc.com, yoann.congal@smile.fr,
	elmehdi.younes@smile.fr,  richard.purdie@linuxfoundation.org,
	"openembedded-core@lists.openembedded.org"
	<openembedded-core@lists.openembedded.org>
Subject: Re: [OE-core] [PATCH v5 00/15] Enable rust support for linux kernel
Date: Wed, 04 Feb 2026 12:24:21 +0000	[thread overview]
Message-ID: <30102f29586e11b8f44d2af5c22a5cf89b95cf97.camel@pbarker.dev> (raw)
In-Reply-To: <443dd67d8398b30df2e6eb62ab06fc2433f62273.camel@pbarker.dev>

[-- Attachment #1: Type: text/plain, Size: 7760 bytes --]

On Wed, 2026-02-04 at 12:00 +0000, Paul Barker wrote:
> On Thu, 2026-01-29 at 08:38 -0800, Sadineni, Harish via
> lists.openembedded.org wrote:
> > From: Harish Sadineni <Harish.Sadineni@windriver.com>
> > 
> > v5:
> > - Regression in autobuilder with v4 series is due to applying v4 series together with following patch 
> >   "llvm: enable LLVMgold.so build by adding binutils dependency"(https://lists.openembedded.org/g/openembedded-core/message/229387)
> >   is fixed by droping Alistair Francis's patch(https://lists.openembedded.org/g/openembedded-core/message/229091).
> > - Updated patch "rust: install Rust library sources for 'make rustavailable' support" to install 
> >   rust standard library sources for rust-native. 
> > 
> > v4:
> > - Resolved patchtest failures.
> > 
> > v3:
> > - Removed the DISTRO_FEATURES dependency for installing Rust library sources in the Rust recipe,
> > - Extended support for on target rust kernel module developmet by installing Rust library sources and
> >   introduced packaging of the Rust standard library sources in a dedicated ${PN}-src-lib package.
> > - Integrated Alistair Francis's patch(https://lists.openembedded.org/g/openembedded-core/message/229091)
> >   that uses the Rust bootstrap tool to install Rust library sources for rust-native.
> > - Dropped the patch that added rust-kernel to native/nativesdk feature filters in bitbake.conf.
> > - Updated flags in the make-mod-scripts recipe to fix build failures when building Rust out-of-tree
> >   module recipes.
> > - Dropped the bindgen-cli patch extending BBCLASSEXTEND to include
> >   nativesdk, as it has been merged into oe-core.
> > 
> > v2:
> > - Combined [PATCH 05/16][0] & [PATCH 06/16][1] from v1.
> > - Updated commit message and added in code comments for patch "[PATCH 09/15] kernel-devsrc: copying
> >   rust-kernel source to $kerneldir/build"
> > 
> > [0] https://lists.openembedded.org/g/openembedded-core/message/228559
> > [1] https://lists.openembedded.org/g/openembedded-core/message/228560
> > 
> > v1:
> > The previous series was RFC v4, "Enable Rust support for Linux kernel"
> > (https://lists.openembedded.org/g/openembedded-core/message/226623).
> > 
> > In addition, Yoann Congal posted RFC v2, "Kernel Rust out-of-tree module support"
> > (https://lists.openembedded.org/g/openembedded-core/message/227281), which builds on top of RFC v4.
> > 
> > The current patch series is a unified version that combines both efforts.
> > Compared to the earlier series, the main changes are:
> > 
> > -Kernel configuration fragments have been moved to yocto-kernel-cache.
> > -The kernel fragments have been removed from SRC_URI and from the files
> >  directory previously stored underrecipes-kernel/linux/files.
> > -Updated the "[PATCH 11/16] selftest/cases/runtime_test: Add test for Linux Rust sample"
> >  by appending KERNEL_EXTRA_FEATURES:append = 'features/kernel-sample/kernel-rust-sample.scc'
> >  instead of adding this directly in the linux-yocto recipe.
> > 
> > 
> > This patch series introduces Rust support into the linux-yocto kernel recipe and
> > related build infrastructure in the Yocto Project. The goal is to enable building
> > the Linux kernel with Rust components and provide support for building kernel module
> > which is written in rust and also provide support to build rust kernel modules in sdk.
> > 
> > And this series adds test for Linux Rust sample and also added support
> > for out-of-tree kernel module written in Rust as well as associated test.
> > 
> > Summary of patches:
> > 
> > - Patch 01: Add required dependencies ('clang-native', 'rust-native','bindgen-cli-native') to the kernel to support Rust binding generation.
> > - Patch 02: Install the Rust standard library source ('library/') for  native,target and sdk.
> > - Patch 03: Updated `kernel-yocto.bbclass` to invoke `make rustavailable` during 'do_kernel_configme', ensuring Rust readiness.
> > - Patch 04: Add kernel configuration support for Rust (via 'kernel-rust.scc'), enabling the Rust build options in kernel config.
> > - Patch 05: Fixed buildpaths errors when rust is enabled for kernel by appending --remap-path-prefix to RUST_DEBUG_REMAP
> > - Patch 06: split `HOSTCC` flag to align with to linux-yocto and fix build issue with make-mod-scripts recipe.
> > - Patch 07: Disabling ccache when rust-kernel is enabled for linux-yocto.
> > - Patch 08: Copy Rust kernel sources into kernel-devsrc build directory which will be required while running 'make prepare' in sdk.
> > - Patch 09: Added oe-selftest case for the Linux Rust sample.
> > - patch 10: Copying include/config/auto.conf in STAGING_KERNEL_BUILDDIR
> > - patch 11: Export artifacts needed for out-of-tree Rust compilation
> > - patch 12: Prepare out-of-tree rust module compilation
> > - patch 13: Added rust-out-of-tree-module recipe in meta-skeleton layer
> > - Patch 14: Fixed buildpaths errors for rust-out-of-tree-module recipe by appending --remap-path-prefix to RUST_DEBUG_REMAP
> > - patch 15: Added rust-out-of-tree selftest
> > 
> > Patches have been build-tested successfully on:
> > - qemuarm64
> > - qemux86-64
> > 
> > Benchmark test-result for x86-64:
> > +-------------------------------+------------+-----------+-----------+-----------+
> > > DISTRO_FEATURES               |   real     |   user    |    sys    |  FS usage |
> > +-------------------------------+------------+-----------+-----------+-----------+
> > > rust-kernel (enabled)         | 46m1.720s  | 0m28.864s | 0m3.696s  |   58 GB   |
> > > rust-kernel (disabled)        | 30m1.053s  | 0m20.091s | 0m2.748s  |   33 GB   |
> > +-------------------------------+------------+-----------+-----------+-----------+
> 
> We discussed these patches on Monday and have some feedback on the
> design. Things are nearly correct, we do want to ensure that the user
> experience is good before merging this though as people will quickly
> start to depend on it.
> 
> We think it would be better if Rust support was controlled by
> KERNEL_FEATURES instead of DISTRO_FEATURES. This option now only impacts
> the kernel and any kernel module recipes. It also may need to change
> depending on MACHINE which makes it not a good fit for DISTRO_FEATURES -
> e.g. one BSP may use an older LTS kernel with no required Rust code and
> a different BSP may use a newer kernel and need a driver written in Rust
> for the board to function.
> 
> We should add a new module-rust.bbclass instead of extending
> module.bbclass with conditional logic. This can be included by any
> modules which use Rust and handle any common setup. It can also check
> for the presence of required files (scripts/target.json & rust/*) in the
> kernel's shared workdir, and perhaps the kernel config so that we can
> give a sensible error message if they are missing. This means that
> module-rust.bbclass doesn't need to check KERNEL_FEATURES for
> rust-kernel, it can just look at the shared workdir (probably in
> do_configure) to make sure that we're ready to build a Rust module.

After I sent this, I spotted a patch for module.bbclass to check that
CONFIG_MODULES is enabled [1]. Doing the same thing in a new
module-rust.bbclass to check for CONFIG_RUST may be exactly what we
need.

[1]: https://lore.kernel.org/openembedded-core/20260204020908.864912-1-kai.kang@windriver.com/T/#u

> 
> If we can't use KERNEL_FEATURES, then perhaps a new KERNEL_RUST_SUPPORT
> variable would work. In either case, this should only be checked in the
> kernel recipe itself.
> 
> Bruce - what do you think about KERNEL_FEATURES being used in this way?
> 
> Best regards,
> 

-- 
Paul Barker


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 252 bytes --]

  reply	other threads:[~2026-02-04 12:24 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-29 16:38 [PATCH v5 00/15] Enable rust support for linux kernel Harish.Sadineni
2026-01-29 16:38 ` [PATCH v5 01/15] linux-yocto: conditionally add clang/rust/bindgen-cli-native to DEPENDS Harish.Sadineni
2026-01-29 16:38 ` [PATCH v5 02/15] rust: install Rust library sources for 'make rustavailable' support Harish.Sadineni
2026-01-29 16:38 ` [PATCH v5 03/15] kernel-yocto: enable Rust kernel support via 'make rustavailable' Harish.Sadineni
2026-01-29 16:38 ` [PATCH v5 04/15] linux-yocto: enable Rust support in kernel configuration Harish.Sadineni
2026-01-29 16:39 ` [PATCH v5 05/15] kernel-yocto: Fix for buildpaths errors when rust is enabled for kernel Harish.Sadineni
2026-02-04 12:03   ` [OE-core] " Paul Barker
2026-01-29 16:39 ` [PATCH v5 06/15] make-mod-scripts: split `HOSTCC` flag to align with to linux-yocto Harish.Sadineni
2026-01-29 16:39 ` [PATCH v5 07/15] kernel-yocto.bbclass: Disable ccache when rust-kernel is enabled Harish.Sadineni
2026-02-04 12:05   ` [OE-core] " Paul Barker
2026-02-04 12:31     ` Yoann Congal
2026-02-04 12:34       ` Richard Purdie
2026-02-04 13:07         ` Yoann Congal
2026-02-10 15:24           ` Yoann Congal
2026-02-11 11:47             ` Harish Sadineni
2026-01-29 16:39 ` [PATCH v5 08/15] kernel-devsrc: copying rust-kernel source to $kerneldir/build Harish.Sadineni
2026-01-29 16:39 ` [PATCH v5 09/15] selftest/cases/runtime_test: Add test for Linux Rust sample Harish.Sadineni
2026-01-29 16:39 ` [PATCH v5 10/15] kernel.bbclass: Copy include/config/auto.conf in STAGING_KERNEL_BUILDDIR Harish.Sadineni
2026-01-29 16:39 ` [PATCH v5 11/15] kernel.bbclass: Export artifacts needed for out-of-tree Rust compilation Harish.Sadineni
2026-01-29 16:39 ` [PATCH v5 12/15] module.bbclass: Prepare out-of-tree rust module compilation Harish.Sadineni
2026-01-29 16:39 ` [PATCH v5 13/15] meta-skeleton: Add rust-out-of-tree-module recipe Harish.Sadineni
2026-01-29 16:39 ` [PATCH v5 14/15] make-mod-scripts: fix for buildpath issues with rust-out-of-tree compilation Harish.Sadineni
2026-02-04 12:08   ` [OE-core] " Paul Barker
2026-01-29 16:39 ` [PATCH v5 15/15] runtime_test: Add rust-out-of-tree selftest Harish.Sadineni
2026-01-29 16:47 ` [PATCH v5 00/15] Enable rust support for linux kernel Sadineni, Harish
2026-02-04 12:00 ` [OE-core] " Paul Barker
2026-02-04 12:24   ` Paul Barker [this message]
2026-02-04 13:52     ` Bruce Ashfield
2026-02-12 18:13     ` Harish Sadineni
2026-02-04 13:54   ` Bruce Ashfield
     [not found] ` <188F412032A5A3F8.3408700@lists.openembedded.org>
2026-02-11 16:19   ` [OE-core] [PATCH v5 11/15] kernel.bbclass: Export artifacts needed for out-of-tree Rust compilation Harish Sadineni
2026-02-12 11:25     ` Yoann Congal
2026-02-12 12:44       ` 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=30102f29586e11b8f44d2af5c22a5cf89b95cf97.camel@pbarker.dev \
    --to=paul@pbarker.dev \
    --cc=Harish.Sadineni@windriver.com \
    --cc=Randy.MacLeod@windriver.com \
    --cc=Sundeep.Kokkonda@windriver.com \
    --cc=alistair.francis@wdc.com \
    --cc=bruce.ashfield@gmail.com \
    --cc=elmehdi.younes@smile.fr \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=richard.purdie@linuxfoundation.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