!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

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


SenderMessageTime
22 Feb 2025
@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
@alex:tunstall.xyzAlexAh, wait, by "from the outside", you mean not within the Nix interpreter itself? As in, you need a property within the .drv that an external program can read?20:12:41
@alexfmpe:matrix.orgalexfmpe
In reply to @alex:tunstall.xyz
Ah, wait, by "from the outside", you mean not within the Nix interpreter itself? As in, you need a property within the .drv that an external program can read?
Nono I meant "after the fact". Like, when accessing haskellPackages.foo
22:58:08
@alexfmpe:matrix.orgalexfmpe
In reply to @alex:tunstall.xyz

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 
""
Oh, you're saying to disable postPatch all together
22:58:50
@alexfmpe:matrix.orgalexfmpeI guess that's usable22:59:21
@alexfmpe:matrix.orgalexfmpeI did think about shoving 'jailbreak' in passthru, but that only lets me read, not write right?23:00:28
@alexfmpe:matrix.orgalexfmpedoCheck works because the one I can set is the same mkDerivation will read23:00:49
@alexfmpe:matrix.orgalexfmpepassthru just 'mirrors'23:00:59
@alexfmpe:matrix.orgalexfmpeThere's no pass-by-reference23:01:10
@alexfmpe:matrix.orgalexfmpe
In reply to @alexfmpe:matrix.org
I guess that's usable
As in, few false positivirs
23:01:54
@alexfmpe:matrix.orgalexfmpe* As in, few false positives23:02:02
@alex:tunstall.xyzAlex Well you can override mkDerivation to completely ignore doJailbreak too. It's not entirely clear to me what you're trying to do. 23:02:13
@alexfmpe:matrix.orgalexfmpe
In reply to @alexfmpe:matrix.org
As in, few false positives
Vanishingly few if I just sed out the jailbreak-cabal line
23:02:44

Show newer messages


Back to Room ListRoom Version: 6