| 26 Apr 2026 |
alexfmpe | Lotte (it/its)/Cinny (she/her) θΔ&: https://github.com/NixOS/nixpkgs/blob/03de9fe87cb2dcec8da9dbaa3ad1c71ea7fef223/pkgs/top-level/release-haskell.nix#L478 | 16:46:53 |
Alex | Registerised GHC 9.4.8 doesn't work properly in Nixpkgs, so the build is configured to be unregisterised by default.
https://github.com/NixOS/nixpkgs/blob/03de9fe87cb2dcec8da9dbaa3ad1c71ea7fef223/pkgs/development/compilers/ghc/common-make-native-bignum.nix#L99
Use 9.4.8 to boot a later version and you can have a full-featured GHC.
[nixos@nixos:~/system]$ result-ghc/bin/ghc --info | grep -ie platform -e version -e backend -e thr
,("RTS ways","v thr thr_debug thr_debug_dyn thr_dyn debug debug_dyn dyn")
,("target platform string","riscv64-unknown-linux")
,("Project version","9.10.3")
,("Project Version Int","910")
,("Booter version","9.8.4")
,("Build platform","riscv64-unknown-linux")
,("Host platform","riscv64-unknown-linux")
,("Target platform","riscv64-unknown-linux")
,("Target default backend","LLVM")
You can find a working example of how to do this in https://github.com/alexandretunstall/nixos-riscv. In particular, see modules/compilers/ghc.nix. | 20:31:29 |
Lotte (it/its)/Cinny (she/her) θΔ& | yeah i am currently building 9.6.7 now | 20:34:50 |
Lotte (it/its)/Cinny (she/her) θΔ& | cross compiled for running on riscv | 20:35:14 |
alexfmpe | the correct Alex will now take over | 20:35:44 |
Lotte (it/its)/Cinny (she/her) θΔ& | i think i just recreated the hadrian patch in a worse way | 20:35:55 |
Alex | Please do share how if you manage to get that to work. I couldn't convince Hadrian to produce the correct output. | 20:35:58 |
Alex | Also, you may want to double check that the binary is actually for running on riscv64. Hadrian has a tendency to build a stage 2 cross-compiler instead of a stage 1 cross-compiler. | 20:37:04 |
Lotte (it/its)/Cinny (she/her) θΔ& | i also got a bootstrap from a debian 9.6.6 package | 20:37:41 |
Lotte (it/its)/Cinny (she/her) θΔ& | it's still in stage 0 | 20:37:52 |
Lotte (it/its)/Cinny (she/her) θΔ& | lemme look at the object files though | 20:38:19 |
Alex | Ah, if you're booting a fully native build from Debian's GHC it might be fine. I haven't touched Debian's packages. | 20:38:42 |
Alex | * Ah, if you're booting a fully native build from Debian's GHC it might be fine. I haven't tried Debian's packages. | 20:38:51 |
Lotte (it/its)/Cinny (she/her) θΔ& | i was doing it before but i replaced it with a bootstrap from cross compiled ghc9.4.8 | 20:39:32 |
Lotte (it/its)/Cinny (she/her) θΔ& | which is what i originally wanted to do but was foiled by stdenv shenanigans | 20:40:04 |
Lotte (it/its)/Cinny (she/her) θΔ& |  Download asm file in build dir is riscv so it's probably fine | 20:41:07 |
Alex | Nice. Looks promising. Since you mentioned 9.4.8 cross as a boot, is it a native build? | 20:42:24 |
Lotte (it/its)/Cinny (she/her) θΔ& | the 967 build is native | 20:42:58 |
Lotte (it/its)/Cinny (she/her) θΔ& | (running in qemu because my vf2 ain't got the cpu power for that) | 20:43:36 |
Alex | Yeah, that should work without trouble. If it doesn't, I'd be curious to reproduce the issue and investigate why. | 20:43:46 |
Alex | The VF2 can do it, provided you're willing to wait 20h for the GHC derivation alone. :D | 20:44:09 |
Lotte (it/its)/Cinny (she/her) θΔ& | i had an issue with 948 being single threaded which hadrian tried passing +RTS -qg to which single threaded 948 didn't understand | 20:45:48 |
Lotte (it/its)/Cinny (she/her) θΔ& | fixed that though by patching out the flag (the incorrect thing to do seemingly) | 20:46:32 |
Alex | True, I did have to patch that out of Hadrian but never actually took the time to upstream it into Nixpkgs.
It's a bit tricky but possible: https://github.com/AlexandreTunstall/nixos-riscv/blob/df26291108c656d9ec47d4d57caf31810c0498e3/modules/compilers/ghc.nix#L40 | 20:48:11 |
Lotte (it/its)/Cinny (she/her) θΔ& | i put it into postpatch for hadrian | 20:48:58 |
Lotte (it/its)/Cinny (she/her) θΔ& |  Download cursed | 21:09:00 |
emily | just "the mangler"? in my day it was known as the Evil Mangler | 21:09:47 |
emily | also, "a Perl script"? as the file extension clearly shows, it's a literate Perl script | 21:09:59 |
Lotte (it/its)/Cinny (she/her) θΔ& | it's a ghc 5 era doc file | 21:12:59 |
alexfmpe | it's literally a Perl script, what's the problem | 21:41:23 |