meta-rust-bin icon indicating copy to clipboard operation
meta-rust-bin copied to clipboard

Unable to compile a native recipe

Open krsh opened this issue 2 years ago • 1 comments

When I compile a native application, I get this error:

ERROR: Nothing PROVIDES 'cargo-bin-native-x86_64' (but virtual:native:/home/test/meta-example/recipes-app/app/app.bb DEPENDS on or otherwise requires it)
ERROR: Required build target 'core-image-minimal' has no buildable providers.
Missing or unbuildable dependency chain was: ['core-image-minimal', 'app-native', 'cargo-bin-native-x86_64']

Other info:

Build Configuration:
BB_VERSION           = "2.0.0"
BUILD_SYS            = "x86_64-linux"
NATIVELSBSTRING      = "universal"
TARGET_SYS           = "aarch64-poky-linux"
MACHINE              = "qemuarm64"
DISTRO               = "poky"
DISTRO_VERSION       = "4.0.3"
TUNE_FEATURES        = "aarch64 armv8a crc cortexa57"
TARGET_FPU           = ""
meta                 
meta-poky            
meta-yocto-bsp       
meta-oe              
meta-rust-bin        = "<unknown>:<unknown>"

krsh avatar Nov 22 '22 11:11 krsh

I find that a -native recipe can be compiled simply by adding:

PROVIDES += "cargo-bin-native-${TARGET_ARCH}"

to recipes-devtools/rust/cargo-bin-cross.inc

I'm not sure it is the right fix, but it is a simple one.

EDIT: It doesn't work for non-x86 builds

Maybe these lines in cargo-bin-cross.inc:

inherit native ... PN_class-native = "cargo-bin-native-${BUILD_ARCH}"

samliddicott avatar Dec 01 '22 14:12 samliddicott

I have a pull request open for a change we've been using for a while, it works for both x86 and arm (Raspberry pi) builds. https://github.com/rust-embedded/meta-rust-bin/pull/178

mangodan2003 avatar May 16 '24 16:05 mangodan2003

Resolved by #178. Thanks @mangodan2003!

nastevens avatar May 21 '24 13:05 nastevens