angerman changed the topic of #haskell.nix to: https://input-output-hk.github.io/haskell.nix - alternative haskell infrastructure for nix; logs at https://logs.nix.samueldr.com/haskell.nix
craige has joined #haskell.nix
fendor has joined #haskell.nix
__monty__ has joined #haskell.nix
<__monty__> How much of the configure flags stuff is generated by haskell.nix and how much is just a call to cabal configure?
<michaelpj> __monty__: wdym by "the configure flags stuff"
fendor_ has joined #haskell.nix
<__monty__> I'll paste the relevant part if you give me a minute.
<__monty__> Here you go, http://ix.io/2P8I
<__monty__> The configure flags seem to be missing `--dependency=terminfo=terminfo-0.4.1.4`.
fendor has quit [Ping timeout: 272 seconds]
<__monty__> So I'm wondering whether I should look at haskell.nix or cabal for why.
<__monty__> I haven't encountered this before, it's my first time trying to cross-compile.
<angerman> __monty__: is terminfo part of your nonReinstallabePkgs?
<angerman> __monty__: Haskell.nix will generate the cofigutre flags to pass to Setup configure based on the pkgs dependencies. But haskell.nix will usually generate —constraint flags if memory serves right.
<__monty__> There are `--constraint "terminfo == 0.4.1.4` flags higher up but not for terminfo. Maybe because it's only a dependency? How do I check nonReinstallablePkgs, I didn't intentionally add it?
<__monty__> This is the fork I'm doing this in if that helps, https://github.com/toonn/taskell/tree/cross32
<__monty__> Only added default.nix and .github/workflows/haskell.yml iirc.
<michaelpj> __monty__: are you building for musl?
<michaelpj> not sure what "gnu32" is
<angerman> Ahh cross and terminfo... that’s annoying because cross compiler don’t have terminfo iirc.
<__monty__> musl32 didn't work. I assume gnu32 is 32 bit glibc.
<angerman> Yes gnu32 is 32bit glibc
<__monty__> Let me dig up the problem I had with musl32.
<angerman> __monty__: this is what I usually do: https://github.com/input-output-hk/tools/blob/master/arm-test/default.nix
<angerman> But 32bit is in general a bit shaky :-/
<__monty__> Ah yes, with musl32 gmp failed to build, http://ix.io/2P8V
<__monty__> I've never used musl so I figured glibc might be easier to get working.
<__monty__> angerman: What you usually do is comment out terminfo?
<angerman> Taking it out of nonReinstallabePkgs makes Haskell.nix rebuild it.
<angerman> However the nonRenindtallablePkgs set must be a transitive closer set.
<angerman> Sadly we can’t just set it to an empty set.
<__monty__> Do you recommend just including your `modules` basically verbatim or should I find out what the default value of nonReinstallablePkgs is and remove terminfo and anything that depends on it transitively?
<__monty__> Also, do you recommend going with musl32 anyway? I'm fine with whatever's easier : )
<angerman> __monty__: you’d most likely end up with the same set.
<angerman> I’ve only built 64 bit builds to be honest. I haven’t had use for 32 yet.
<__monty__> The taskell builds have been failing on a 32 bit pentium I still use and it's simply too painful to build on it (even with a remote nix builder). That's the only reason I'm looking into cross-compiling : )
<__monty__> Oh, no. Nix has infected GHC and now it's giving errors without locations >.< https://github.com/toonn/taskell/runs/1886984318?check_suite_focus=true#step:5:8581
<__monty__> Is there a way to pass that flag (and find out where I should)?
<angerman> __monty__: haskell.nix should figure that out for TH packages under cross compilation...
<__monty__> I think I'm using a fairly recent haskell.nix commit. This hasn't changed in the last weeks has it?
<angerman> so wait, you are doing i868 (gnu32) cross compilation on x86_64?
<__monty__> Yes.
<angerman> hmm maybe we are missing logic for that...
<angerman> setting it up for gnu32 cross should be fairly trivial.
<__monty__> Shouldn't need qemu though?
<angerman> can you natively execute 32bit code on your x86_64 machine?
<__monty__> Yes. The easiest way to build 32 bit haskell executables would be to run a 32 bit GHC but I've failed at getting that to work so I figured I'd try cross-compiling.
<__monty__> Is there a way to get a 32 bit GHC with haskell.nix? That'd be an acceptable solution to me too.
<angerman> __monty__: yea, even musl is cross compilation, though it has the benefit that musl64 can natively execute on x86_64, so you don't need to do the cross route.
<angerman> __monty__: but you could just plugin in 32bit qemu user-mode into haskell.nix, pretty much ananloguos how it does arm and aarch64 right now, and get something that should work (except for 32bit issues in haskell).
<angerman> __monty__: linux cross is imported in the armv7 overlay ... I can't remeber why that name... seems a bit inappropriate as it does aarch64 as well: https://github.com/input-output-hk/haskell.nix/blob/89f50a96dd45481ef00b6859c7fcddcce563fa76/overlays/armv6l-linux.nix
<__monty__> So if I copy both those files make the minor edit to the first so it applies to gnu32 and add the latter as an overlay when importing haskell.nix it might work?
<angerman> and need to add the 32bit qemu host platform name
<angerman> probably i686 or so
<__monty__> And you're sure this'll be easier than natively building 32 bit or fetching a 32 bit GHC using haskell.nix?
<angerman> I don’t even know how well nix and all the support works on 32bit. The cross logic is pretty robust.
<__monty__> Works great on 32 bit and with a remote builder (which can be x86_64) it's fairly bearable. Processors from over a decade ago are just really really slow with modern software.
<__monty__> Hmm, with qemu (at least if I properly made the changes) it fails to build tz. Did you imply switching to musl at the same time, angerman?
<__monty__> Btw, thanks for all the help. I realize this is a pretty niche usecase.
Hurttila has joined #haskell.nix
aveltras has joined #haskell.nix
hekkaidekapus has joined #haskell.nix
hekkaidekapus} has quit [Ping timeout: 268 seconds]
Hurttila has quit [Ping timeout: 240 seconds]
aveltras has quit [Quit: Connection closed for inactivity]
fendor_ has quit [Remote host closed the connection]
fendor_ has joined #haskell.nix
<__monty__> Hmm, why would I get a musl busybox when try to cross-compile gnu32 on x86_64? /nix/store/ql6qbiymsmgnfk20b6cv58j3f11lk1hk-busybox-1.31.1-x86_64-unknown-linux-musl
hekkaidekapus has quit [Ping timeout: 268 seconds]
hekkaidekapus has joined #haskell.nix
__monty__ has quit [Quit: leaving]
fendor_ has quit [Remote host closed the connection]
freeman42x has joined #haskell.nix