[GH-ISSUE #399] Can not compile on Arch Linux with pulseaudio backend. #257

Closed
opened 2026-02-27 19:29:41 +03:00 by kerem · 10 comments
Owner

Originally created by @MrKinauJr on GitHub (Nov 9, 2019).
Original GitHub issue: https://github.com/librespot-org/librespot/issues/399

Hello i have a problem compiling librespot with pulseaudio backend.

Errorlog:
Compiling unreachable v1.0.0
Compiling base64 v0.5.2
Compiling shannon v0.2.0
error[E0503]: cannot use state because it was mutably borrowed
--> /home/kinau/.cargo/registry/src/github.com-1ecc6299db9ec823/getopts-0.2.14/src/lib.rs:1008:33
|
955 | let mut machine = |cont: &mut bool, (i, c): (usize, char)| {
| ---------------------------------------- borrow of state occurs here
...
959 | state = match (state, whitespace, limit) {
| ----- borrow occurs due to use of state in closure
...
1008 | while cont && match state { B | C => true, A => false } {
| ^ use of borrowed state
1009 | machine(&mut cont, (fake_i, ' '));
| ------- borrow later used here

error: aborting due to previous error

For more information about this error, try rustc --explain E0503.
error: could not compile getopts.
warning: build failed, waiting for other jobs to finish...
error: build failed

Originally created by @MrKinauJr on GitHub (Nov 9, 2019). Original GitHub issue: https://github.com/librespot-org/librespot/issues/399 Hello i have a problem compiling librespot with pulseaudio backend. Errorlog: Compiling unreachable v1.0.0 Compiling base64 v0.5.2 Compiling shannon v0.2.0 error[E0503]: cannot use state because it was mutably borrowed --> /home/kinau/.cargo/registry/src/github.com-1ecc6299db9ec823/getopts-0.2.14/src/lib.rs:1008:33 | 955 | let mut machine = |cont: &mut bool, (i, c): (usize, char)| { | ---------------------------------------- borrow of state occurs here ... 959 | state = match (state, whitespace, limit) { | ----- borrow occurs due to use of state in closure ... 1008 | while cont && match state { B | C => true, A => false } { | ^ use of borrowed state 1009 | machine(&mut cont, (fake_i, ' ')); | ------- borrow later used here error: aborting due to previous error For more information about this error, try rustc --explain E0503. error: could not compile getopts. warning: build failed, waiting for other jobs to finish... error: build failed
kerem closed this issue 2026-02-27 19:29:41 +03:00
Author
Owner

@ashthespy commented on GitHub (Nov 9, 2019):

What version of Rust are you on? Looks like you need to update to at least 1.32

<!-- gh-comment-id:552133496 --> @ashthespy commented on GitHub (Nov 9, 2019): What version of Rust are you on? Looks like you need to update to at least 1.32
Author
Owner

@MrKinauJr commented on GitHub (Nov 9, 2019):

I am on rustc 1.39.0 (4560ea788 2019-11-04)

<!-- gh-comment-id:552134442 --> @MrKinauJr commented on GitHub (Nov 9, 2019): I am on rustc 1.39.0 (4560ea788 2019-11-04)
Author
Owner

@ashthespy commented on GitHub (Nov 10, 2019):

Not sure why you have such an old version of getopts though - 0.2.14 is from 2015. Current Cargo.lock uses 0.2.19.

<!-- gh-comment-id:552186427 --> @ashthespy commented on GitHub (Nov 10, 2019): Not sure why you have such an old version of `getopts` though - 0.2.14 is from 2015. Current `Cargo.lock` uses `0.2.19`.
Author
Owner

@MrKinauJr commented on GitHub (Nov 10, 2019):

idk too. i just git cloned it. After that downloaded cargo via pacman -S cargo rustup and then tried to compile it.

<!-- gh-comment-id:552189456 --> @MrKinauJr commented on GitHub (Nov 10, 2019): idk too. i just git cloned it. After that downloaded cargo via pacman -S cargo rustup and then tried to compile it.
Author
Owner

@ashthespy commented on GitHub (Nov 10, 2019):

We recommend using rustup directly, from https://rustup.rs/.
You normally don't need to install cargo separately, as its bundled with rustup

<!-- gh-comment-id:552190455 --> @ashthespy commented on GitHub (Nov 10, 2019): We [recommend](https://github.com/librespot-org/librespot/wiki/Compiling#rust) using rustup directly, from https://rustup.rs/. You normally don't need to install cargo separately, as its bundled with rustup
Author
Owner

@MrKinauJr commented on GitHub (Nov 10, 2019):

yeah idk anything about rust. I just want to use it cause its headless so i can do some stuff with it via remote control and the spotify api. lemme try

<!-- gh-comment-id:552190588 --> @MrKinauJr commented on GitHub (Nov 10, 2019): yeah idk anything about rust. I just want to use it cause its headless so i can do some stuff with it via remote control and the spotify api. lemme try
Author
Owner

@MrKinauJr commented on GitHub (Nov 10, 2019):

well sorry. had the wrong librespot repo D; this is the reason. sorry im a idiot xD

<!-- gh-comment-id:552224106 --> @MrKinauJr commented on GitHub (Nov 10, 2019): well sorry. had the wrong librespot repo D; this is the reason. sorry im a idiot xD
Author
Owner

@MrKinauJr commented on GitHub (Nov 10, 2019):

fuck it. new error. compiled with cargo build --release --features pulseaudio-backend.

cant use the pulseaudio backend tho.
`
[2019-11-10T19:18:15Z INFO librespot] librespot (). Built on 2019-11-09. Build ID: BGt9RQk2
Available Backends :

  • portaudio (default)
  • rodio
  • pipe

`

<!-- gh-comment-id:552224761 --> @MrKinauJr commented on GitHub (Nov 10, 2019): fuck it. new error. compiled with `cargo build --release --features pulseaudio-backend`. cant use the pulseaudio backend tho. ` [2019-11-10T19:18:15Z INFO librespot] librespot (). Built on 2019-11-09. Build ID: BGt9RQk2 Available Backends : - portaudio (default) - rodio - pipe `
Author
Owner

@ashthespy commented on GitHub (Nov 10, 2019):

You still have the wrong repo - portaudio hasn't been default for quite a while now.. Check out the wiki on compilation.

<!-- gh-comment-id:552224863 --> @ashthespy commented on GitHub (Nov 10, 2019): You still have the wrong repo - `portaudio` hasn't been default for quite a while now.. Check out the wiki on compilation.
Author
Owner

@MrKinauJr commented on GitHub (Nov 10, 2019):

oh fuck im just a idiot. sorry never compiled something with rust. I thought it will get install instantly. but i needed to get the binary. Well sorry D; but thanks for pointing that out.

<!-- gh-comment-id:552225992 --> @MrKinauJr commented on GitHub (Nov 10, 2019): oh fuck im just a idiot. sorry never compiled something with rust. I thought it will get install instantly. but i needed to get the binary. Well sorry D; but thanks for pointing that out.
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#257
No description provided.