nixfmt icon indicating copy to clipboard operation
nixfmt copied to clipboard

Riscv64 support?

Open Mic92 opened this issue 1 year ago • 2 comments

I have a number of low-level nix projects that I also want to start testing on riscv64 support. However not being evaluate haskell on riscv64, stops me from adding this to my devshell/formatter checks.

I saw that ghc in theory has riscv64 support, is anyone aware of what is holding us back from having it in nixpkgs? Otherwise I maybe have to see if I can make nixpkgs-fmt adopt the new formatting RFC, so there is an implementation that can work everywhere.

Mic92 avatar Mar 19 '24 09:03 Mic92

Otherwise I maybe have to see if I can make nixpkgs-fmt adopt the new formatting RFC

To be frank, you'd have an easier time simply rewriting the nixfmt code base in Rust from scratch.

I don't know much about the Haskell ecosystem, so I can't really help you with the other points. Is there anything that could be done with emulation, or WASM support?

piegamesde avatar Mar 19 '24 09:03 piegamesde

WASM support might be an option. Although the nixpkgs build would than need to pull a wasm binary...

Mic92 avatar Mar 19 '24 14:03 Mic92

For boostraping GHC on RISC-V we need binary packages or a cross-built native GHC.

I was able to cross compile nixfmt some years ago. Should be still possible (might need the haskell.compiler.ghc*: fix libffi cross dependency commit)?

You can join the effort in matrix:#riscv:nixos.org.

0x4A6F avatar Apr 02 '24 18:04 0x4A6F

(discussed in the formatting team)

This is more of a Nixpkgs issue. Once Nixpkgs supports this, nixfmt could also be made to work. Once it does work, you're welcome to integrate it into CI to prevent it breaking in the future.

infinisil avatar Apr 02 '24 19:04 infinisil

This issue has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/formatting-team-meeting-2024-04-02/42658/1

nixos-discourse avatar Apr 02 '24 19:04 nixos-discourse