ccgauche / ytermusic

An in terminal youtube music client with focus on privacy, simplicity and performance
Apache License 2.0
362 stars 19 forks source link

Cross compilation for aarch64 report #99

Open shrx opened 2 weeks ago

shrx commented 2 weeks ago

Hi, just wanted to let you know that it's possible to cross compile for aarch64 without too much effort (I managed to do it while totally unfamiliar with rust).

What I needed to do (information gathered by googling for similar problems):

  1. Create a Cross.toml file with the following contents (not sure if all absolutely necessary):

    [build]
    default-target = "aarch64-unknown-linux-gnu"
    pre-build = [
    "dpkg --add-architecture $CROSS_DEB_ARCH",
    "apt-get update",
    "apt-get install -y alsa-tools libasound2-dev libdbus-1-dev pkg-config",
    "apt-get install -y alsa-tools:$CROSS_DEB_ARCH libasound2-dev:$CROSS_DEB_ARCH libdbus-1-dev:$CROSS_DEB_ARCH",
    "cp -r /usr/lib/aarch64-linux-gnu/* /usr/aarch64-linux-gnu/lib/",
    ]
  2. build with:

    cross build --target=aarch64-unknown-linux-gnu --release

I first wanted to build it on my raspberry pi directly but I ran out of RAM.

ccgauche commented 1 week ago

Never tried cross for with ytermusic so I don't know if it's expected or not. But cross uses containers so it's possible there is some (a lot) of overhead. Have you tried on a x86 computer with a lot of RAM? I can try it if you want tomorrow.

shrx commented 1 week ago

I compiled on debian x86_64 with 32 GB RAM, I think the total system memory usage did not go over around 5 GB during compilation.