!RbXGJhHMsnQcNIDFWN:nixos.org

Haskell in Nixpkgs/NixOS

713 Members
For discussions and questions about Haskell with Nix, cabal2nix and haskellPackages in nixpkgs | Current Docs: https://haskell4nix.readthedocs.io/142 Servers

Load older messages


SenderMessageTime
25 Apr 2025
@shapr:cofree.coffeeshaprFor my own use, stock nixpkgs is fine 99% of the time.15:41:25
26 Apr 2025
@aleksana:mozilla.orgaleksana 🏳️‍⚧️ (force me to bed after 18:00 UTC)I'm trying to build our haskell ecosystem part in Nixpkgs on loongarch64. loongarch64 support of haskell is only available after ghc>=9.12 and llvm>=18. Currently our default is ghc 9.6 and llvm 15.03:54:06
@aleksana:mozilla.orgaleksana 🏳️‍⚧️ (force me to bed after 18:00 UTC)There are two issues here, the less significant issue is that I need to change the default ghc version to 9.12, but I don't know how compatible our stackage is with this version.03:55:29
@aleksana:mozilla.orgaleksana 🏳️‍⚧️ (force me to bed after 18:00 UTC)The bigger issue is that I can't rely on 9.10 to compile 9.12, like we do now, so I should package a binary distribution of 9.12, but upstream does not publish binary distribution built for loongarch64.03:56:56
@aleksana:mozilla.orgaleksana 🏳️‍⚧️ (force me to bed after 18:00 UTC)Oh, there's hadrian bootstrap source, but upstream only publishes 9.8 and 9.1004:01:30
@aleksana:mozilla.orgaleksana 🏳️‍⚧️ (force me to bed after 18:00 UTC)Wait, seems like the support is older than I got, I just have to get a set of patches04:10:25
@aleksana:mozilla.orgaleksana 🏳️‍⚧️ (force me to bed after 18:00 UTC)
In reply to @aleksana:mozilla.org
Oh, there's hadrian bootstrap source, but upstream only publishes 9.8 and 9.10
It's not ghc with hc files generated 😣
04:38:25
@alex:tunstall.xyzAlex
In reply to @aleksana:mozilla.org
The bigger issue is that I can't rely on 9.10 to compile 9.12, like we do now, so I should package a binary distribution of 9.12, but upstream does not publish binary distribution built for loongarch64.
You can cross-compile 9.4 using the LLVM backend and use that to natively compile newer versions.
09:10:30
@aleksana:mozilla.orgaleksana 🏳️‍⚧️ (force me to bed after 18:00 UTC)
In reply to @alex:tunstall.xyz
You can cross-compile 9.4 using the LLVM backend and use that to natively compile newer versions.
There's no loongarch64 support in ghc94 at all
09:15:18
@aleksana:mozilla.orgaleksana 🏳️‍⚧️ (force me to bed after 18:00 UTC)I'm trying to cross compile ghc 9.8.4 with no luck09:15:37
@alex:tunstall.xyzAlexIt doesn't matter. You can use unregisterised mode.09:15:40
@alex:tunstall.xyzAlex AFAIK cross is completely broken with Hadrian.
If you can get it to work, I'd love to know how.
09:16:05
@aleksana:mozilla.orgaleksana 🏳️‍⚧️ (force me to bed after 18:00 UTC)
In reply to @alex:tunstall.xyz
AFAIK cross is completely broken with Hadrian.
If you can get it to work, I'd love to know how.
I don't write haskell at all tbh
09:16:27
@aleksana:mozilla.orgaleksana 🏳️‍⚧️ (force me to bed after 18:00 UTC)
In reply to @alex:tunstall.xyz
It doesn't matter. You can use unregisterised mode.
Do we have nix code for unregisterised mode already?
09:17:14
@alex:tunstall.xyzAlexUnregisterised GHC relies entirely on the C compiler and needs no knowledge of the target architecture.09:17:16
@alex:tunstall.xyzAlexYes, you can set it explicitly, but GHC will do so automatically if it doesn't recognise the architecture anyway.09:17:49
@aleksana:mozilla.orgaleksana 🏳️‍⚧️ (force me to bed after 18:00 UTC) Oh so pkgsCross.loongarch64-linux.haskell.packages.ghc984.ghc is hadrian 09:21:05
@aleksana:mozilla.orgaleksana 🏳️‍⚧️ (force me to bed after 18:00 UTC) I have to use pkgsCross.loongarch64-linux.haskell.packages.native-bignum.ghc984.ghc and temporarily override enableUnregisterised 09:22:57
@magic_rb:matrix.redalder.orgmagic_rbYoure porting ghc to loongarch?09:26:26
@aleksana:mozilla.orgaleksana 🏳️‍⚧️ (force me to bed after 18:00 UTC)
In reply to @magic_rb:matrix.redalder.org
Youre porting ghc to loongarch?
Not porting, just making it work in nixpkgs
09:26:42
@aleksana:mozilla.orgaleksana 🏳️‍⚧️ (force me to bed after 18:00 UTC)The porting work has largely done on ghc>=9.6.6 and llvm>=16 actually09:27:06
@magic_rb:matrix.redalder.orgmagic_rb Ah, i went to aliexpress, punched in loongarch64, got a page full of toothbrushes lol 09:27:21
@magic_rb:matrix.redalder.orgmagic_rb
In reply to @aleksana:mozilla.org
The porting work has largely done on ghc>=9.6.6 and llvm>=16 actually
Does the NCG support loongarch64 these days?
09:27:38
@aleksana:mozilla.orgaleksana 🏳️‍⚧️ (force me to bed after 18:00 UTC)
In reply to @magic_rb:matrix.redalder.org
Does the NCG support loongarch64 these days?
I don't think so
09:27:54
@aleksana:mozilla.orgaleksana 🏳️‍⚧️ (force me to bed after 18:00 UTC)
In reply to @aleksana:mozilla.org
I have to use pkgsCross.loongarch64-linux.haskell.packages.native-bignum.ghc984.ghc and temporarily override enableUnregisterised

