mirror of
https://github.com/librespot-org/librespot.git
synced 2026-04-27 08:15:50 +03:00
[GH-ISSUE #1184] Can't successfully cross-compile librespot for arm-unknown-linux-musleabihf on ubuntu 22.04 #547
Labels
No labels
A-Alsa
SpotifyAPI
Tokio 1.0
audio
bug
can't reproduce
compilation
dependencies
duplicate
enhancement
good first issue
help wanted
high priority
imported
imported
invalid
new api
pull-request
question
reverse engineering
wiki
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/librespot#547
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @BliemHax on GitHub (Jul 4, 2023).
Original GitHub issue: https://github.com/librespot-org/librespot/issues/1184
Question:
Can't successfully cross-compile ‘librespot’ for arm-unknown-linux-musleabihf on ubuntu 22.04.
Error Log on run
cargo build:cargo buildCommand:Full Log:
Environment:
cargo --target: arm-unknown-linux-musleabihf (must using musl because usingguneabihfcant run on target device. )Action that I did:
Downloaded the
muslcompilation toolchain from musl.cc, versioncrossarm-linux-musleabihf,and added the toolchain path to the PATH:https://musl.cc/arm-linux-musleabihf-cross.tgzPATH is:
/opt/arm-linux-musleabihf/binAdd armhf support to dpkg and change armhf software source to "China Tsinghua University open source software mirror":
cargo buildAdditional context
The dockerfile provided by repo does not compile to musl. my attempts to use rust-musl-cross and install the environment manually also failed, so I tried to compile it manually myself instead of docker, if you have any good ideas please let me know. I will try to compile on Pi4 on July 4, 2023 at +8 PM GMT.
@herrernst commented on GitHub (Oct 8, 2023):
So your compilation fails when linking with libasound. In my experience, linking to system binaries is the most painful thing when cross-compiling rust. As a workaround/test you could try adding the flag
--no-default-featurestocargo buildso that the default audio backendrodio-backenddoesn't get compiled. Then you would only have a stdout/pipe audio device which you propably could just pipe toaplay.@gpajot commented on GitHub (Apr 1, 2024):
Hello @BliemHax, if you are still interested, this might be of some help: https://github.com/librespot-org/librespot/pull/1263
What makes it work is using ubuntu 18.04 and fixing C/openssl/sound library links.