Skip to content

Commit

Permalink
meta-resin-sumo:cargo_0.25.0.bbappend: Add Cargo.lock
Browse files Browse the repository at this point in the history
With Sumo 19.0.1, when building cargo 0.25.0 we get:
| error[E0425]: cannot find function `read_to_string` in module `fs`
|   --> /yocto/resin-board/build/tmp/work/x86_64-linux/cargo-native/
0.25.0-r0/cargo_home/registry/src/github.com-1ecc6299db9ec823/
libssh2-sys-0.2.11/build.rs:99:26
let config = fs::read_to_string("libssh2/src/libssh2_config_cmake.h.in")
^^^^^^^^^^^^^^ did you mean `read_string`?

This is just one example of a package that fails like this. There are
multiple packages in the cargo source tree that fail with this error.

The cargo bbclass does a:
cargo build -v --target x86_64-linux --release

This has the following effect:
NOTE:- cargo build -v --target x86_64-linux --release.
Updating registry `https://github.com/rust-lang/crates.io-index`

Updating the registry will result in using the versions pinned upstream.
In our case, it will be using newer versions of packages that require a
newer rust version (read_to_string was added in rust 1.26.0). But at the
same time, the meta-rust layer which we use has an older rust version.
(currently meta-rust on sumo branch has rust at version 1.24.1)

The fix for such a case would be to use a Cargo.lock file which pins
the packages to versions which are known to work with rust 1.24.1,
the version we use in sumo.

Change-type: minor
Changelog-entry: Pin down cargo deps (using Cargo.lock) to versions known working with rust 1.24.1 (for sumo)
Signed-off-by: Florin Sarbu <florin@resin.io>
  • Loading branch information
Florin Sarbu authored and ZubairLK committed Sep 23, 2018
1 parent b3987d8 commit ef3e76f
Show file tree
Hide file tree
Showing 2 changed files with 1,257 additions and 0 deletions.
10 changes: 10 additions & 0 deletions meta-resin-sumo/recipes-devtools/cargo/cargo_0.25.0.bbappend
@@ -0,0 +1,10 @@
FILESEXTRAPATHS_prepend := "${THISDIR}/files:"

SRC_URI += "file://Cargo.lock"

export CARGO_HOME = "${S}/cargo_home"

# for cargo 0.25.0, we use a known working Cargo.lock
cargo_common_do_configure_append() {
cp ${WORKDIR}/Cargo.lock ${S}
}

0 comments on commit ef3e76f

Please sign in to comment.