Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ARM64 Builds #1209

Closed
lewis262626 opened this issue May 8, 2023 · 7 comments
Closed

ARM64 Builds #1209

lewis262626 opened this issue May 8, 2023 · 7 comments
Labels
ci CI related issues or improvements enhancement A new feature that would improve Spotifyd

Comments

@lewis262626
Copy link

lewis262626 commented May 8, 2023

Is your feature request related to a problem? Please describe.
I'd like Spotifyd to include a Linux ARM64 build. I can currently work around this by installing the 32-bit C libraries but I'd prefer a native 64bit build.

I'm running on Raspbian Buster on a Raspberry Pi 4B+.

Describe the solution you'd like
GitHub actions to test, build and release a Linux ARM64 build

Describe alternatives you've considered
You can get Spotifyd working using the armv6 or armhf builds and installing the nesseccary C libraries through your package manager, but this requires installing extra dependencies just for one program. I'd like Spotifyd to run out of the box on the 64bit Raspberry PIs

dpkg --print-architecture
arm64
readelf -a spotifyd | grep interpreter:
      [Requesting program interpreter: /lib/ld-linux-armhf.so.3]
@lewis262626 lewis262626 added the enhancement A new feature that would improve Spotifyd label May 8, 2023
@lewis262626
Copy link
Author

Similar issue: #1114

@eladyn eladyn added the ci CI related issues or improvements label May 8, 2023
@jessebot
Copy link

jessebot commented Jun 5, 2023

This is also useful if you want to run a docker container on an mac M1 or later, because they also use ARM64 and so the docker containers built for linux/arm64 work better.

What is armhf anyway? Is that the linux/arm64? does the linux armhf tarball have a working binary for this use case?

@lewis262626
Copy link
Author

This is also useful if you want to run a docker container on an mac M1 or later, because they also use ARM64 and so the docker containers built for linux/arm64 work better.

What is armhf anyway? Is that the linux/arm64? does the linux armhf tarball have a working binary for this use case?

Armhf stands for Arm32 *hard float *. Hard float meaning hardware support for floating point calculations. So, yep you can run armhf on an arm32 Linux but you've got to install loads of arm32 packages such as libc etc.

Apple devices can use Docker like you said or Rosetta

@jessebot
Copy link

jessebot commented Jun 7, 2023

Armhf stands for Arm32 *hard float *. Hard float meaning hardware support for floating point calculations. So, yep you can run armhf on an arm32 Linux but you've got to install loads of arm32 packages such as libc etc.

Thank you very much for your help in understanding 🙏

I don't know if anyone is interested, but if it helps, I wrote this small Dockerfile to produce a linux/arm64 debian package. I'll just post it here in case anyone needs it for this or any other rust project:

# this file is just a rust builder for ARM
FROM --platform=linux/arm64/v8 rust:slim-bookworm

# this could be any rust repo
ENV RUST_REPO="https://github.com/Spotifyd/spotifyd.git"
# all the prereq packages you need to install, separated by spaces
ENV APT_PKGS="libasound2-dev libssl-dev libpulse-dev libdbus-1-dev"

# install prereqs for spotifyd and install cargo-deb for making debian packages
RUN apt update && \
    apt install -y --no-install-recommends git $APT_PKGS && \
    cargo install cargo-deb

# # clone the rust repo
RUN git clone $RUST_REPO /app

WORKDIR /app

# build the rust package and copy it to /
RUN cargo deb && \
    cp ./target/debian/*.deb /

To just run the docker container and get the spotifyd_0.3.5_arm64.deb out of it, you can do:

# build the docker image, but you could also grab the code from this file and do a multistage build
docker buildx build --platform=linux/arm64 -t rustbuilder:spotifyd-dev .

# this creates the docker image and copies the deb to your current directory before cleaning up the container
docker cp $(docker create --name rustemp rustbuilder:spotifyd-dev):/spotifyd_0.3.5_arm64.deb . && docker rm rustemp

@MV10
Copy link

MV10 commented Jul 7, 2023

and installing the nesseccary C libraries through your package manager

@lewis262626 any chance you'd be willing to elaborate for a *nix n00b (me)?

I've got a Pi4B and some other apps I suspect would benefit from the 64-bit OS, but I'd hate to lose Spotify.

@georgefst
Copy link

Duplicate of #280?

@eladyn eladyn closed this as not planned Won't fix, can't repro, duplicate, stale Oct 15, 2023
@eznuk
Copy link

eznuk commented Nov 10, 2023

I don't know if anyone is interested, but if it helps, I wrote this small Dockerfile to produce a linux/arm64 debian package. I'll just post it here in case anyone needs it for this or any other rust project:
...

@jessebot Awesome, thank you for the instructions!

Just in case anyone has problems extracting the .deb file in the last step: I needed to replace spotifyd_0.3.5_arm64.deb by spotifyd_0.3.5-1_arm64.deb .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci CI related issues or improvements enhancement A new feature that would improve Spotifyd
Projects
None yet
Development

No branches or pull requests

6 participants