[GH-ISSUE #553] Unable to build if spesifying ALSA backend #351

Closed
opened 2026-02-27 19:30:09 +03:00 by kerem · 2 comments
Owner

Originally created by @noelhibbard on GitHub (Dec 17, 2020).
Original GitHub issue: https://github.com/librespot-org/librespot/issues/553

Building like this on the dev branch fails:

cargo install --path . --features alsa-backend

Adding --locked doesn't help.

Here is the error I get:

error: multiple packages link to native library `alsa`, but a native library can be linked only once

package `alsa-sys v0.1.2`
    ... which is depended on by `alsa v0.2.2`
    ... which is depended on by `librespot-playback v0.1.3 (/root/librespot/playback)`
    ... which is depended on by `librespot v0.1.3 (/root/librespot)`
links to native library `alsa`

package `alsa-sys v0.3.0`
    ... which is depended on by `alsa v0.4.3`
    ... which is depended on by `cpal v0.13.1`
    ... which is depended on by `librespot-playback v0.1.3 (/root/librespot/playback)`
    ... which is depended on by `librespot v0.1.3 (/root/librespot)`
also links to native library `alsa`

I noticed a bunch of dependencies recently got updated, so I rolled back to a commit before the dependency updates, but it still will not build. The master branch builds fine though.

Okay, it seems it was this commit that broke the ability to build with ALSA:
2fa69cdc6e

Originally created by @noelhibbard on GitHub (Dec 17, 2020). Original GitHub issue: https://github.com/librespot-org/librespot/issues/553 Building like this on the dev branch fails: ``` cargo install --path . --features alsa-backend ``` Adding --locked doesn't help. Here is the error I get: ``` error: multiple packages link to native library `alsa`, but a native library can be linked only once package `alsa-sys v0.1.2` ... which is depended on by `alsa v0.2.2` ... which is depended on by `librespot-playback v0.1.3 (/root/librespot/playback)` ... which is depended on by `librespot v0.1.3 (/root/librespot)` links to native library `alsa` package `alsa-sys v0.3.0` ... which is depended on by `alsa v0.4.3` ... which is depended on by `cpal v0.13.1` ... which is depended on by `librespot-playback v0.1.3 (/root/librespot/playback)` ... which is depended on by `librespot v0.1.3 (/root/librespot)` also links to native library `alsa` ``` I noticed a bunch of dependencies recently got updated, so I rolled back to a commit before the dependency updates, but it still will not build. The master branch builds fine though. Okay, it seems it was this commit that broke the ability to build with ALSA: 2fa69cdc6e5351587ac6b2bc8a56bce6ba8a68f6
kerem closed this issue 2026-02-27 19:30:10 +03:00
Author
Owner

@ashthespy commented on GitHub (Dec 18, 2020):

Ah, looks like we have a alsa dependency miss match b/w the Rodio and alsa backend. Should probably add a CI build to the matrix for this case.

For your issue, try adding --no-default-features to build librespot with only the alsa backend.

<!-- gh-comment-id:748004522 --> @ashthespy commented on GitHub (Dec 18, 2020): Ah, looks like we have a alsa dependency miss match b/w the Rodio and alsa backend. Should probably add a CI build to the matrix for this case. For your issue, try adding `--no-default-features` to build librespot with *only* the alsa backend.
Author
Owner

@noelhibbard commented on GitHub (Dec 18, 2020):

That worked, thanks!

<!-- gh-comment-id:748131436 --> @noelhibbard commented on GitHub (Dec 18, 2020): That worked, thanks!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/librespot#351
No description provided.