Skip to contentSkip to conversation

cargo/rust from meta-rust-bin in eSDK of yocto 4.x

DISCUSSION [email protected] 3 participants 5 messages Oct 28, 2024 – Apr 15, 2025

lore
Share & tools
lore
#0 lore raw

Hello everyone,
I am currently testing the eSDK and have encountered a problem with cargo/rust. To make some of our projects written in rust work I had to use the meta-rust-bin layer (meta-rust does not work with yocto 4.x). This also works fine with the images or the standard SDK. However, when I want to build the eSDK, I get the following error message.

do_sdk_depends: The file /usr/bin/cargo is installed by both cargo-native and cargo-bin-cross-aarch64, aborting

How can I prevent the outdated cargo/rust from being in the eSDK and use the one from meta-rust-bin instead? Many thanks in advance.

#1 lore raw

When working with non-standard Rust versions from whatever other layers, I found it makes my life easier when I add the not-used recipes to BBMASK from oe-core, something like

BBMASK += "poky/meta/recipes-devtools/rust"

If there is anything that depends on it explicitly, it should fail loudly during next build, so it can be fixed. Otherwise bitbake will ignore these recipes completely, so it shouldn't clash with the new ones.

#3 lore raw

Hi Sandro,

Recently, I also faced the similar issue as follows:

Quoted 6 lines

ERROR: libstd-rs-1.86.0-r0 do_prepare_recipe_sysroot: The file /usr/bin/cargo is installed by both rust-native and cargo-native, aborting

Could you please explain how you resolved this issue? I tried adding BBMASK in the recipe but it didn't seem to work. Also, I noticed that BBMASK isn't widely used in other recipes.

Is there any better solution than using BBMASK?

Regards,
Yash

#4 lore raw

Hi Yash,

Unfortunately I could not solve the problem and went a different way. I now use ostree to provide the SDK.

Regards,
Sandro