In the process of trying to build a Haskell application with Nix I ran into the following situation.
I use amazonka
, which works well with GHC 8.8.4 and 8.10.7. I then tried to use ghc810
in my flake but when things wouldn’t work, I wanted to debug it in a repl. So I did the following in a Nix repl:
:lf .#
pkgs = import inputs.nixpkgs {}
pkgs.lib.getVersion pkgs.haskell.packages.ghc810.modern-uri
"0.3.6.0"
This is surprising since modern-uri
requires base (>=4.15 && <5.0)
but according to wiki.haskell.org GHC 8.10.7 has base
4.14.3.0.
I’m probably not understanding how all of this works but to me it looks like the modern-uri
you get with ghc810
shouldn’t ever compile? I created an example repository that hopefully demonstrates the issue.
$ nix run
error: builder for '/nix/store/bx4r1zbif27w4s12ffcnm4nxyvc9w7ff-modern-uri-0.3.6.0.drv' failed with exit code 1;
last 10 log lines:
> $, called at libraries/Cabal/Cabal/Distribution/Simple/Configure.hs:1024:20 in Cabal-3.2.1.0:Distribution.Simple.Configure
> configureFinalizedPackage, called at libraries/Cabal/Cabal/Distribution/Simple/Configure.hs:477:12 in Cabal-3.2.1.0:Distribution.Simple.Configure
> configure, called at libraries/Cabal/Cabal/Distribution/Simple.hs:625:20 in Cabal-3.2.1.0:Distribution.Simple
> confHook, called at libraries/Cabal/Cabal/Distribution/Simple/UserHooks.hs:65:5 in Cabal-3.2.1.0:Distribution.Simple.UserHooks
> configureAction, called at libraries/Cabal/Cabal/Distribution/Simple.hs:180:19 in Cabal-3.2.1.0:Distribution.Simple
> defaultMainHelper, called at libraries/Cabal/Cabal/Distribution/Simple.hs:116:27 in Cabal-3.2.1.0:Distribution.Simple
> defaultMain, called at Setup.hs:6:8 in main:Main
> Setup: Encountered missing or private dependencies:
> base >=4.15 && <5.0
>
For full logs, run 'nix log /nix/store/bx4r1zbif27w4s12ffcnm4nxyvc9w7ff-modern-uri-0.3.6.0.drv'.
error: 1 dependencies of derivation '/nix/store/dnn4cc3rdmyla3c4nfjki5b7cpg47573-ghc-8.10.7-with-packages.drv' failed to build
error: 1 dependencies of derivation '/nix/store/d7wshyf6xxncmc1bfghlm2q9h8h4ldpa-nix-shell-env.drv' failed to build