Move the dependencies from cargo to cargo_common: if cargo is being used
in any way then you need to depend on cargo-native.

Inherit rust instead of rust-common or rust-target-config: rust inherits
rust-common that inherits rust-target-config, and rust.bbclass simply
adds the dependency on rust-native. This means we can drop the explicit
rust dependencies to avoid duplication.

Signed-off-by: Ross Burton <[email protected]>
---
 meta/classes-recipe/cargo.bbclass        | 9 ---------
 meta/classes-recipe/cargo_common.bbclass | 4 +++-
 2 files changed, 3 insertions(+), 10 deletions(-)

diff --git a/meta/classes-recipe/cargo.bbclass 
b/meta/classes-recipe/cargo.bbclass
index 31e655650cc..628dbc98f18 100644
--- a/meta/classes-recipe/cargo.bbclass
+++ b/meta/classes-recipe/cargo.bbclass
@@ -10,19 +10,10 @@
 ## Cargo.
 
 inherit cargo_common
-inherit rust-target-config
 
 # the binary we will use
 CARGO = "cargo"
 
-# We need cargo to compile for the target
-BASEDEPENDS:append = " cargo-native"
-
-# Ensure we get the right rust variant
-DEPENDS:append:class-target = " rust-native ${RUSTLIB_DEP}"
-DEPENDS:append:class-nativesdk = " rust-native ${RUSTLIB_DEP}"
-DEPENDS:append:class-native = " rust-native"
-
 # Enable build separation
 B = "${WORKDIR}/build"
 
diff --git a/meta/classes-recipe/cargo_common.bbclass 
b/meta/classes-recipe/cargo_common.bbclass
index 0fb6844d932..f58bd80728c 100644
--- a/meta/classes-recipe/cargo_common.bbclass
+++ b/meta/classes-recipe/cargo_common.bbclass
@@ -15,7 +15,9 @@
 ##
 
 # add crate fetch support
-inherit rust-common
+inherit rust
+
+BASEDEPENDS:append = " cargo-native"
 
 # In case something fails in the build process, give a bit more feedback on
 # where the issue occured
-- 
2.43.0

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

Reply via email to