From 3cf2b9e42cc3433000c44e3f5c1297378ae8ca34 Mon Sep 17 00:00:00 2001 From: Cody P Schafer Date: Tue, 2 Dec 2014 16:40:45 -0500 Subject: [PATCH] Rework ASSUME_PROVIDED and notes --- README.md | 20 +++++++++++++++----- classes/cargo.bbclass | 5 ----- conf/layer.conf | 5 +++++ 3 files changed, 20 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 74221b8..c5936a4 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,12 @@ This openembedded layer provides the rust compiler, tools for building packages (cargo), and a few example projects. +By default we assume that there is a local `cargo` (ie: `cargo-native`). To disable this and try to build cargo, add: + + CARGO_PROVIDED = "" + +To a conf file (probably local.conf) + ## What works: - MACHINE="beaglebone" (TARGET_SYS=arm-poky-linux-gnueabi) @@ -13,12 +19,16 @@ This openembedded layer provides the rust compiler, tools for building packages - Probably some of the untested things - cargo and cargo-native (use a local package for -native) - - We provide .bb files for these, and they are working every - now-and-then. Unfortunately, rust moves a bit too quickly for cargo - to keep up, and it ends up broken fairly often. - - To use a local cargo, add `ASSUME_PROVIDED = "cargo-native"` to your - local.conf file (or use the `bitbake -I cargo-native` option) +### What about cargo?: + +We provide .bb files for these, and they are working every now-and-then. +Unfortunately, rust moves a bit too quickly for cargo to keep up, and it ends +up broken fairly often. + +Very often we'll want newer versions of rust than cargo is able to build with. +Thankfully, we don't need any custom cargo configuration, and can use a vanilla +cargo binary. ## What's untested: diff --git a/classes/cargo.bbclass b/classes/cargo.bbclass index 2195c9f..792bf39 100644 --- a/classes/cargo.bbclass +++ b/classes/cargo.bbclass @@ -2,11 +2,6 @@ inherit rust CARGO = "cargo" -# cargo & rust go out of sync rather frequently. Very often we'll want newer -# versions of rust than cargo is able to build with. Thankfully, we don't need -# any custom cargo configuration, and can use a vanilla cargo binary. -# -# We recommend setting ASSUME_PROVIDED += "cargo-native" in your local.conf def cargo_base_dep(d): deps = "" if not d.getVar('INHIBIT_DEFAULT_DEPS') and not d.getVar('INHIBIT_CARGO_DEP'): diff --git a/conf/layer.conf b/conf/layer.conf index d65f443..b711985 100644 --- a/conf/layer.conf +++ b/conf/layer.conf @@ -7,3 +7,8 @@ BBFILES += "${LAYERDIR}/recipes*/*/*.bb ${LAYERDIR}/recipes*/*/*.bbappend" BBFILE_COLLECTIONS += "rust-layer" BBFILE_PATTERN_rust-layer := "^${LAYERDIR}/" BBFILE_PRIORITY_rust-layer = "7" + +# cargo generally doesn't work with the latest rust. Default to using the +# system's own cargo for cargo-native. +CARGO_PROVIDED = "cargo-native" +ASSUME_PROVIDED += "${CARGO_PROVIDED}"