ccgauche/ytermusic

Cross compilation for aarch64 report

Opened this issue · 2 comments

shrx commented

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/",
]
  1. 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.

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

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.