Error: Cargo.lock file is missing from source dir

I'm trying to build a project for Raspberry Pi, but xargo fails with the following output:

+ Building target/aarch64-none-elf/release/libblinky.a [xargo --release]
error: Cargo.lock file is missing from source dir
caused by: No such file or directory (os error 2)
   0: error_chain::make_backtrace
   1: <core::result::Result<T,E> as xargo::errors::ResultExt<T,E>>::chain_err
   2: xargo::sysroot::build
   3: xargo::sysroot::update
   4: xargo::main_inner
   5: std::rt::lang_start::{{closure}}
   6: std::panicking::try::do_call
   7: __rust_maybe_catch_panic
   8: std::rt::lang_start_internal
   9: main
  10: __libc_start_main
  11: _start

Makefile:35: recipe for target 'target/aarch64-none-elf/release/libblinky.a' failed
make: *** [target/aarch64-none-elf/release/libblinky.a] Error 1

I added Cargo.lock into the project's directory, as well as in the src directory of the project. Could anyone tell me what am I doing wrong?

Just a wild guess: do you have rust-src component installed?

I don't know what the problem is but you should never have to create Cargo.lock yourself, this should be created by cargo itself when invoking it.

Nope, I installed it, but it didn't help. xargo outputs the exact same error

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.