From 0025cebb12e3d8742c82b296ca90aa01d6c34d8e Mon Sep 17 00:00:00 2001 From: Johan Anderholm Date: Mon, 8 Feb 2021 14:06:14 +0100 Subject: [PATCH] Fix *-native cargo builds Normally all *-native packages needs to depend on cargo-native in order to be able to use cargo. When building cargo-native however, this is not available and we use a snapshot. Fixes #302. --- classes/cargo.bbclass | 2 +- recipes-devtools/cargo/cargo.inc | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/classes/cargo.bbclass b/classes/cargo.bbclass index aa040aa..72e77b0 100644 --- a/classes/cargo.bbclass +++ b/classes/cargo.bbclass @@ -9,7 +9,7 @@ inherit cargo_common CARGO = "cargo" # We need cargo to compile for the target -BASEDEPENDS_append_class-target = " cargo-native" +BASEDEPENDS_append = " cargo-native" # Ensure we get the right rust variant DEPENDS_append_class-target = " virtual/${TARGET_PREFIX}rust ${RUSTLIB_DEP}" diff --git a/recipes-devtools/cargo/cargo.inc b/recipes-devtools/cargo/cargo.inc index 914c3e2..9645b90 100644 --- a/recipes-devtools/cargo/cargo.inc +++ b/recipes-devtools/cargo/cargo.inc @@ -45,6 +45,7 @@ export LIBSSH2_SYS_USE_PKG_CONFIG = "1" BBCLASSEXTEND = "native" -# When building cargo-native we don't have a built cargo to use so we must use -# the snapshot to bootstrap the build of cargo +# When building cargo-native we don't have cargo-native to use and depend on, +# so we must use the locally set up snapshot to bootstrap the build. +BASEDEPENDS_remove_class-native = "cargo-native" CARGO_class-native = "${WORKDIR}/${CARGO_SNAPSHOT}/bin/cargo"