| 5 Apr 2025 |
Divya | * emily: Why can't GHC be fully bootstrapped from source? We (Guix) bootstrap GHC uptp 9.4 from GHC 4 and it works. | 08:22:32 |
emily | what do you build GHC 4 with? | 08:22:54 |
Divya | * emily: Why can't GHC be fully bootstrapped from source? We (Guix) bootstrap GHC upto 9.4 from GHC 4 and it works. | 08:22:58 |
emily | I know there are various designs on using Hugs to bootstrap or the like, but I didn't think anyone had actually managed to construct a complete chain. there are a lot of issues | 08:23:15 |
Divya | In reply to @emilazy:matrix.org I know there are various designs on using Hugs to bootstrap or the like, but I didn't think anyone had actually managed to construct a complete chain. there are a lot of issues Yeah, I realized. The chain from GHC 4 to GHC 9.2 isn't complete yet. But probably can be done. | 08:32:31 |
emily | that chain isn't really the hard part | 08:32:43 |
emily | it's getting a GHC in the first place | 08:32:46 |
emily | how is GHC 4 built? | 08:32:52 |
Divya | In reply to @emilazy:matrix.org how is GHC 4 built? GHC 4 is bootstrapped from source. | 08:35:01 |
emily | huh. how? Hugs? | 08:42:20 |
terrorjack | from generated .hc sources actually: https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/packages/haskell.scm#n221 | 08:42:30 |
emily | ok. that's not from source :) | 08:42:48 |
emily | but makes sense | 08:42:53 |
Divya | Yeah from HC | 08:43:02 |
emily | that's not source. that's compiler output | 08:43:12 |
Divya | Indeed. 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 |
Divya | Have you guys talked to the GHC folks? | 08:45:05 |
emily | it's not as simple as chaining from Hugs, people have tried but it requires a lot of patching to even start getting anywhere | 08:46:57 |
Divya | 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 |
emily | mostly not, since Nixpkgs has bigger bootstrapping issues :) | 09:15:36 |
emily | (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 |
Divya | 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 |
emily | but when you rebuild core parts of the toolchain, you need to do the bootstrap all over again | 09:20:58 |
linj | 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 | 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 |
emily | let's say you build GHC 4 with Hugs compiled with GCC 14 | 09:27:42 |
hellwolf | * wouldn't you freeze the bootstrapped one to a git commit (of guix pkg? or nixpkgs) and never touch it again? | 09:28:04 |
emily | then when you bump GCC to 15, you need to build GHC 4 with Hugs compiled with GCC 15 | 09:28:08 |
emily | 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 | i see. i can see running old bin in a new container as a workaround | 09:29:19 |