On 5/29/2026 3:51 AM, Richard Purdie wrote:
CAUTION: This email comes from a non Wind River email account!
Do not click links or open attachments unless you recognize the sender and know 
the content is safe.

On Thu, 2026-05-28 at 10:22 -0700, Sadineni, Harish via lists.openembedded.org 
wrote:
From: Harish Sadineni <[email protected]>

When KERNEL_FEATURES includes 'rust', add the required host and target
packages to the SDK to support Rust kernel module development.

Host side (TOOLCHAIN_HOST_TASK):
   - nativesdk-bindgen-cli
   - nativesdk-libclang
   - nativesdk-rust-src-lib
   - packagegroup-rust-cross-canadian-${MACHINE}

Target side (TOOLCHAIN_TARGET_TASK):
   - kernel-devsrc

Signed-off-by: Harish Sadineni <[email protected]>
---
  meta/classes-recipe/populate_sdk_base.bbclass | 2 ++
  1 file changed, 2 insertions(+)

diff --git a/meta/classes-recipe/populate_sdk_base.bbclass 
b/meta/classes-recipe/populate_sdk_base.bbclass
index b427ff2761..b345a65db7 100644
--- a/meta/classes-recipe/populate_sdk_base.bbclass
+++ b/meta/classes-recipe/populate_sdk_base.bbclass
@@ -74,12 +74,14 @@ TOOLCHAIN_HOST_TASK ?= " \
      packagegroup-cross-canadian-${MACHINE} \
      ${@bb.utils.contains('SDK_TOOLCHAIN_LANGS', 'go', 
'packagegroup-go-cross-canadian-${MACHINE}', '', d)} \
      ${@bb.utils.contains('SDK_TOOLCHAIN_LANGS', 'rust', 
'packagegroup-rust-cross-canadian-${MACHINE}', '', d)} \
+    ${@bb.utils.contains('KERNEL_FEATURES', 'rust', 'nativesdk-bindgen-cli 
nativesdk-libclang nativesdk-rust-src-lib 
packagegroup-rust-cross-canadian-${MACHINE}', '', d)} \
  "
Similarly to the other patch, I think we need to define these things in
a packagegroup, then perhaps just include them when SDK_TOOLCHAIN_LANGS
contains rust?

Ok, i will add these in packagegroup-rust-cross-canadian and will get included with SDK_TOOLCHAIN_LANGS += "rust". All the dependencies are about 100 mb, So we are not adding any further conditinal checks( KERNEL_FEATURES += "rust").


  TOOLCHAIN_HOST_TASK_ATTEMPTONLY ?= ""
  TOOLCHAIN_TARGET_TASK ?= " \
      ${@multilib_pkg_extend(d, 'packagegroup-core-standalone-sdk-target')} \
      ${@bb.utils.contains('SDK_TOOLCHAIN_LANGS', 'go', multilib_pkg_extend(d, 
'packagegroup-go-sdk-target'), '', d)} \
      ${@bb.utils.contains('SDK_TOOLCHAIN_LANGS', 'rust', 
multilib_pkg_extend(d, 'libstd-rs'), '', d)} \
+    ${@bb.utils.contains('KERNEL_FEATURES', 'rust', 'kernel-devsrc', '', d)} \
This seems a bit odd. Just because you've enabled rust support in the
kernel, it doesn't mean you want kernel-devsrc in the SDK?

A better way of doing this might be something like "kernel" in
SDK_TOOLCHAIN_LANGS to trigger kernel-devsrc?
As the kernel-devsrc may be needed by other dev tools also, so as you said we implement like below for installig kernel-devsrc.
SDK_TOOLCHAIN_LANGS += " kernel"

By doing this, the rust kernel module development support in SDK enabled with below config.
SDK_TOOLCHAIN_LANGS += " rust kernel"

Thanks,
Harish

Cheers,

Richard
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#237755): 
https://lists.openembedded.org/g/openembedded-core/message/237755
Mute This Topic: https://lists.openembedded.org/mt/119534146/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to