greshake / i3status-rust

Very resourcefriendly and feature-rich replacement for i3status, written in pure Rust
GNU General Public License v3.0
2.88k stars 475 forks source link

PulseAudio support causes compilation error #275

Closed crablab closed 6 years ago

crablab commented 6 years ago

@SWW13 I think your most recent change may have broken something as I can no longer compile Master.

  process didn't exit successfully: `rustc --crate-name i3status_rs src/main.rs --crate-type bin --emit=dep-info,link -C opt-level=3 --cfg 'feature="default"' --cfg 'feature="libpulse-binding"' --cfg 'feature="pulseaudio"' -C metadata=bab3e6b0803c3196 -C extra-filename=-bab3e6b0803c3196 --out-dir /home/crablab/i3status-rust/target/release/deps -L dependency=/home/crablab/i3status-rust/target/release/deps --extern chan=/home/crablab/i3status-rust/target/release/deps/libchan-70e70acbab6a72ae.rlib --extern chrono=/home/crablab/i3status-rust/target/release/deps/libchrono-3cff132d39be0be9.rlib --extern chrono_tz=/home/crablab/i3status-rust/target/release/deps/libchrono_tz-42b622de5379d8e1.rlib --extern clap=/home/crablab/i3status-rust/target/release/deps/libclap-9740b28b81182e11.rlib --extern dbus=/home/crablab/i3status-rust/target/release/deps/libdbus-7f72802909706ada.rlib --extern i3ipc=/home/crablab/i3status-rust/target/release/deps/libi3ipc-bed8503ae6fc87a2.rlib --extern inotify=/home/crablab/i3status-rust/target/release/deps/libinotify-751c5dca968c88c5.rlib --extern lazy_static=/home/crablab/i3status-rust/target/release/deps/liblazy_static-3c49c5910ae472c4.rlib --extern libpulse_binding=/home/crablab/i3status-rust/target/release/deps/liblibpulse_binding-4909fd3484cafdda.rlib --extern maildir=/home/crablab/i3status-rust/target/release/deps/libmaildir-10d24687cf4ef591.rlib --extern nix=/home/crablab/i3status-rust/target/release/deps/libnix-2f89d5eb17390495.rlib --extern num=/home/crablab/i3status-rust/target/release/deps/libnum-3dc977d9f79453a4.rlib --extern regex=/home/crablab/i3status-rust/target/release/deps/libregex-fe7f5e6fb8cdc3c6.rlib --extern serde=/home/crablab/i3status-rust/target/release/deps/libserde-e9d0965d0a2f37f6.rlib --extern serde_derive=/home/crablab/i3status-rust/target/release/deps/libserde_derive-185daff4d60c3391.so --extern serde_json=/home/crablab/i3status-rust/target/release/deps/libserde_json-cce1165ac9b223fc.rlib --extern toml=/home/crablab/i3status-rust/target/release/deps/libtoml-57e58f1d6af41d5e.rlib --extern uuid=/home/crablab/i3status-rust/target/release/deps/libuuid-6abbf80f4a45fb77.rlib -L native=/usr/lib/x86_64-linux-gnu` (exit code: 1)
undefined reference to symbol 'pa_encoding_from_string'
          //usr/lib/x86_64-linux-gnu/pulseaudio/libpulsecommon-10.0.so: error adding symbols: DSO missing from command line

I'm no expert in Rust or Pulse Audio but it seems there might be a library missing?

SWW13 commented 6 years ago

This could be https://github.com/jnqnfe/pulse-binding-rust/issues/7, can you try cargo update?

As workaround you can also compile without pulseaudio: cargo build --no-default-features

drrmmng commented 6 years ago

Unfortunately cargo update does not help.

cargo build --no-default-features works, however. What features will be missing?

SWW13 commented 6 years ago

Currently this only disables the pulseaudio support, see Cargo.toml.

Which version of libpulse do you have?

atheriel commented 6 years ago

I might also suggest modifying the libpulse-binding dependency to

libpulse-binding = { optional = true, version = "2.2.3", default-features = false }
drrmmng commented 6 years ago

(hopefully) relevant output from apt search libpulse:

libpulse-mainloop-glib0/bionic-updates,now 1:11.1-1ubuntu7.1 amd64 [installed]
  PulseAudio client libraries (glib support)

libpulse0/bionic-updates,now 1:11.1-1ubuntu7.1 amd64 [installed]
  PulseAudio client libraries

libpulsedsp/bionic-updates,now 1:11.1-1ubuntu7.1 amd64 [installed]
  PulseAudio OSS pre-load library

Interestingly, using @atheriel's suggested modification made cargo build --release compile successfully. Thank you all for your time!

atheriel commented 6 years ago

@SWW13 Do you have an objection to me making this change to Cargo.toml? Are you planning to use the problematic feature in question?

SWW13 commented 6 years ago

The Cargo.toml change LGTM. I'm not using any of the pulseaudio encoding functions and don't see why we would need it them in the future.

crablab commented 6 years ago

Thank you both for this!

I have opened a PR with @atheriel's suggestion (it worked for me) :+1: