DragonMinded / libdragon

Open source library for N64 development.
https://libdragon.dev
The Unlicense
748 stars 108 forks source link

ARM platforms not supported in the Dockerfiles on GHCR #504

Open jchillerup opened 8 months ago

jchillerup commented 8 months ago

The docs state that ARM is a supposed platform for the Docker way of installing libdragon, but it seems not to be the case. Using the libdragon CLI on my ARM based Mac I get the following:

➜  subi git:(main) ✗ libdragon init
Initializing a libdragon project at /Users/jc/code/subi
Downloading docker image: ghcr.io/dragonminded/libdragon:latest
latest: Pulling from dragonminded/libdragon
no matching manifest for linux/arm64/v8 in the manifest list entries
Command docker pull ghcr.io/dragonminded/libdragon:latest exited with code 1.

I was able to pull the image manually by specifying --platform to Docker pull, which means it'll run in emulated mode:

➜  subi git:(main) ✗ docker pull --platform x86_64 ghcr.io/dragonminded/libdragon:trunk
trunk: Pulling from dragonminded/libdragon
bccd10f490ab: Pull complete 
c3a178414c27: Pull complete 
90dbcfe357cb: Pull complete 
Digest: sha256:b0263d3ed69068f5eaf0070a0cf2e2b379d3b37e36fe37737cf840eb03f16473
Status: Downloaded newer image for ghcr.io/dragonminded/libdragon:trunk
ghcr.io/dragonminded/libdragon:trunk

Happy to attempt to fix it myself and submit a PR, but not sure what would be preferred:

Please advise. And thanks for volunteering your time to this project :)

rasky commented 8 months ago

It is supported normally but it requires me to manually remember to push the ARM image anytime there is a Dockerfile change, because GitHub CI doesn’t support arm64 last I checked.

The dockerfile was just updated yesterday and I haven’t pushed the updated image yet.

if you want to check if GitHub Action supports arm now and open a PR, that’d be great. I have a local script that I use to push the updated image, which also merges the two manifests. I can send it for reference

jchillerup commented 8 months ago

OK, I looked at it a bit more, basically trying bullet 2. The issue is that gcc-multilib is not supported on arm64 at all, so maybe a good-for-now solution would be to use Rosetta, i.e. force the CLI to fetch the linux/amd64 platform on Macs for now?

rasky commented 8 months ago

You don’t need gcc-multilib for the ARM build. Just comment it and it will build