Building rust package fails with "can't find crate for `std`" #bitbake #toolchain #rust #kirkstone


martin.stolpe@...
 

Hello,

I'm trying to build a rust package which pulls openssl-sys as a dependency. I've used cargo bitbake to create the build script.

When I try to build the package using bitbake I get the following error message:
error: failed to run custom build command for `openssl-sys v0.9.72`

Caused by:
  process didn't exit successfully: `/home/martin/yocto/build/tmp/work/cortexa72-poky-linux/basestation/0.1.0-r0/build/target/release/build/openssl-sys-0c915fe76d324495/build-script-main` (exit status: 101)
  --- stdout
  cargo:rustc-cfg=const_fn
  cargo:rerun-if-env-changed=AARCH64_POKY_LINUX_OPENSSL_NO_VENDOR
  AARCH64_POKY_LINUX_OPENSSL_NO_VENDOR unset
  cargo:rerun-if-env-changed=OPENSSL_NO_VENDOR
  OPENSSL_NO_VENDOR unset

  --- stderr
  warning: target json file contains unused fields: has-elf-tls

  warning: target json file contains unused fields: has-elf-tls

  error[E0463]: can't find crate for `std`
    |
    = note: the `aarch64-poky-linux` target may not be installed
    = help: consider downloading the target with `rustup target add aarch64-poky-linux`

Does anyone know if it is possible to build the std (and core) crate for the rust cross compile toolchain? I'm a beginner regarding Yocto/OpenEmbedded and am really struggling to understand how the rust cross compile toolchain is build. Any help would be appreciated.

Best regards
Martin

Join {yocto@lists.yoctoproject.org to automatically receive all group messages.