mbox series

[v2,00/18] devtool: ide-sdk: add support for Rust recipes

Message ID 20261109-devtool-ide-sdk-cargo-v2-0-d56134000561@savoirfairelinux.com
Headers show
Series devtool: ide-sdk: add support for Rust recipes | expand

Message

Enguerrand de Ribaucourt Nov. 9, 2026, 1:44 p.m. UTC
Hello, this series introduces support for Rust ide-sdk VS Code
configuration against the Yocto cross-compilation toolchain:

 - editor symbol resolution and linting
 - build task
 - deploy task
 - debugging

It introduces a cargo-example recipe following the model used for
cmake and meson.

The generated configurations can be portable to standalone SDK
installations by manually updating the paths.

C/C++ IntelliSense could provide navigation for native code compiled
by Cargo build scripts, using the recipe compiler and sysroot. This
first series defers it because no mixed-language fixture is available
to validate that workflow.

BitBake generates the Cargo configuration consumed by ide-sdk. This series
updates the parsed configuration and writes its supported TOML values
without adding a new dependency.

I reproduced the selftest coverage expected from other recipe classes,
including configuration analysis up to actual debugging symbol resolution.

I largely used AI generation to write this stack. After many iterations,
I am finally happy with the code and commit history quality of this series.
I also have a documentation commit ready for the manual if this gets
approved.

Any feedback is appreciated. Hope this will help lots of Rust developers
working with Yocto distros :).

Cheers,
Enguerrand de Ribaucourt

Signed-off-by: Enguerrand de Ribaucourt <enguerrand.de-ribaucourt@savoirfairelinux.com>
---
Changes in v2:
- Replace Cargo config in-place update with a simple TOML serializer.
- Add Cargo config parser coverage.
- Generate Cargo config for all IDE modes.
- Route ide=none Cargo debugging through LLDB and explain GDB limitations.
- Configure the rustc problems matcher.
- Map Rust sources with STAGING_LIBDIR_NATIVE.
- Discard C/C++ IntelliSense mixed-language feature.
- Fix bbappend always being modified on re-runs
- Fix '=' ordering in remap
- Fix install task duplication
- Link to v1: https://patch.msgid.link/20261026-devtool-ide-sdk-cargo-v1-0-d4504e124d07@savoirfairelinux.com

Thank you very much for the detailed review Adrian, it's been really
helpful!

---
Enguerrand de Ribaucourt (18):
      cargo-example: add minimal selftest fixture
      devtool: ide-sdk: capture Cargo cross environment
      devtool: ide-sdk: export recipe Cargo configuration
      oeqa/selftest: verify Cargo config serialization
      devtool: ide-sdk: recommend Rust Analyzer for Cargo
      devtool: ide-sdk: configure Rust Analyzer for Cargo
      devtool: ide-sdk: generalize binary install task name
      devtool: ide-sdk: extract install task definition
      devtool: ide-sdk: order install after optional build task
      devtool: ide-sdk: add Cargo build task
      devtool: ide-sdk: enforce LLDB for Cargo
      devtool: ide-sdk: remap Cargo sources for BitBake builds
      devtool: ide-sdk: map Cargo workspace sources for LLDB
      devtool: ide-sdk: map libstd-rs sources to Rust SDK
      oeqa/selftest: share source breakpoint lookup
      oeqa/selftest: run IDE tasks with configured environment
      oeqa/selftest: debug Cargo example over QEMU slirp
      oeqa/selftest: verify Cargo rebuild and redeploy

 meta-selftest/recipes-test/rust/cargo-example.bb   |  15 +
 .../recipes-test/rust/cargo-example/Cargo.lock     |   5 +
 .../recipes-test/rust/cargo-example/Cargo.toml     |   8 +
 .../recipes-test/rust/cargo-example/build.rs       |  20 ++
 .../recipes-test/rust/cargo-example/src/main.rs    |  11 +
 meta/lib/oeqa/selftest/cases/devtool.py            | 347 ++++++++++++++++++++-
 scripts/lib/devtool/ide_plugins/__init__.py        |   1 +
 scripts/lib/devtool/ide_plugins/ide_code.py        |  83 ++++-
 scripts/lib/devtool/ide_plugins/ide_none.py        |   4 +-
 scripts/lib/devtool/ide_sdk.py                     | 249 +++++++++++++--
 10 files changed, 688 insertions(+), 55 deletions(-)
---
base-commit: 39b27e524f3c092e5018cbed23ddf1829390ae65
change-id: 20261022-devtool-ide-sdk-cargo-d003158ae2f1

Best regards,
--  
Enguerrand de Ribaucourt <enguerrand.de-ribaucourt@savoirfairelinux.com>