I got closer, then was stymied by infinite recursion encountered
in the end:
$ nix-build nixpkgs/b.nix
error: infinite recursion encountered, at /home/cody/hci/nixpkgs/b.nix:11:13
(use '--show-trace' to show detailed location information)
using:
let
mypkgs = import (fetchTarball "https://github.com/NixOS/nixpkgs-channels/archive/c71518e75bf067fb639d44264fdd8cf80f53d75a.tar.gz") { overlays = [overlay]; };
overlay = self: super: {
haskellPackages =
super.haskell.packages.ghc883.override (old: {
overrides = self.lib.composeExtensions (old.overrides or (_: _: {}))
(hself: hsuper: {
ghcWithPackages = hself.ghc.withPackages;
diagrams-postscript = self.haskell.lib.doJailbreak (hself.callHackageDirect
{ pkg = "diagrams-postscript";
ver = "1.4.1";
sha256 = "0174y4s6rx6cckkbhph22ybl96h00wjqqkzkrcni7ylxcvgf37bd";
} {});
diagrams-builder = self.haskell.lib.doJailbreak (hsuper.diagrams-builder);
});
}
);
};
# This is building now, so progress
# in mypkgs.haskellPackages.diagrams-builder
# The following gives:
# error: infinite recursion encountered, at /home/cody/hci/nixpkgs/b.nix:11:13
# (use '--show-trace' to show detailed location information)
in mypkgs.diagrams-builder
What helped me was working by default from within the nix repl from the lowest level dependency I had an issue with:
[cody@nixos:~/hci/nixpkgs]$ nix repl
Welcome to Nix version 2.3.6. Type :? for help.
nix-repl> pkgs = import (fetchTarball "https://github.com/NixOS/nixpkgs-channels/archive/c71518e75bf067fb639d44264fdd8cf80f53d75a.tar.gz") {}
nix-repl> :b pkgs.haskellPackages.diagrams-builder builder for '/nix/store/abggggz6k0wwalyc6p22czp6swdh4k81-diagrams-builder-0.8.0.5.drv' failed with exit code 1; last 10 log lines:
configureFinalizedPackage, called at libraries/Cabal/Cabal/Distribution/Simple/Configure.hs:475:12 in Cabal-3.0.1.0:Distribution.Simple.Configure
configure, called at libraries/Cabal/Cabal/Distribution/Simple.hs:625:20 in Cabal-3.0.1.0:Distribution.Simple
confHook, called at libraries/Cabal/Cabal/Distribution/Simple/UserHooks.hs:65:5 in Cabal-3.0.1.0:Distribution.Simple.UserHooks
configureAction, called at libraries/Cabal/Cabal/Distribution/Simple.hs:180:19 in Cabal-3.0.1.0:Distribution.Simple
defaultMainHelper, called at libraries/Cabal/Cabal/Distribution/Simple.hs:116:27 in Cabal-3.0.1.0:Distribution.Simple
defaultMain, called at Setup.hs:2:8 in main:Main
Setup: Encountered missing or private dependencies:
haskell-src-exts >=1.18 && <1.23,
haskell-src-exts-simple >=1.18 && <1.23
[0 built (1 failed)]
error: build of '/nix/store/abggggz6k0wwalyc6p22czp6swdh4k81-diagrams-builder-0.8.0.5.drv' failed
nix-repl> :b pkgs.haskell.lib.doJailbreak pkgs.haskellPackages.diagrams-builder
builder for '/nix/store/h7c2zgrjrrcc2w6qalk52y8c0sbc8m4l-diagrams-builder-0.8.0.5.drv' failed with exit code 1; last 10 log lines:
die', called at libraries/Cabal/Cabal/Distribution/Simple/Configure.hs:1022:20 in Cabal-3.0.1.0:Distribution.Simple.Configure
configureFinalizedPackage, called at libraries/Cabal/Cabal/Distribution/Simple/Configure.hs:475:12 in Cabal-3.0.1.0:Distribution.Simple.Configure
configure, called at libraries/Cabal/Cabal/Distribution/Simple.hs:625:20 in Cabal-3.0.1.0:Distribution.Simple
confHook, called at libraries/Cabal/Cabal/Distribution/Simple/UserHooks.hs:65:5 in Cabal-3.0.1.0:Distribution.Simple.UserHooks
configureAction, called at libraries/Cabal/Cabal/Distribution/Simple.hs:180:19 in Cabal-3.0.1.0:Distribution.Simple
defaultMainHelper, called at libraries/Cabal/Cabal/Distribution/Simple.hs:116:27 in Cabal-3.0.1.0:Distribution.Simple
defaultMain, called at Setup.hs:2:8 in main:Main
Setup: Encountered missing or private dependencies:
diagrams-postscript ==1.4.*
[0 built (1 failed)]
error: build of '/nix/store/h7c2zgrjrrcc2w6qalk52y8c0sbc8m4l-diagrams-builder-0.8.0.5.drv' failed
nix-repl>
Then I added the overlay into my file, but pasted the multiple line overlay directly into the repl to test things work there.
This super incremental workflow helped, whereas yesterday all the moving pieces made things very confusing.
Edit: I’ll also note that I hit a lot of recursion errors because of things like mixing up self/super such as diagrams-builder = self.haskell.lib.doJailbreak (hself.diagrams-builder)
. I thought that hself was correct here because it would be the end result but before things were tied together. Since I’m using hsuper here actually, it means that none of the overlays in the block will take affect on the diagrams-builder dependency right?
Maybe that’s part of my problem?