Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow avahi support using dns-sd for Discovery #86

Closed
sashahilton00 opened this issue Jan 29, 2018 · 3 comments
Closed

Allow avahi support using dns-sd for Discovery #86

sashahilton00 opened this issue Jan 29, 2018 · 3 comments

Comments

@sashahilton00
Copy link
Member

Issue by shanemeagher
Tuesday Sep 05, 2017 at 15:13 GMT
Originally opened as plietar/librespot#246


rust-mdns is still the default but can also be specified explicitly with
--feature "with-internal-mdns" switch at build time.

Added --feature "with-external-mdns" switch to build librespot to use
avahi for discovery using dns-sd package.

This commit does not provide option for building without mdns.

This pull request replaces pull request plietar/librespot#201 started by @awiouy and has been rebased on the current master branch.


shanemeagher included the following code: https://github.com/plietar/librespot/pull/246/commits

@sashahilton00
Copy link
Member Author

Comment by shanemeagher
Wednesday Sep 06, 2017 at 14:00 GMT


@plietar,
It seems I'm still having an issue when building with --no-default-features. As mdns is optional and not a dependency of an enabled feature (with-internal-mdns) in cargo.toml, cargo doesn't pass it to rustc.

In src/lib.rs, I've used cfg-if to reference mdns:

cfg_if! {
    if #[cfg(feature = "with-internal-mdns")] {
        extern crate mdns;
    } else if #[cfg(feature = "with-external-mdns")] {
        extern crate dns_sd;
    } else {
        extern crate mdns;
    }
}

resulting in this error: https://travis-ci.org/plietar/librespot/jobs/272099406#L929

In the PR201, you asked:

Did you use #[cfg(mdns)] around the extern crate mdns ?
Would this not have just checked if the dependency mdns was enabled? Which it isn't?

Is there a way to make one of the features a default requirement if none is specified?

@awiouy
Copy link
Collaborator

awiouy commented Jan 29, 2018

Documentation for #13
Could be closed

@ComlOnline
Copy link
Contributor

Thank you @awiouy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants