Closed txoof closed 5 months ago
I've resolved this issue, but I'm not entirely sure why it works. Can anyone explain why this works?
env GOARCH=arm64 GOOS=linux CGO_ENABLED=1 go build -o go-librespot-daemon ./cmd/daemon
Thank you for your interestin go-librespot!
The CGO_ENABLED
flag set to 1
is required for building the code interfaces with the ALSA C library and therefore cannot be disabled.
With GOOS
and GOARCH
you are telling the compiler which operating system and architecture to target.
For additional insigth you can have a look at how the pre-made binaries are built: https://github.com/devgianlu/go-librespot/blob/0774e632a8dfa14c9ac248586d3e8f57afd8a512/.github/workflows/release.yml
@devgianlu Thanks for that explanation. I've got it working properly now.
I'm rather new to GO and trying to build go-librespot on Raspbian Bullseye. I'm a little stuck with the building and hope that someone can point me in the right direction.
I've attempted to build using the default golang package (go 1.19), but I get the message:
Unfortunately, the debian bookworm-backports 1.21 version of Go isn't available for RaspberryPi OS.
Attempting to build from go 1.22.0-linux-armv6l obtained from go.dev aborts with the message below. After some googling, I gather this has something to do with cross compiling, but I'm a bit lost as to where to start with resolving this.
Any suggestions you all can offer are greatly appreciated.
For good measure:
EDIT:
It looks like the env variable
CGO_ENABLED
is playing a part in this, but disabling it causes this: