!RbXGJhHMsnQcNIDFWN:nixos.org

Haskell in Nixpkgs/NixOS

725 Members
For discussions and questions about Haskell with Nix, cabal2nix and haskellPackages in nixpkgs | Current Docs: https://haskell4nix.readthedocs.io/ | More Nix: #community:nixos.org | More Haskell: #haskell-space:matrix.org145 Servers

Load older messages


SenderMessageTime
26 Apr 2025
@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
@aleksana:mozilla.orgaleksana 🏳️‍⚧️ (force me to bed after 18:00 UTC)Is cross broken in newer versions?09:36:26
@alex:tunstall.xyzAlexLast I checked, yes.09:36:44
@aleksana:mozilla.orgaleksana 🏳️‍⚧️ (force me to bed after 18:00 UTC)
In reply to @aleksana:mozilla.org

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)                                      \
      |          ^

Is this the error or there are more?
09:37:07
@alex:tunstall.xyzAlexThere are more to come.09:37:28
@alex:tunstall.xyzAlex pkgsCross.loongarch64-linux.haskell.compilers.native-bignum.ghc96 should show you those errors, provided we don't have an assert there to save users time. 09:38:31
@aleksana:mozilla.orgaleksana 🏳️‍⚧️ (force me to bed after 18:00 UTC)There's a 9.6.6 deb for loongarch64 in debian ports actually09:39:49
@aleksana:mozilla.orgaleksana 🏳️‍⚧️ (force me to bed after 18:00 UTC)But it's 140M and I don't know how to make it persistent09:40:13
@alex:tunstall.xyzAlex If you can run it check ghc --info. It'll give some insight into how they built it. Most likely native unregjsterised. 09:41:08
@aleksana:mozilla.orgaleksana 🏳️‍⚧️ (force me to bed after 18:00 UTC)
In reply to @alex:tunstall.xyz
If you can run it check ghc --info. It'll give some insight into how they built it. Most likely native unregjsterised.
They do support llvm
09:50:12
@aleksana:mozilla.orgaleksana 🏳️‍⚧️ (force me to bed after 18:00 UTC)The problem is in our derivation I think, some guide just said they cross compiled ghc 9.6 like your suggestion without issues09:51:03
@aleksana:mozilla.orgaleksana 🏳️‍⚧️ (force me to bed after 18:00 UTC)
In reply to @aleksana:mozilla.org

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
Because _build/stageBoot/bin/loongarch64-unknown-linux-gnu-hsc2hs --cc=gcc --ld=gcc
09:58:26
@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
So there's apparently no native-bignum for newer ghc, and even if native-bignum is prefixed, it is still hadrian
10:29:53
@sternenseemann:systemli.orgsterni (he/him) aleksana 🏳️‍⚧️ (force me to bed after 18:00 UTC): using foreign packages in stead of a bindist failed last time someone tried, I think GHC has a lot of absolute path references that are a big pain to patch after the fact 11:24:50
@sternenseemann:systemli.orgsterni (he/him) aleksana 🏳️‍⚧️ (force me to bed after 18:00 UTC): native-bignum is just GHC without gmp, no relation to the build system 11:25:07
@aleksana:mozilla.orgaleksana 🏳️‍⚧️ (force me to bed after 18:00 UTC)
In reply to @sternenseemann:systemli.org
aleksana 🏳️‍⚧️ (force me to bed after 18:00 UTC): native-bignum is just GHC without gmp, no relation to the build system
I don't get it why native bignum is an option alongside hadrian
11:26:11
@sternenseemann:systemli.orgsterni (he/him)it's not along side hadrian at all11:26:50
@sternenseemann:systemli.orgsterni (he/him)native-bignum is the name for the bignum library GHC has which is native, i.e. written in Haskell11:27:16
@sternenseemann:systemli.orgsterni (he/him)it can be used as an alternative to gmp which is the default11:27:28
@sternenseemann:systemli.orgsterni (he/him)hadrian is the build system of GHC which was made the default in 9.4 and exclusive in 9.611:27:46
@aleksana:mozilla.orgaleksana 🏳️‍⚧️ (force me to bed after 18:00 UTC)
In reply to @sternenseemann:systemli.org
it's not along side hadrian at all
But you see every version is either defined with import common-hadrian.nix or import common-make-native-bignum.nix
11:27:54
@aleksana:mozilla.orgaleksana 🏳️‍⚧️ (force me to bed after 18:00 UTC)What does this mean11:28:17
@sternenseemann:systemli.orgsterni (he/him) it's named like that because alongside common-make-native-bignum.nix there would be common-make-integer-simple.nix, but since we only have one GHC that would use it (8.10.7.nix) I never bothered to make a common file 11:29:17
@sternenseemann:systemli.orgsterni (he/him)and they are basically the same, they just renamed integer-simple to native-bignum at some point, so some inputs in the nix expression change which makes it annoying to make a common expression for both11:30:01
@sternenseemann:systemli.orgsterni (he/him)(it would be kind of a good project to make some cross compiled GHCs and upload them to tarballs.nixos.org before 25.11, doesn't look like we can keep around GHC 9.4 for that long)11:32:32
@aleksana:mozilla.orgaleksana 🏳️‍⚧️ (force me to bed after 18:00 UTC)
In reply to @sternenseemann:systemli.org
(it would be kind of a good project to make some cross compiled GHCs and upload them to tarballs.nixos.org before 25.11, doesn't look like we can keep around GHC 9.4 for that long)
But the current expression is a bunch of spaghetti and I don't think I can jump across all the cases as I'm not the writer of that
11:35:30
@aleksana:mozilla.orgaleksana 🏳️‍⚧️ (force me to bed after 18:00 UTC)Plus I don't understand haskell yet11:35:45
@sternenseemann:systemli.orgsterni (he/him)Yeah, I did not mean you should do it.11:36:01
@qyliss:fairydust.spaceAlyssa Rossthe most pragmatic approach might be to focus on other loongarch64 things for now and hope upstream has bootstrap binaries before too long.11:36:32

Show newer messages


Back to Room ListRoom Version: 6