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

Kosyrev Serge _deepfire at feelingofgreen.ru
Sun Feb 21 13:44:14 CET 2016


Good day folks!

I'm facing a problem of a .drv generation gone wrong -- it's missing an
input reference.  What I would like is some pointers to how go about
debugging it.

First an overview:

What I have is a Nix expression which:

  - depends on a set of haskell packages A, which in turn
    - pull in among others a package B (actually, doctest)
      - which I have to override (it's broken in GHC8).

But when I perform the override, another package C
(comonad, which depends on doctest) breaks, due to a missing input --
which shouldn't be missing, at least according to its expression.

Now, the details:

I accomplish this deep override with the following incantation in default.nix:

,----
| let
|   pkgs     = (import <nixpkgs> {}).pkgs;
|   haskell  = pkgs.haskell;
|   ghcOrig  = haskell.packages.ghc801;
|   ghc      = ghcOrig.override {
|     overrides = with haskell.lib; new: old: {
|       doctest = dontCheck (haskell.lib.overrideCabal old.doctest (oldAttrs: {
|         src = pkgs.fetchgit {
|                 url    = https://github.com/sol/doctest;
|                 rev    = "d042176d41e8466de664198ef473bc2ae280e3e4";
|                 sha256 = "15ffykfw4jmxqiziiz31yfcm8v4iq3iz9x882xvlvzi5b7b408yk";
|         };
|         };
|       }));
|     };
|   };
| in
|  ghc.callPackage
|  ({ mkDerivation, base, base-unicode-symbols, containers,           linear, netwire, pkgconfig, reflection, stdenv, vector }:
| mkDerivation {
|   ...      
| }) {}
`----

What happens when I call nix-build on this expression, is that suddenly
a third, unrelated package starts missing a dependency:

,----
| Configuring comonad-4.2.7.2...
| Setup: Encountered missing dependencies:
| transformers >=0.2 && <0.5
`----

..whereas:
  - its definition in hackage-packages does indeed list "transformers"
  - the .drv of "comonad" being build is indeed missing a reference to
    "transformers"

So, obviously, the .drv evaluation has gone wrong.

The question is -- how would one go about debugging it?

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


More information about the nix-dev mailing list