-
Notifications
You must be signed in to change notification settings - Fork 185
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
Re-enable avahi support for discovery #201
Conversation
rust-mdns is still the default and can be specified explicitly with --with-rust-mdns switch. Added --with-avahi switch to build librespot to use avahi for discovery using dns-sd package.
This works fine here: LibreELEC/LibreELEC.tv#1622 |
you should probably extend the code some more because when one doesn't provide any of the discovery options, the code won't build. If you add a few checks more it will also build without any discovery, for example on windows. e.g.: #[cfg(any(feature = "with-rust-mdns", feature = "with-avahi"))] |
Thanks for the heads-up @marcelveldt |
@awiouy @marcelveldt I've updated my commits so that rust-mdns is used by default, even if If someone want's to build librespot to use with avahi now, the I've also rebased on master and squashed it to one commit: shanemeagher@6f515f4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems to me like this would fail to build if both are enabled.
Instead it should pick one of the two, say the dns-sd one. You can use https://github.com/alexcrichton/cfg-if to make it easier
|
||
default = ["portaudio-backend"] | ||
default = ["portaudio-backend","with-rust-mdns"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: there should be a space between the two items.
@@ -71,8 +72,10 @@ portaudio-backend = ["portaudio-rs"] | |||
pulseaudio-backend = ["libpulse-sys"] | |||
|
|||
with-tremor = ["tremor"] | |||
with-rust-mdns = ["mdns"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you rename the feature to with-internal-mdns
@@ -71,8 +72,10 @@ portaudio-backend = ["portaudio-rs"] | |||
pulseaudio-backend = ["libpulse-sys"] | |||
|
|||
with-tremor = ["tremor"] | |||
with-rust-mdns = ["mdns"] | |||
with-avahi = ["dns-sd"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same, with-external-mdns
.
dns-sd
is actually Apple's API.
Avahi provides a compatibility layer between the two
If I may chime in too, I don't think it's a great idea that it will force one of the two with no-default-features, in my case for example I'm also compiling for Windows and I need to comment out the dns stuff. So better to specify both of them as a separate feature but pick one as the default. And off course the changes in the code that it will only load (the correct) dns/discovery code if the feature is actually enabled. I'm really busy atm otherwise I would have provided the PR |
@marcelveldt currently if On the other hand, if both are enabled, it will fail to build, which is a problem to me |
@plietar finally getting a chance to revisit this. Have made most of your suggested changes but have a (probably simple) problem in
If neither is specified, cargo tries to build with Any suggestions? |
@shanemeagher Did you use |
Feature taken over by #246. Closing. |
This pull request allows to select whether discovery is built based on mdns (by default) or on avahi.
I only streamlined Dockerfile and docker-build-avahi.sh.
Many thanks to @shanemeagher, who did the heavy lifting.