librespot: Fail to compile get_if_addrs

Hi, I’m trying to create a librespot package for NetBSD, as I want to add GUI support for Spotify. librespot compiles fine as a dependency crate of ncspot but fails to build as a stand alone package. Right now it fails to build with a Rust “out of scope” error when building get_if_addrs.

...
Compiling get_if_addrs v0.5.3
error[E0425]: cannot find function `do_broadcast` in this scope
   --> /usr/pkgsrc/wip/librespot/work/vendor/get_if_addrs-0.5.3/src/lib.rs:234:31
    |
234 |                         match do_broadcast(ifaddr) {
    |                               ^^^^^^^^^^^^ not found in this scope

error[E0425]: cannot find function `do_broadcast` in this scope
   --> /usr/pkgsrc/wip/librespot/work/vendor/get_if_addrs-0.5.3/src/lib.rs:253:31
    |
253 |                         match do_broadcast(ifaddr) {
    |                               ^^^^^^^^^^^^ not found in this scope

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0425`.
error: could not compile `get_if_addrs`.

Any suggestions? Rust version is 1.45.2

Thanks!

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 35 (14 by maintainers)

Commits related to this issue

Most upvoted comments

@willstott101 and @ashthespy Awesome, looking forward to rebuild it and add support for several audio options.

Well I guess it’s the weekend of releases. Am pushing out 0.1.6 which fixes this.

@willstott101 , @ashthespy and @sashahilton00 I can confirm the package builds and installs without issues on NetBSD if building from the git-dev branch, so thank you. @snowkat , thanks for finding the issue.

While waiting for a new librespot release, I’ll see if I can get a git-taged package accepted into the main repo.

I’ve made a PR into the dev branch of librespot. Is that the right place for you guys?

Windows travis is erroring due to more changes in if-addrs that weren’t in get-if-addr the author of if-addrs has patched their lib already and added windows travis to their repo. But I haven’t had a chance to test yet. Will want to make sure libmdns works within librespot on windows before actually releasing the point release.

@ashthespy That commit was made after the 0.5.3 release on crates.io, and it looks like that release is missing NetBSD support in lib.rs:

#[cfg(any(target_os = "linux", target_os = "android", target_os = "nacl"))]
fn do_broadcast(ifaddr: &posix_ifaddrs) -> Option<IpAddr> {
    sockaddr_to_ipaddr(ifaddr.ifa_ifu)
}

#[cfg(
    any(target_os = "freebsd", target_os = "ios", target_os = "macos", target_os = "openbsd")
)]
fn do_broadcast(ifaddr: &posix_ifaddrs) -> Option<IpAddr> {
    sockaddr_to_ipaddr(ifaddr.ifa_dstaddr)
}

Changing the dependencies in libmdns Cargo.toml to use get_if_addrs from git allowed everything to build on NetBSD:

get_if_addrs = { version = "0.5", git = "https://github.com/maidsafe-archive/get_if_addrs.git" }

I can submit an issue/PR in the libmdns repository for this if preferred.