KRTirtho / spotube

🎧 Open source Spotify client that doesn't require Premium nor uses Electron! Available for both desktop & mobile!
https://spotube.krtirtho.dev/
Other
28.53k stars 1.18k forks source link

Successfull arm64 build #1425

Open SilPan opened 4 months ago

SilPan commented 4 months ago

I would like to report that I was able to successfully create an arm64 build.

There were several issues in the past regarding this, apparently it is difficult.

I was unsuccessful with RaspberryPiOS and Debian due to old packages, but Ubuntu22.04 arm worked.

The packages mentioned in CONTRIBUTION.md were sufficient.

I used source version v3.6.0, to play around with a tiny media computer on a RaspberryPi and the new remote control feature :D

For it to actually run on RaspberryPiOS I had to patch out discord, otherwise it would not run.

Find ubuntu arm cloud images here.

@KRTirtho What were the issues you had with CircleCI & ARM? I would like to help automate this.

SilPan commented 4 months ago

So what I described up there I did with qemu-system-aarch64, but now I was able to get CircleCI build the arm version :D

https://app.circleci.com/pipelines/circleci/FGdqDakLr1hfC2iZkHo2qj/UbbkGQEN4gGm2oyFVgV4aK/8/workflows/29acfa34-3d0d-4eba-9e99-8218567ccd40/jobs/5/steps

Have a look at my circleci config, it just hang because of ubuntu's weird necessary user interaction during apt upgrade and I needed to create some empty ENV vars.

I patched out the Github stuff from the CircleCI config so I can play around, therefore it is unfit for a PR, but maybe we can get automated arm64 builds running together.

KRTirtho commented 4 months ago

That's a great success. My CircleCI free tier got full thus the builds were not working anymore. I was already using for a lot other projects before so that's why.

Btw, GIthub Actions recently added Apple m1 (aarch64) runner support. So, theoretically we can build linux arm binaries through docker in a macos runner. It'll be better as everything will be done in a single place.

SilPan commented 4 months ago

Ahja!

It's impossible to find Apple M1 runners if you only search for aarch64 :(

It's kind of a hack, and a shame that github does not provide aarch64 runners just like that, but I'll look into it.

KRTirtho commented 4 months ago

I was finally able successfully build for aarch64 through Github CI. Well not through M1 because Apple Sillicon doesn't support nested virtualization (Docker in Docker). So used Docker buildx with qemu arm64 emulation to build the flutter app on a traditoinal ubuntu 22.04 runner.

KRTirtho commented 4 months ago

New updated ARM-64 binaries are available on the nightly

RPM is not available though as the packager flutter_distributor doesn't support arm64 for RPM yet (I think I've to create another PR)

SilPan commented 4 months ago

Wow. That's great!

Aarch64 emulation on amd64 with qemu is a bit slow, that's what I did in my manual builds. What I tried to do now was: on a MacOS github runner create a docker image that builds on top of ubunru22.04 then install all the dependencies and flutter. Then use this docker image to build spotube in again on a MacOS runner. I split it so that the dependency installation and so on does not have to happen every time spotube is built.

But I got stuck at running docker on mac from the commandline... I never used Mac before :sweat: Here is my experiment.

If I get it working eventually we may be able to speed up the build significantly. But let's see what my motivation is since it is already working XD

Great Job!

SilPan commented 4 months ago
Docker in Docker is not nested virtualization, because Docker itself is not virtualization. Just containerization. That works solely with namespaces and separation. With Docker one uses the host OS's kernel and not bring a new one, like with a virtualized OS. That's why it is so damn fast.

But i see how Docker in Docker could bring trouble. I honestly never tried this before.