!RbXGJhHMsnQcNIDFWN:nixos.org

Haskell in Nixpkgs/NixOS

685 Members
For discussions and questions about Haskell with Nix, cabal2nix and haskellPackages in nixpkgs | Current Docs: https://nixos.org/manual/nixpkgs/unstable/#haskell | Current PR: https://github.com/nixos/nixpkgs/pulls?q=is%3Apr+is%3Aopen+head%3Ahaskell-updates | Maintainer Docs: https://github.com/NixOS/nixpkgs/blob/haskell-updates/pkgs/development/haskell-modules/HACKING.md | More Nix: #community:nixos.org | More Haskell: #haskell-space:matrix.org | Merger Schedule: https://cloud.maralorn.de/apps/calendar/p/H6migHmKX7xHoTFa/dayGridMonth/now | Join #haskell.nix:libera.chat for question about the alternative haskell.nix infrastructure136 Servers

Load older messages


SenderMessageTime
5 Apr 2025
@divyaranjan:matrix.orgDivyaIndeed. Someday I need to sit down and do the chain from Hugs. It's sad that Haskell hasn't taken care of this.08:44:49
@divyaranjan:matrix.orgDivyaHave you guys talked to the GHC folks?08:45:05
@emilazy:matrix.orgemilyit's not as simple as chaining from Hugs, people have tried but it requires a lot of patching to even start getting anywhere08:46:57
@divyaranjan:matrix.orgDivya
In reply to @emilazy:matrix.org
it's not as simple as chaining from Hugs, people have tried but it requires a lot of patching to even start getting anywhere
Are the people from the Nix community? From Guix, 2-3 people have been trying to do this.
09:15:10
@emilazy:matrix.orgemilymostly not, since Nixpkgs has bigger bootstrapping issues :)09:15:36
@emilazy:matrix.orgemily (and though we might use complicated bootstrap chains to verify binaries, it's unlikely we'd put them into production, since chasing through a dozen GHC builds on every staging-next cycle would be too painful. I'm not sure how Guix copes with that kind of thing tbh) 09:16:28
@divyaranjan:matrix.orgDivya
In reply to @emilazy:matrix.org
(and though we might use complicated bootstrap chains to verify binaries, it's unlikely we'd put them into production, since chasing through a dozen GHC builds on every staging-next cycle would be too painful. I'm not sure how Guix copes with that kind of thing tbh)
I don't think one has to necessarily do that. You'd only have to bootstrap a particular version from a previous one and then just "inherit" that for the next versions.
09:19:44
@emilazy:matrix.orgemilybut when you rebuild core parts of the toolchain, you need to do the bootstrap all over again09:20:58
@me:linj.techlinj
In reply to @divyaranjan:matrix.org
Are the people from the Nix community? From Guix, 2-3 people have been trying to do this.
@alex:tunstall.xyz has done some work
09:22:47
@hellwolf:matrix.orghellwolf
In reply to @emilazy:matrix.org
but when you rebuild core parts of the toolchain, you need to do the bootstrap all over again
wouldn't you freeze the bootstrapped one to a git commit and never touch it again?
09:27:09
@emilazy:matrix.orgemilylet's say you build GHC 4 with Hugs compiled with GCC 1409:27:42
@hellwolf:matrix.orghellwolf* wouldn't you freeze the bootstrapped one to a git commit (of guix pkg? or nixpkgs) and never touch it again?09:28:04
@emilazy:matrix.orgemilythen when you bump GCC to 15, you need to build GHC 4 with Hugs compiled with GCC 1509:28:08
@emilazy:matrix.orgemily ca-derivations would allow short-circuiting once you get to a bit-identical binary output, but that might never happen, e.g., because glibc store path changed 09:28:10
@hellwolf:matrix.orghellwolfi see. i can see running old bin in a new container as a workaround09:29:19
@divyaranjan:matrix.orgDivya
In reply to @emilazy:matrix.org
then when you bump GCC to 15, you need to build GHC 4 with Hugs compiled with GCC 15
Or, you just have Hugs be built with GCC 14? We always have multiple versions of GCC around.
09:30:13
@emilazy:matrix.orgemily ok, but GCC 14 itself changed because glibc got updated 09:31:08
@emilazy:matrix.orgemilyit's true that you could pin an entire separate copy of Nixpkgs (and pay the evaluation cost for an entire separate package tree for everything that uses GHC, and then that multiplies because there are multiple bootstraped packages, etc.)09:31:34
@emilazy:matrix.orgemilyat that point you're also multiplying the amount of source that needs to be trusted for the bootstrap too though09:31:51
@emilazy:matrix.orgemily and the compiler might have bugs on a certain architecture, or glibc with a new kernel, …, so you do not actually want to pin those things forever for the same reason you want to upgrade packages in general 09:32:14
@divyaranjan:matrix.orgDivyaNot sure about how it happens in Nixpkgs, but it's common in Guix to have it this way. The package tree gets evaluated only when built. I can create a package tree separate for GHC 9.2 to 9.12 without the previous package tree being affected. And if you need to change something later, you can always keep the older one separately in another package for that package tree. Maintenance is relatively easier.09:36:53
@toonn:matrix.orgtoonn So GHC 9.2 will link to whatever glibc was current back then forever? Or does this rely on grafting? 09:37:56
@alex:tunstall.xyzAlex
In reply to @divyaranjan:matrix.org
Are the people from the Nix community? From Guix, 2-3 people have been trying to do this.

I don't think anybody's trying to boot from GHC 4's .hc sources here.
(My efforts are towards directly skipping to modern versions via MicroHs.)

One problem with the idea of building ancient GHC versions is that Nixpkgs prefers not to maintain equally old compatible compilers and libraries, so it may be a struggle to get it to work with the GCC versions we have available.

10:28:27
@divyaranjan:matrix.orgDivya
In reply to @toonn:matrix.org
So GHC 9.2 will link to whatever glibc was current back then forever? Or does this rely on grafting?
We do have grafts, yes.
10:34:30
@sternenseemann:systemli.orgsterniThanks!! I'll properly review it soon.11:51:37
@sternenseemann:systemli.orgsterniWith GHC there are probably more pressing issues at the moment, i.e. all the regressions from the Hadrian build system, figuring out how to bootstrap new platforms independently from GHC upstream etc.11:55:41
@sternenseemann:systemli.orgsternibootstrapable GHC is impractical even if feasible because it would currently involve an insanely long bootstrap chain which is not workable with the build time we have available; also it would involve dealing with ancient LLVM versions at the very least for e.g. aarch6411:57:28
@sternenseemann:systemli.orgsterni Divya: what problems are you running into with hadrian? We are basically treating it as a normal haskell tool, building it using the bindist we also use to bootstrap GHC and reusing our normal Haskell package set, this requires occasional fiddling with version constraints, but Hadrian is not too picky about dependency versions. 11:59:30
@sternenseemann:systemli.orgsterniso basically we completely ignore the bootstrap plan thing upstream provides11:59:46
@sternenseemann:systemli.orgsterniyou may be interested in https://github.com/stable-haskell/ghc/pull/3 for a future improvement; even some GHC devs are not happy with hadrian12:00:44

Show newer messages


Back to Room ListRoom Version: 6