[GH-ISSUE #678] Error: could not compile protobuf #390

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

Originally created by @MW-SAND on GitHub (Mar 21, 2021).
Original GitHub issue: https://github.com/librespot-org/librespot/issues/678

I'm using Ubuntu 20.04 and I'm unable to compile librespot with the following command: sudo cargo build --release. If you need any more info please let me know.

error: could not compile protobuf.

Caused by:
process didn't exit successfully: rustc --crate-name protobuf /root/.cargo/registry/src/github.com-1ecc6299db9ec823/protobuf-2.14.0/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -Cembed-bitcode=no -C metadata=f69098f2fee967d7 -C extra-filename=-f69098f2fee967d7 --out-dir /home/ubuntu/Wekker/librespot/target/release/deps -L dependency=/home/ubuntu/Wekker/librespot/target/release/deps --cap-lints allow (signal: 9, SIGKILL: kill)
warning: build failed, waiting for other jobs to finish...
error: build failed

Originally created by @MW-SAND on GitHub (Mar 21, 2021). Original GitHub issue: https://github.com/librespot-org/librespot/issues/678 I'm using Ubuntu 20.04 and I'm unable to compile librespot with the following command: sudo cargo build --release. If you need any more info please let me know. error: could not compile `protobuf`. Caused by: process didn't exit successfully: `rustc --crate-name protobuf /root/.cargo/registry/src/github.com-1ecc6299db9ec823/protobuf-2.14.0/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -Cembed-bitcode=no -C metadata=f69098f2fee967d7 -C extra-filename=-f69098f2fee967d7 --out-dir /home/ubuntu/Wekker/librespot/target/release/deps -L dependency=/home/ubuntu/Wekker/librespot/target/release/deps --cap-lints allow` (signal: 9, SIGKILL: kill) warning: build failed, waiting for other jobs to finish... error: build failed
kerem closed this issue 2026-02-27 19:30:21 +03:00
Author
Owner

@Johannesd3 commented on GitHub (Mar 21, 2021):

Works fine for me. Did you try it several times or just once? You're log has a strange formatting, but it seems as if it was simply killed.

Edit: Maybe the OOM killer? Do you have enough RAM?

<!-- gh-comment-id:803631460 --> @Johannesd3 commented on GitHub (Mar 21, 2021): Works fine for me. Did you try it several times or just once? You're log has a strange formatting, but it seems as if it was simply killed. Edit: Maybe the OOM killer? Do you have enough RAM?
Author
Owner

@MW-SAND commented on GitHub (Mar 23, 2021):

I have tried it several times over the past few weeks.

Thank you for your suggestion. I only have 1 GB ram, however, the library has been compiled a couple of months ago with the same amount of ram. I tried disabling the overcommit of OOM, but this results in multiple errors, I couldn't even get to the library folder.

<!-- gh-comment-id:805244910 --> @MW-SAND commented on GitHub (Mar 23, 2021): I have tried it several times over the past few weeks. Thank you for your suggestion. I only have 1 GB ram, however, the library has been compiled a couple of months ago with the same amount of ram. I tried disabling the overcommit of OOM, but this results in multiple errors, I couldn't even get to the library folder.
Author
Owner

@MW-SAND commented on GitHub (Mar 25, 2021):

Compiling librespot-metadata v0.1.6 (/home/ubuntu/Wekker/librespot/metadata)
error: could not compile librespot-protocol.

Caused by:
process didn't exit successfully: rustc --crate-name librespot_protocol --edi tion=2018 protocol/src/lib.rs --error-format=json --json=diagnostic-rendered-ans i,artifacts --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -Cembe d-bitcode=no -C metadata=27e66b292c3d66e2 -C extra-filename=-27e66b292c3d66e2 -- out-dir /home/ubuntu/Wekker/librespot/target/release/deps -L dependency=/home/ub untu/Wekker/librespot/target/release/deps --extern protobuf=/home/ubuntu/Wekker/ librespot/target/release/deps/libprotobuf-f69098f2fee967d7.rmeta (signal: 9, SI GKILL: kill)
warning: build failed, waiting for other jobs to finish...
error: build failed

okay so I've tried it once again and for some reason, protobuf compiled correctly but now it got an error on librespot-protocol.

Is this a RAM issue or could it be something else?

<!-- gh-comment-id:807065312 --> @MW-SAND commented on GitHub (Mar 25, 2021): Compiling librespot-metadata v0.1.6 (/home/ubuntu/Wekker/librespot/metadata) error: could not compile `librespot-protocol`. Caused by: process didn't exit successfully: `rustc --crate-name librespot_protocol --edi tion=2018 protocol/src/lib.rs --error-format=json --json=diagnostic-rendered-ans i,artifacts --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -Cembe d-bitcode=no -C metadata=27e66b292c3d66e2 -C extra-filename=-27e66b292c3d66e2 -- out-dir /home/ubuntu/Wekker/librespot/target/release/deps -L dependency=/home/ub untu/Wekker/librespot/target/release/deps --extern protobuf=/home/ubuntu/Wekker/ librespot/target/release/deps/libprotobuf-f69098f2fee967d7.rmeta` (signal: 9, SI GKILL: kill) warning: build failed, waiting for other jobs to finish... error: build failed okay so I've tried it once again and for some reason, protobuf compiled correctly but now it got an error on librespot-protocol. Is this a RAM issue or could it be something else?
Author
Owner

@Johannesd3 commented on GitHub (Mar 25, 2021):

I really think it's a RAM issue.

  1. You said yourself that you don't have much RAM.
  2. The error does not occur deterministically.
  3. The rust process is killed with SIGKILL and that's exactly what a OOM killer would do.
  4. protobuf and librespot-protocol belong to the more resource-intensive crates while compiling, so it makes sense that it aborts there.

You could try to google for tricks to compile rust programs with little memory, or if you don't find anything, ask on users.rust-lang.org

<!-- gh-comment-id:807185018 --> @Johannesd3 commented on GitHub (Mar 25, 2021): I really think it's a RAM issue. 1. You said yourself that you don't have much RAM. 2. The error does not occur deterministically. 3. The rust process is killed with SIGKILL and that's exactly what a OOM killer would do. 4. protobuf and librespot-protocol belong to the more resource-intensive crates while compiling, so it makes sense that it aborts there. You could try to google for tricks to compile rust programs with little memory, or if you don't find anything, ask on users.rust-lang.org
Author
Owner

@roderickvd commented on GitHub (Mar 25, 2021):

1GB is enough to compile even with all features. Surely this is not a librespot bug.

<!-- gh-comment-id:807203297 --> @roderickvd commented on GitHub (Mar 25, 2021): 1GB is enough to compile even with all features. Surely this is not a librespot bug.
Author
Owner

@sashahilton00 commented on GitHub (Mar 26, 2021):

I believe I have encountered this before when I used to use a RPi 2 as a connect receiver. I'd suggest either cross compiling or a swap file of 2G or so, though this won't be great for the SD card if that's what you're running it off. Anyway, closing as this isn't a librespot bug from what I can tell.

<!-- gh-comment-id:807859909 --> @sashahilton00 commented on GitHub (Mar 26, 2021): I believe I have encountered this before when I used to use a RPi 2 as a connect receiver. I'd suggest either cross compiling or a swap file of 2G or so, though this won't be great for the SD card if that's what you're running it off. Anyway, closing as this isn't a librespot bug from what I can tell.
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#390
No description provided.