!RbXGJhHMsnQcNIDFWN:nixos.org

Haskell in Nixpkgs/NixOS

722 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.org144 Servers

You have reached the beginning of time (for this room).


SenderMessageTime
29 Jan 2025
@maralorn:maralorn.demaralornOr is that some kind of fix point where we link a lib compiled with ghc stage-n directly against the lib ghc stage-n?20:53:18
@maralorn:maralorn.demaralornOh, boy, why do I know so little about this. 😄20:53:31
@maralorn:maralorn.demaralornReally looking forward to using that one.20:53:50
@teoc:matrix.orgTeo (he/him)
In reply to @maralorn:maralorn.de
Or is that some kind of fix point where we link a lib compiled with ghc stage-n directly against the lib ghc stage-n?
Iirc stage-2 GHC links against libraries built by stage1 GHC, but that's OK because they are practically the same anyway
21:58:11
@teoc:matrix.orgTeo (he/him)There's this explanation in the Hadrian docs but even with that it's still quite confusing https://gitlab.haskell.org/ghc/ghc/-/tree/master/hadrian#staged-compilation22:01:25
@maralorn:maralorn.demaralornAh, thanks that actually helps me.22:16:28
@maralorn:maralorn.demaralornSo even "reinstallable" dependencies of ghc cannot actually be reinstalled when used together with ghc? Because ghc stage 2 is linked with mtl stage 1 and thus will collide with mtl stage 2?22:19:49
@sternenseemann:systemli.orgsterni (he/him)Not sure you'll have to look at the package db entries i guess22:34:37
@sternenseemann:systemli.orgsterni (he/him)every package that is part of stage1 will also be built in stage222:34:54
@teoc:matrix.orgTeo (he/him)I don't understand it fully but "reinstallability" is mostly a constraint imposed by cabal rather than GHC see mpickering's comments here: https://gitlab.haskell.org/ghc/ghc/-/merge_requests/1329723:30:51
30 Jan 2025
@laurynasp:matrix.orglaurynasp joined the room.08:59:05
@sem:one.ems.hostsem joined the room.21:56:33
@sternenseemann:systemli.orgsterni (he/him)same difference, really22:14:04
@sternenseemann:systemli.orgsterni (he/him)it doesn't really matter when practically all software is built using cabal22:14:22
@maralorn:maralorn.demaralornDoes that mea ghc the lib that hls links against is "ghc stage 3" in that explanation. So basically everything we build is build with ghc stage 2 and linked against stage 2?22:18:33
@maralorn:maralorn.demaralorn* Does that mea ghc the lib that hls links against is "ghc stage 3" in that explanation. So basically everything we build is built with ghc stage 2 and linked against stage 2?22:18:46
@maralorn:maralorn.demaralorn* Does that mean ghc the lib that hls links against is "ghc stage 3" in that explanation. So basically everything we build is built with ghc stage 2 and linked against stage 2?22:18:58
@maralorn:maralorn.demaralornSo the mtl exposed in our ghc pkg-db and a hypthetical mtl built with our nix derivation both are "stage 2". The problem is that "ghc" the lib will be linked against the internal mtl and can those not be coherently used with the own-nix-derivation mtl (especially if that’s another version.)22:22:20
@maralorn:maralorn.demaralornOnly solution would be if we could build ghc the library as a normal Cabal package at least in stage 3?22:22:57
@maralorn:maralorn.demaralornWhat surprises me slightly from this picture is that I always hammer in the point that HLS needs to be compiled with the same GHC which is used to build the project. But now it seems to me like we are not doing that because HLS is linked againts GHC stage 3, while the project is being compiled by ghc stage 2?22:24:31
@maralorn:maralorn.demaralornI am not actually saying that this is a reductio ad absurdum I just want to spell it out, that I was missing the full picture before and trying to get my understanding precise.22:25:41
@teoc:matrix.orgTeo (he/him)
In reply to @maralorn:maralorn.de
Only solution would be if we could build ghc the library as a normal Cabal package at least in stage 3?
Afaik this is possible and there's a job in the GHC CI that ensures this using this code: https://gitlab.haskell.org/ghc/ghc/-/blob/master/hadrian/src/Rules/CabalReinstall.hs
22:26:36
@maralorn:maralorn.demaralorn sterni: Does what I am writing match your understanding? (or at least not contradict it?) 22:45:49
@sternenseemann:systemli.orgsterni (he/him)I'd need to think through it myself honestly22:46:48
@sternenseemann:systemli.orgsterni (he/him)in any case see also https://gitlab.haskell.org/ghc/ghc/-/tree/master/hadrian?ref_type=heads#staged-compilation22:47:00
@sternenseemann:systemli.orgsterni (he/him)no I think the packages in a stage are linked against its siblings so the ghc executable and library are just stage2 (i.e. built using stage1)22:57:30
@sternenseemann:systemli.orgsterni (he/him)default setting of hadrian is to stop after stage2 has been built (i.e. all stage2Packages have been built using stage1).22:57:55
@maralorn:maralorn.demaralornOkay. So we compile everything with ghc stage 2 but link it against boot packages built in stage 1? And especially we build with ghc stage 2 and link against ghc stage 2.22:59:13

Show newer messages


Back to Room ListRoom Version: 6