!RbXGJhHMsnQcNIDFWN:nixos.org

Haskell in Nixpkgs/NixOS

724 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.org145 Servers

Load older messages


SenderMessageTime
22 Feb 2025
@alex:tunstall.xyzAlex
In reply to @janus.troelsen:matrix.org
is nixpkgs focused on bootstrapping as far back as possible? I thought I saw a discussion talking about how something about 8.10 had bit rotted ?
AFAIK nobody here wants to maintain ancient GHC builds.
04:58:32
@janus.troelsen:matrix.orgJanus Right. and the bootstrapping Community have their own approach with a scheme interpreter , a C subset, TCC , old gcc versions and all that 04:59:27
@janus.troelsen:matrix.orgJanusiirc they patch these old gcc versions to keep them compatible with their c compiler...05:01:36
@janus.troelsen:matrix.orgJanus what I am trying to get at is ... if nixpkgs is not optimized for bootstrapping, it might not be the best place to bootstrap 05:02:20
@janus.troelsen:matrix.orgJanusthat said, in theory there is no reason why it couldn't work05:02:36
@janus.troelsen:matrix.orgJanus
In reply to @janus.troelsen:matrix.org
it's likely that old GHC runtime systems have similar issues . even though Linux promises 100% backwards compat, they did Change the syscall Interface
another example is Linux 6.1 breaking MAP_32BIT mmap. GHC needed a workaround to avoid this bug in the data structure Linux started using for paging . it was broken in like a dozen 6.1 releases
05:06:51
@emilazy:matrix.orgemilywe do have minimal bootstrap packaged05:07:03
@emilazy:matrix.orgemilyit is not yet wired up05:07:07
@emilazy:matrix.orgemilythere is certainly interest in it for the bootstrap binaries05:07:21
@emilazy:matrix.orgemily(for stdenv)05:07:26
@emilazy:matrix.orgemilyanyway I thought the issue was simply that bootstrapping GHC from modern bindista was weird or something.05:07:53
@janus.troelsen:matrix.orgJanus seems like there are still issues with musl and such... I am just following from the sidelines , don't really know. I have an excessively retro approach to this compared to everyone else , it seems 05:10:32
@janus.troelsen:matrix.orgJanus Joachim breitner also attempted something at munihac, where he wanted to concatenate all GHC modules into a giant file to avoid worrying about recursive module dependencies 05:11:20
@janus.troelsen:matrix.orgJanus not sure if microhs supports recursive modules yet. I don't think it has Interface files, but otoh it seems like you don't have a traditional linking step either 05:13:05
@janus.troelsen:matrix.orgJanus
In reply to @emilazy:matrix.org
we do have minimal bootstrap packaged
how far back does it go?
05:32:52
@alex:tunstall.xyzAlex
In reply to @janus.troelsen:matrix.org
not sure if microhs supports recursive modules yet. I don't think it has Interface files, but otoh it seems like you don't have a traditional linking step either
I saw a hs-boot file while patching the base library so maybe? I'll need to check.
05:52:29
@janus.troelsen:matrix.orgJanus
In reply to @emilazy:matrix.org
anyway I thought the issue was simply that bootstrapping GHC from modern bindista was weird or something.
as far as I understand, going from GHC to GHC is considered easy? if the minimal bootstrap you refer to is microhs, surely the biggest issue is doing the jump from microhs to GHC , and specifically choosing a suitable version of GHC.
05:59:03
@janus.troelsen:matrix.orgJanus
In reply to @alex:tunstall.xyz
I saw a hs-boot file while patching the base library so maybe? I'll need to check.
i do think I saw something about this recently in the microhs release logs . so yeah, it's probably supported now , which is great
06:00:37
@janus.troelsen:matrix.orgJanusreadme says "Mutually recursive modules are allowed the same way as with GHC, using .hs-boot files."06:03:44
@alex:tunstall.xyzAlex
In reply to @janus.troelsen:matrix.org
as far as I understand, going from GHC to GHC is considered easy? if the minimal bootstrap you refer to is microhs, surely the biggest issue is doing the jump from microhs to GHC , and specifically choosing a suitable version of GHC.

Yes, that's what I foresee being the most difficult.

Planned approaches, from most desirable to least:

  1. Use mhs directly as a boot compiler with the GHC build system. Unlikely to work because it would require being able to build Hadrian and probably explicit support from GHC. If the GHC maintainers are keen on it, maybe one day it'll be possible.
  2. Use mhs to build ghc-bin, then boot GHC with it.
  3. Use mhs to boot an old GHC version, then build a long chain of versions to get to the modern ones.
06:23:37
@emilazy:matrix.orgemily
In reply to @janus.troelsen:matrix.org
as far as I understand, going from GHC to GHC is considered easy? if the minimal bootstrap you refer to is microhs, surely the biggest issue is doing the jump from microhs to GHC , and specifically choosing a suitable version of GHC.
the minimal bootstrap is the elaborate C/Mes/etc. stuff, I wasn't talking about Haskell
14:39:17
@emilazy:matrix.orgemilyI was just saying there has been work on that for Nixpkgs14:39:27
@emilazy:matrix.orgemilyanyway, it was something about Hadrian issues with new GHCs making us use an old GHC for bootstrap, but I wasn't clear on the details14:40:07
@emilazy:matrix.orgemily
In reply to @emilazy:matrix.org
the minimal bootstrap is the elaborate C/Mes/etc. stuff, I wasn't talking about Haskell
(the "256 bytes + Linux kernel + build orchestrator" thing a la Guix)
14:41:20
@alexfmpe:matrix.orgalexfmpeThanks, worked like a charm18:52:11
@alexfmpe:matrix.orgalexfmpeI was handed a list of dozens of packages that don't need dontCheck anymore18:52:37
@alexfmpe:matrix.orgalexfmpeI don't see how to use the same approach for doJailbreak though Turns out this works for doCheck because that's a property of stdenv.mkDerivation however doJailbreak triggers splicing in postPatch so it's not directly inspectable from the outside18:55:51
@alexfmpe:matrix.orgalexfmpealso much less likely to vary between ghc versions than test suite failures18:58:04
@alexfmpe:matrix.orgalexfmpe* also much more likely to vary between ghc versions than test suite failures18:58:10
@alex:tunstall.xyzAlex

Here's an idea: override Haskell's mkDerivation to add all of the function arguments to passthru. Since it's passthru, it shouldn't invalidate caching.

Otherwise, there's also this ugly hack.

nix-repl> (haskell.lib.doJailbreak haskellPackages.lens).postPatch
"echo \"Run jailbreak-cabal to lift version restrictions on build inputs.\"\n/nix/store/7q7kmsirmz061126189935lwjw5yhdlv-jailbreak-cabal-1.4/bin/jailbreak-cabal lens.cabal\n"

nix-repl> (haskell.lib.dontJailbreak haskellPackages.lens).postPatch 
""
20:10:47

Show newer messages


Back to Room ListRoom Version: 6