lierdakil / pandoc-crossref

Pandoc filter for cross-references
https://lierdakil.github.io/pandoc-crossref/
GNU General Public License v2.0
909 stars 73 forks source link

Support arm64 #416

Open axiopaladin opened 7 months ago

axiopaladin commented 7 months ago

I'd love to be able to use this on my aarch64 device. As pandoc already releases a generic linux-arm64 binary (and has since v2.12, back in 2021), it would be nice to get crossref working on these systems too.

I tried compiling from source with stack and it throws this error:

$ stack install
Stack has not been tested with GHC versions above 9.0, and using 9.6.2, this may fail
Unable to find installation URLs for OS key: linux-aarch64-ncurses6

(Also, extra bonus points if anyone wants to send it into the alpine package repo afterwards)

axiopaladin commented 7 months ago

I just tried compiling with cabal v2-install too and that also failed, though it looked like it got a lot farther. I also saw a lot of linker failures, so it might actually be due to me running it on a musl system without glibc?

(I would hope that the final output is just a static binary though, as the pandoc-arm64 binary seems to work on my musl system.)

lierdakil commented 6 months ago

TBF, I don't have any aarch64 machines handy, and I don't have the bandwidth to experiment with getting a build working in docker on a recently-announced M1 macs on github actions. Cross-compilation with GHC is famously borked in the presence of Template Haskell and even if I stripped it from pandoc-crossref, dependencies use it, so it's likely a non-starter (workarounds exist, but they still require a working GHC on a target arch and are notoriously buggy). Building in an emulator will just take the better half of forever.

If you're feeling adventurous, you can try to experiment with getting Nix to cooperate. In the happy version of the universe, it would be as easy as nix build git+https://github.com/lierdakil/pandoc-crossref on the arm machine, although AFAIU that wouldn't produce a static binary. There may be an easy way to get a static build, but I can't check because, again, I don't have aarch64 handy.