Both results in

/nix/store/yfnsdzxp90xkwaxnm467y660nsj4zzgb-libffi-loongarch64-unknown-linux-gnu-3.4.7-dev/include/ffitarget.h:38:2: error: #error "libffi was configured for a LoongArch target but this does not appear to be a LoongArch compiler."
   38 | #error \
      |  ^~~~~
/nix/store/yfnsdzxp90xkwaxnm467y660nsj4zzgb-libffi-loongarch64-unknown-linux-gnu-3.4.7-dev/include/ffitarget.h:66:2: error: #error unsupported LoongArch base architecture
   66 | #error unsupported LoongArch base architecture
      |  ^~~~~
In file included from _build/stage0/libraries/ghci/build/GHCi/FFI_hsc_make.c:1:
FFI.hsc: In function ‘main’:
FFI.hsc:171:16: error: ‘FFI_DEFAULT_ABI’ undeclared (first use in this function); did you mean ‘FFI_LAST_ABI’?
/build/ghc-9.8.4-source/_build/stageBoot/lib/template-hsc.h:45:10: note: in definition of macro ‘hsc_const’
   45 |     if ((x) < 0)                                      \
      |          ^
FFI.hsc:171:16: note: each undeclared identifier is reported only once for each function it appears in
/build/ghc-9.8.4-source/_build/stageBoot/lib/template-hsc.h:45:10: note: in definition of macro ‘hsc_const’
   45 |     if ((x) < 0)                                      \
      |          ^

09:28:10
@aleksana:mozilla.orgaleksana 🏳️‍⚧️ (force me to bed after 18:00 UTC)

Is because of this

#ifndef __loongarch__
#error \
  "libffi was configured for a LoongArch target but this does not appear to be a LoongArch compiler."
#endif
09:30:56
@alex:tunstall.xyzAlex Have you tried pkgsCross.loongarch64-linux.haskell.compilers.native-bignum.ghc94 instead? 09:33:09
@aleksana:mozilla.orgaleksana 🏳️‍⚧️ (force me to bed after 18:00 UTC)
In reply to @alex:tunstall.xyz
Have you tried pkgsCross.loongarch64-linux.haskell.compilers.native-bignum.ghc94 instead?
host platform inferred as: x86_64-unknown-linux
Unknown CPU loongarch64

I have enableUnregistered set to true

09:35:14
@aleksana:mozilla.orgaleksana 🏳️‍⚧️ (force me to bed after 18:00 UTC) enableUnregisterised 09:35:31
@alex:tunstall.xyzAlex In configurePhase? Might need a bit of patching then :/ 09:35:59

Show newer messages


Back to Room ListRoom Version: 6