!tQOOewZWVcFfpzaVMb:matrix.org

static-haskell-nix

29 Members
Haskell static executable building with nix - https://github.com/nh2/static-haskell-nix/6 Servers

Load older messages


SenderMessageTime
31 Aug 2022
@kadokusei10:matrix.orgkadokusei10

And you are correct again,
just confirmed with

$ ldd result/bin/scratch 
        libc.so => /nix/store/...-musl-1.2.3/lib/libc.so
        ...
14:55:00
@kadokusei10:matrix.orgkadokusei10I was under the impression the allure of pkgsMusl was for building statically, so much so that that was the default when using pkgsMusl, but I was wrong14:55:42
@cdepillabout:matrix.orgcdepillaboutah, I see14:56:02
@kadokusei10:matrix.orgkadokusei10 Anyways, thanks for letting me know about haskell-updates building of musl-ghc, I am going to make great use of it :) Good night! 15:05:06
@tristanc_:matrix.orgtristanCfor what its worth, dhall is built using pkgsMusl with these extra configure flags: https://github.com/dhall-lang/dhall-haskell/blob/4763acc7c6d9172bb7e26a990884fa1302eecca7/nix/shared.nix#L282-L294 .17:59:21
@kadokusei10:matrix.orgkadokusei10
In reply to @tristanc_:matrix.org
for what its worth, dhall is built using pkgsMusl with these extra configure flags: https://github.com/dhall-lang/dhall-haskell/blob/4763acc7c6d9172bb7e26a990884fa1302eecca7/nix/shared.nix#L282-L294 .

Thanks! I wonder what is the difference. As I was looking at the build logs from Nix yesterday it looks like choosing pkgsStatic caused everything to be built with musl anyway (i.e. not glibc)

Perhaps using pkgsMusl directly with flags gives one more control?

23:47:33
18 Sep 2022
@imdoor:ilgt.lvimdoor changed their profile picture.23:50:40
26 Sep 2022
@jonathanlking:matrix.orgJonathan King joined the room.22:07:03
@jonathanlking:matrix.orgJonathan King set a profile picture.22:11:12
5 Nov 2022
@jstranik:matrix.orgjstranik joined the room.00:43:47
1 Feb 2023
@mon:tchncs.deribosomerocker joined the room.12:30:35
12 Feb 2023
@garyalvarez:matrix.org@garyalvarez:matrix.org joined the room.20:54:34
13 Feb 2023
@garyalvarez:matrix.org@garyalvarez:matrix.orgRedacted or Malformed Event00:32:08
@nh2:matrix.orgnh2 banned @garyalvarez:matrix.org@garyalvarez:matrix.org ("earn money" Spam ).05:36:20
22 Apr 2023
@ashinnv:matrix.orgmagnolia_mayhem joined the room.04:56:55
29 Apr 2023
@imlostlmao:matrix.orgimlostlmao joined the room.19:44:13
12 May 2023
@ralph:fx45.in@ralph:fx45.in joined the room.12:15:04
20 May 2023
@ralph:fx45.in@ralph:fx45.in left the room.23:09:18
29 May 2023
@ashinnv:matrix.orgmagnolia_mayhem changed their profile picture.00:21:25
13 Jun 2023
@jonathanlking:matrix.orgJonathan King

sterni: Hey, hope you’re the right person to ask; at Zurihac while hacking on upgrading things, we discovered that to override GHC you need to do it in two places, both ghc and buildHaskellPackages.ghc — see https://github.com/nh2/static-haskell-nix/pull/116/commits/d90f0ec550a445d489c39a146d2dfd60febb97f2#diff-bc08e3f437e81e48e6466e55a2538708af58937c58337058cfa275d8c58029daR1565

Does this seem the right way to do it and would https://github.com/NixOS/nixpkgs/blob/master/doc/languages-frameworks/haskell.section.md be the right place to document this?
We spent quite a while trying to figure this out, so would be good to save others the time in future.

19:44:22
@sternenseemann:systemli.orgsterni Jonathan King: https://github.com/NixOS/nixpkgs/issues/235960; though I would not use overlays to the haskell package set to change GHC, as it is constitutive to it; I'd override it via haskellPackages.override { ghc = …; } although depending on your situation you'd need to pass a separate buildHaskellPackages in as well 20:07:03
@sternenseemann:systemli.orgsterni I'll have to look into how to make this nicer, but honestly since buildHaskellPackages in the end goes back to the nixpkgs fixpoint it seems better to rely on that instead of propagating overlays magically through multiple package sets 20:08:21
@sternenseemann:systemli.orgsterniif you apply your changes via a nixpkgs overlay they should propagate correctly anyways, I think, if you overlay the changed ghc, definitely20:08:56
@sternenseemann:systemli.orgsterniah right that's what you are doing20:09:56
@sternenseemann:systemli.orgsterni in short the thing is that haskellPackages and buildHaskellPackages are independent, yet related, in the native case of course the same, but you need to sure that they are both modified 20:11:09
@sternenseemann:systemli.orgsterniusually it would be easiest to apply the change not to a package set in isolation, but to the nixpkgs fixpoint20:11:33
@jonathanlking:matrix.orgJonathan King Yes, so the issue was that when we didn’t override the ghc in buildHaskellPackages (as we didn’t realise it was a thing) and then got confused about having two different versions of GHC (and one without the override we wanted). 20:12:42
@jonathanlking:matrix.orgJonathan KingI’d like to maybe signpost this in some documentation.20:13:14
14 Jun 2023
@nh2:matrix.orgnh2 sterni: maybe a helper function overrideGhc that takes a lambda and ensures to apply it on both ghc and the one in buildHaskellPackages would be a good thing? 00:22:02
@sternenseemann:systemli.orgsterni I'm not sure that is a good idea, since it would fall apart in the face of cross compilation, since the lambda would capture only the self fixpoint of the current package set, so package set relative references (buildPackages, self, targetPackages) would be resolved incorrectly for the buildHaskellPackages ghc 12:38:27

Show newer messages


Back to Room ListRoom Version: 6