unsplash / mercury

The guide of souls to the underworld.
https://unsplash.github.io/mercury/
MIT License
3 stars 0 forks source link

Nix cross-compilation #18

Open samhh opened 9 months ago

samhh commented 9 months ago

nix run works on macOS, however because it's built against our host system the binary fails inside of a container:

$ nix run
2023-10-30T14:53:25.596675Z  WARN No .env found
[...]

$ nix build ".#dockerImage" && ./result | podman load
$ podman run mercury
{"msg":"exec container process `/nix/store/zi27abixfpaq0x4czinw34dyjwvb7lrb-mercury-0.0.0/bin/mercury`: Exec format error","level":"error","time":"2023-10-30T14:55:01.480708Z"}

We could potentially use crossSystem ^1, however that loses access to the Nix binary cache, meaning we end up building the universe.

Thus our options for building the container on macOS are:

samhh commented 9 months ago

This may also affect the container itself as per podman image inspect's Architecture.