serokell / serokell-stackage

Stackage for your Nix
2 stars 0 forks source link

Error building lens #2

Open purefn opened 5 years ago

purefn commented 5 years ago

I'm trying to use this overlay but am running into a problem building some packages, like lens.

Here's the default.nix I'm using

let
  snapshot = "lts-13.5";                                                                                                                                       

  stackage = import (fetchTarball {                                                                                                                            
    url = "https://stackage.serokell.io/zb36jsy3r5h4ydz0pnp00g9vk94dvv03-stackage/default.nix.tar.gz";                                                         
    sha256 = "0h6f80gds0ds77y51hhiadh2h2k8njqq8n0gayp729ana9m9agma";                                                                                           
  });                                                                                                                                                          

  # use nixpkgs with ghc 8.6.3                                                                                                                                                             
  pkgs = import (builtins.fetchTarball {                                                                                                                       
    url = "https://github.com/NixOS/nixpkgs/archive/68be6bbc31351a4cf5b6431d746dc390ed29c16c.tar.gz";                                                          
    sha256 = "15akv6zw42pysgk9wab1mhav02c52sxnbl5q7aicn782gbj8hpkx";                                                                                           
  }) {                                                                                                                                                         
    inherit config;                                                                                                                                            

    overlays = [ stackage."${snapshot}" ];                                                                                                                     
  };                                                                                                                                                           

in                                                                                                                                                             
  pkgs.haskell.packages."${snapshot}"      

When I run nix-build -A lens it fails with the error

*** abort because of serious configure-time warning from Cabal

Scrolling up a bit I see this warning

Warning:
    This package indirectly depends on multiple versions of the same package. This is very likely to cause a compile failure.
      package lens (lens-4.17) requires mtl-2.2.2
      package lens (lens-4.17) requires mtl-2.2.2
      package lens (lens-4.17) requires mtl-2.2.2
      package regex-base (regex-base-0.93.2-7K3rQffvl60EST34q3IzxH) requires mtl-2.2.2-7J4QNYUKWXDzSb7V8lZ2y
      package kan-extensions (kan-extensions-5.2-4KPJUtPb5n5H2mtaEMaRQZ) requires mtl-2.2.2-7J4QNYUKWXDzSb7V8lZ2y
      package free (free-5.1-CG33yzvtj4CyvSkiJTtkb) requires mtl-2.2.2-7J4QNYUKWXDzSb7V8lZ2y
      package exceptions (exceptions-0.10.0-FzKvxOF1UGl82HXDdkjpUK) requires mtl-2.2.2-7J4QNYUKWXDzSb7V8lZ2y
      package adjunctions (adjunctions-4.4-9XENQnbOI3NFZIRKJ5MinM) requires mtl-2.2.2-7J4QNYUKWXDzSb7V8lZ2y
      package lens (lens-4.17) requires text-1.2.3.1
      package lens (lens-4.17) requires text-1.2.3.1
      package xml (xml-1.3.14-34dwGowmM0N60nH7igTYJW) requires text-1.2.3.1-DIzgkGQqVn4KlOiIkWSf5j
      package hashable (hashable-1.2.7.0-UfPxlTLcpWHXRtkaERNjE) requires text-1.2.3.1-DIzgkGQqVn4KlOiIkWSf5j

Any thoughts?

purefn commented 5 years ago

I was able to work around the issue by overriding mtl and text with null.

  pkgs.haskell.packages."${snapshot}".override {                                                                                                               
    overrides = self: super: {                                                                                                                                 
      mtl = null;                                                                                                                                              
      text = null;                                                                                                                                             
    };                                                                                                                                                         
  }             
kirelagin commented 5 years ago

This seems to be caused by the same problem as https://github.com/serokell/nixage/issues/10, i.e. that boot libraries (which are precisely mtl and text in your case) are treated wildly in nixpkgs.

We are currently considering switching this project to the alternative Haskell infrastructure provided by IOHK – hopefully, this will help.