[Nix-dev] Debugging a haskellPackages deep override gone wrong

Kosyrev Serge _deepfire at feelingofgreen.ru
Sun Feb 21 22:25:50 CET 2016


Benno, you are a savior once again!

Thank you a lot!

Benno Fünfstück <benno.fuenfstueck at gmail.com> writes:
> Oh, I incorrectly assumed that the failure has anything to do with
> your overriding. But if you do
>
> $ nix-build -E "with (import <nixpkgs> {}); with haskell.lib;
> dontCheck (haskell.packages.ghc801.comonad)"
>
> that does fail in the same way, so in fact the overriding is not
> related at all to the issue your encountering here. 

I see, I should have tried to isolate the failure further..

> Since transformers is a library that is shipped with GHC itself, it's
> ok for it to not be in the dependencies of the comonad derivation.

..this is really confusing, indeed..  not seeing transformers in the
.drv led me to the wrong track.

> What really happens is that cabal's error message is a little bit bad
> in this case: it says that it can't find a package transformers *that
> matches the given version bounds*. There actually *is* a transformers
> package available at the build time of comonad, it's just that GHC 8.0
> ships with `transformers-0.5.*`, which lies outside of the version
> bounds specified in comonad's cabal file. So the issue is not that
> `transformers` is missing, but rather that the ghc-provided version is
> too new for `comonad`.
> You can verify that by dropping into the nix-shell for the `ghc-8.0`
> package (that's how I've found out that transformers is indeed shipped
> with ghc):
>
> $ nix-shell --pure -p haskell.compiler.ghc801 --command "env
> TERM=xterm ghc-pkg list transformers"
> /nix/store/0ymhbixr9hdmr3sls7mn3qc6vb10kb8a-ghc-8.0.0.20160204/lib/ghc-8.0.0.20160204/package.conf.d
> transformers-0.5.1.0
>
> [I hope my analysis is correct this time :D unfortunately, it seems
> that in the version of nixpkgs
> that I am using, I can't even get as far as build comonad: some
> dependencies before that already fail to build for me]

I'm on fairly recent closure-size, and everything seems to build now..

> To fix the issue, you can try overriding the `comonad` package to
> allow newer transformers versions: (no idea if comonad builds/works
> with newer transformers though as-is or if it needs additional patches
> by the maintainers first):
>
> comonad = doJailbreak old.comonad # add this line to your overrides 

It worked like a charm, and the jailbreak thing is a new one for me.

Thank you a lot, again!

-- 
с уважениeм / respectfully,
Косырев Сергей


More information about the nix-dev mailing list