bluster icon indicating copy to clipboard operation
bluster copied to clipboard

Unable to build bluster on Raspberry Pi (3B, 4)

Open Jesus805 opened this issue 3 years ago • 4 comments

Hi,

  1. I created a new Rust project on a clean install of Raspberry Pi OS.
  2. I added bluster to Cargo.toml (I tried both bluster = "0.1.2" and bluster = { git = "https://github.com/dfrankland/bluster" }
  3. I get the error below when running cargo check

Am I missing any dependencies?

error: failed to run custom build command for `libdbus-sys v0.2.1`

Caused by:
  process didn't exit successfully: `/home/pi/pgpemu-rs/pgpemu_rs/target/debug/build/libdbus-sys-24c9796f51ee346b/build-scrip                            t-build` (exit code: 101)
  --- stdout
  cargo:rerun-if-env-changed=DBUS_1_NO_PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG
  cargo:rerun-if-env-changed=DBUS_1_STATIC
  cargo:rerun-if-env-changed=DBUS_1_DYNAMIC
  cargo:rerun-if-env-changed=PKG_CONFIG_ALL_STATIC
  cargo:rerun-if-env-changed=PKG_CONFIG_ALL_DYNAMIC
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH_armv7-unknown-linux-gnueabihf
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH_armv7_unknown_linux_gnueabihf
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_PATH
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_armv7-unknown-linux-gnueabihf
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_armv7_unknown_linux_gnueabihf
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_LIBDIR
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_armv7-unknown-linux-gnueabihf
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_armv7_unknown_linux_gnueabihf
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_SYSROOT_DIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR

  --- stderr
  thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Failure { command: "\"pkg-config\" \"--libs\" \"--c                            flags\" \"dbus-1\" \"dbus-1 >= 1.6\"", output: Output { status: ExitStatus(ExitStatus(256)), stdout: "", stderr: "Package dbu                            s-1 was not found in the pkg-config search path.\nPerhaps you should add the directory containing `dbus-1.pc\'\nto the PKG_CO                            NFIG_PATH environment variable\nNo package \'dbus-1\' found\nPackage dbus-1 was not found in the pkg-config search path.\nPer                            haps you should add the directory containing `dbus-1.pc\'\nto the PKG_CONFIG_PATH environment variable\nNo package \'dbus-1\'                             found\n" } }', /home/pi/.cargo/registry/src/github.com-1285ae84e5963aae/libdbus-sys-0.2.1/build.rs:6:70
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
error: build failed

Jesus805 avatar Sep 30 '20 19:09 Jesus805

Hi there! You may want to read through this guide here: https://github.com/diwic/dbus-rs/blob/master/libdbus-sys/cross_compile.md

dfrankland avatar Sep 30 '20 19:09 dfrankland

Thank you for the fast reply @dfrankland ! I'm able to build it after installing libdbus-1-dev sudo apt-get install libdbus-1-dev It might be useful to have this dependency in the README :)

Jesus805 avatar Sep 30 '20 20:09 Jesus805

This crate is mostly a proof of concept, so there's nary any documentation as of yet

dfrankland avatar Jan 09 '21 21:01 dfrankland

I've been cross compiling this on a Raspberry py 3B a lot. I did have to do some work to set up a proper cross compiler using Docker: https://hub.docker.com/repository/docker/vonamos/rust_berry

I've also built a custom script for passing in some pre compile libs for DBUS. I'm happy to share with anyone interested.

enochc avatar Feb 13 '21 17:02 enochc