Openembedded Core Discussions
 help / color / mirror / Atom feed
From: "adrian.freihofer@gmail.com" <adrian.freihofer@gmail.com>
To: enguerrand.de-ribaucourt@savoirfairelinux.com,
	 openembedded-core@lists.openembedded.org
Cc: Adrian Freihofer <adrian.freihofer@siemens.com>
Subject: Re: [OE-core] [PATCH 16/20] devtool: ide-sdk: map libstd-rs sources to Rust SDK
Date: Thu, 29 Oct 2026 00:23:13 +0100	[thread overview]
Message-ID: <718958f35202004b0294b3f4f947dd215a57a2bf.camel@gmail.com> (raw)
In-Reply-To: <20261026-devtool-ide-sdk-cargo-v1-16-d4504e124d07@savoirfairelinux.com>

On Mon, 2026-10-26 at 09:55 +0100, Enguerrand de Ribaucourt via
lists.openembedded.org wrote:
> libstd-rs DWARF paths use a source prefix under work-shared, while
> rust-native stages the standard-library sources in the recipe native
> sysroot.
> Derive the target prefix from BitBake metadata and map it to the SDK
> source
> tree so LLDB runtime frames resolve without host Rust sources.
> 
> AI-Generated: Uses GitHub Copilot
> Signed-off-by: Enguerrand de Ribaucourt
> <enguerrand.de-ribaucourt@savoirfairelinux.com>
> ---
>  scripts/lib/devtool/ide_plugins/ide_code.py |  2 ++
>  scripts/lib/devtool/ide_sdk.py              | 19 +++++++++++++++++++
>  2 files changed, 21 insertions(+)
> 
> diff --git a/scripts/lib/devtool/ide_plugins/ide_code.py
> b/scripts/lib/devtool/ide_plugins/ide_code.py
> index 596586ee9e..623a54ddc6 100644
> --- a/scripts/lib/devtool/ide_plugins/ide_code.py
> +++ b/scripts/lib/devtool/ide_plugins/ide_code.py
> @@ -568,6 +568,8 @@ class IdeVSCode(IdeBase):
>          }
>          rootfs_dbg = lldb_config.image_recipe.rootfs_dbg
>          is_cargo = modified_recipe.build_tool is BuildTool.CARGO
> +        if is_cargo:
> +            source_map.update(modified_recipe.cargo_std_source_map)
>          if is_cargo or rootfs_dbg:
>              source_root = (
>                  modified_recipe.real_srctree
> diff --git a/scripts/lib/devtool/ide_sdk.py
> b/scripts/lib/devtool/ide_sdk.py
> index 9fd95f0a63..b6ac02e367 100755
> --- a/scripts/lib/devtool/ide_sdk.py
> +++ b/scripts/lib/devtool/ide_sdk.py
> @@ -915,6 +915,7 @@ class RecipeModified:
>          self.cargo_packageconfig_confargs = None
>          self.cargo_rustflags = None
>          self.cargo_env = None
> +        self.cargo_std_source_map = {}
>  
>          # Populated after bitbake built all the recipes
>          self._installed_binaries = None
> @@ -1134,6 +1135,24 @@ class RecipeModified:
>                  'SYSTEM_DEPS_BUILD_INTERNAL': 'never',
>                  'ZSTD_SYS_USE_PKG_CONFIG': '1',
>              })
> +            # libstd-rs DWARF paths map to sources staged by rust-
> native.
> +            libstd_recipe_d = parse_recipe(
> +                config, tinfoil, 'libstd-rs', appends=True,
> +                filter_workspace=False)
> +            if libstd_recipe_d:
> +                libstd_rustsrc = libstd_recipe_d.getVar('RUSTSRC')
> +                target_dbgsrc_dir =
> libstd_recipe_d.getVar('TARGET_DBGSRC_DIR')
> +                libstd_tmpdir = libstd_recipe_d.getVar('TMPDIR')
> +                if libstd_rustsrc and target_dbgsrc_dir and
> libstd_tmpdir:
> +                    shared_source_dir = os.path.join(libstd_tmpdir,
> 'work-shared')
> +                    target_source_root = os.path.join(
> +                        target_dbgsrc_dir,
> +                        os.path.relpath(libstd_rustsrc,
> shared_source_dir),
> +                        'library')
> +                    sdk_source_root = os.path.join(
> +                        self.recipe_sysroot_native,
> self.libdir.lstrip('/'),

The native rustlib path is built with self.libdir (the target libdir).
On multilib (/usr/lib64) it doesn't match the rust-native sysroot.
Please use the native libdir (STAGING_LIBDIR_NATIVE). The selftest
hard-codes usr/lib and so doesn't catch this.

Regards,
Adrian


> +                        'rustlib', 'src', 'rust', 'library')
> +                    self.cargo_std_source_map[target_source_root] =
> sdk_source_root
>              self.build_tool = BuildTool.CARGO
>          elif bb.data.inherits_class('module', recipe_d):
>              self.build_tool = BuildTool.KERNEL_MODULE
> 
> 
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#248654):
> https://lists.openembedded.org/g/openembedded-core/message/248654
> Mute This Topic: https://lists.openembedded.org/mt/121938797/4454582
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe:
> https://lists.openembedded.org/g/openembedded-core/unsub [
> adrian.freihofer@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-

  reply	other threads:[~2026-10-28 23:23 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-26  8:55 [PATCH 00/20] devtool: ide-sdk: add support for Rust recipes Enguerrand de Ribaucourt
2026-10-26  8:55 ` [PATCH 01/20] cargo-example: add minimal selftest fixture Enguerrand de Ribaucourt
2026-10-26  8:55 ` [PATCH 02/20] devtool: ide-sdk: capture Cargo cross environment Enguerrand de Ribaucourt
2026-10-26  8:55 ` [PATCH 03/20] devtool: ide-sdk: export recipe Cargo configuration Enguerrand de Ribaucourt
2026-10-28 22:40   ` [OE-core] " adrian.freihofer
2026-10-26  8:55 ` [PATCH 04/20] devtool: ide-sdk: recommend Rust Analyzer for Cargo Enguerrand de Ribaucourt
2026-10-28 22:48   ` [OE-core] " adrian.freihofer
2026-10-26  8:55 ` [PATCH 05/20] devtool: ide-sdk: configure " Enguerrand de Ribaucourt
2026-10-26  8:55 ` [PATCH 06/20] devtool: ide-sdk: share IntelliSense architecture mapping Enguerrand de Ribaucourt
2026-10-26  8:55 ` [PATCH 07/20] devtool: ide-sdk: configure Cargo C++ IntelliSense Enguerrand de Ribaucourt
2026-10-28 22:59   ` [OE-core] " adrian.freihofer
2026-10-26  8:55 ` [PATCH 08/20] devtool: ide-sdk: generalize binary install task name Enguerrand de Ribaucourt
2026-10-26  8:55 ` [PATCH 09/20] devtool: ide-sdk: extract install task definition Enguerrand de Ribaucourt
2026-10-26  8:55 ` [PATCH 10/20] devtool: ide-sdk: order install after optional build task Enguerrand de Ribaucourt
2026-10-28 23:01   ` [OE-core] " adrian.freihofer
2026-10-26  8:55 ` [PATCH 11/20] devtool: ide-sdk: add Cargo " Enguerrand de Ribaucourt
2026-10-28 23:04   ` [OE-core] " adrian.freihofer
2026-10-26  8:55 ` [PATCH 12/20] devtool: ide-sdk: enforce LLDB for Cargo Enguerrand de Ribaucourt
2026-10-28 23:08   ` [OE-core] " adrian.freihofer
2026-10-26  8:55 ` [PATCH 13/20] devtool: ide-sdk: parse Rust debug path remaps Enguerrand de Ribaucourt
2026-10-28 23:16   ` [OE-core] " adrian.freihofer
2026-10-26  8:55 ` [PATCH 14/20] devtool: ide-sdk: remap Cargo sources for BitBake builds Enguerrand de Ribaucourt
2026-10-28 23:28   ` [OE-core] " adrian.freihofer
2026-10-26  8:55 ` [PATCH 15/20] devtool: ide-sdk: map Cargo workspace sources for LLDB Enguerrand de Ribaucourt
2026-10-26  8:55 ` [PATCH 16/20] devtool: ide-sdk: map libstd-rs sources to Rust SDK Enguerrand de Ribaucourt
2026-10-28 23:23   ` adrian.freihofer [this message]
2026-10-26  8:55 ` [PATCH 17/20] oeqa/selftest: share source breakpoint lookup Enguerrand de Ribaucourt
2026-10-26  8:55 ` [PATCH 18/20] oeqa/selftest: run IDE tasks with configured environment Enguerrand de Ribaucourt
2026-10-26  8:55 ` [PATCH 19/20] oeqa/selftest: debug Cargo example over QEMU slirp Enguerrand de Ribaucourt
2026-10-26  8:55 ` [PATCH 20/20] oeqa/selftest: verify Cargo rebuild and redeploy Enguerrand de Ribaucourt
2026-10-28 23:30 ` [OE-core] [PATCH 00/20] devtool: ide-sdk: add support for Rust recipes adrian.freihofer

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=718958f35202004b0294b3f4f947dd215a57a2bf.camel@gmail.com \
    --to=adrian.freihofer@gmail.com \
    --cc=adrian.freihofer@siemens.com \
    --cc=enguerrand.de-ribaucourt@savoirfairelinux.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