greshake / i3status-rust

Very resourcefriendly and feature-rich replacement for i3status, written in pure Rust

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build Error - Missing libdbus-sys dependency

justinmoon opened this issue · comments

On Ubuntu 16.04 I got the following error upon running cargo build --release :

error: failed to run custom build command for `libdbus-sys v0.1.3`
process didn't exit successfully: `/home/justin/dev/clones/i3status-rust/target/release/build/libdbus-sys-00ab9bb93d8ed084/build-script-build` (exit code: 101)
--- stderr
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Failure { command: "\"pkg-config\" \"--libs\" \"--cflags\" \"dbus-1 >= 1.6\"", output: Output { status: ExitStatus(ExitStatus(256)), stdout: "", stderr: "Package dbus-1 was not found in the pkg-config search path.\nPerhaps you should add the directory containing `dbus-1.pc\'\nto the PKG_CONFIG_PATH environment variable\nNo package \'dbus-1\' found\n" } }', libcore/result.rs:945:5
note: Run with `RUST_BACKTRACE=1` for a backtrace.

warning: build failed, waiting for other jobs to finish...
error: build failed

Upon running apt search libdbus the following showed up:

dbus/xenial-updates,now 1.10.6-1ubuntu3.3 amd64 [installed]
  simple interprocess messaging system (daemon and utilities)
...
libdbus-1-3/xenial-updates,now 1.10.6-1ubuntu3.3 amd64 [installed]
  simple interprocess messaging system (library)
...

This fixed it:

sudo apt install libdbus-1-dev

I don't know much about Rust, but it seems the libdbus-sys 0.1.3 declaration in Cargo.lock isn't quite right -- since I had this dependency satisfied and the build failed, but the build succeeded when I upgraded it to libdbus-1-dev.

My 2 cents ...

just want to add a relation to issue #184

I found this in dbus-rs's Requirements section of their README, perhaps we should add it to our own requirements:

Libdbus 1.6 or higher, and latest stable release of Rust. If you run Ubuntu, this translates to Ubuntu 14.04 or later, having the libdbus-1-dev package installed while building, and the libdbus-1-3 package installed while running.