NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.07k stars 14.05k forks source link

Can't build haddock-library with ghc863 #54456

Closed lippirk closed 5 years ago

lippirk commented 5 years ago

Issue description

I have just started using nixos, and am struggling to build my haskell project's dependencies inside a nix-shell with ghc863 (it works with ghc844!). It seems to be because of haddock-library.

I have found the following does not work either, and seems to give the same/similar error message:

[ben@tigger:~]$ nix-shell -p haskell.packages.ghc863.haddock-library
these derivations will be built:
  /nix/store/kl0qfbqh20lcgzmqs80khh8migjdr419-haddock-library-1.5.0.1.drv
building '/nix/store/kl0qfbqh20lcgzmqs80khh8migjdr419-haddock-library-1.5.0.1.drv'...
setupCompilerEnvironmentPhase
Build with /nix/store/l4aakav5y7mg1gwn9gjriqccrjrb3x10-ghc-8.6.3.
unpacking sources
unpacking source archive /nix/store/m19zmc1vfgvj1wdb8sacgkanpd7j73gn-haddock-library-1.5.0.1.tar.gz
source root is haddock-library-1.5.0.1
setting SOURCE_DATE_EPOCH to timestamp 1520502800 of file haddock-library-1.5.0.1/vendor/attoparsec-0.13.1.0/LICENSE
patching sources
Run jailbreak-cabal to lift version restrictions on build inputs.
compileBuildDriverPhase
setupCompileFlags: -package-db=/build/setup-package.conf.d -j1 -threaded
[1 of 1] Compiling Main             ( Setup.hs, /build/Main.o )
Linking Setup ...
configuring
configureFlags: --verbose --prefix=/nix/store/gi9agzh9grvxc1q20aahasakjxxhrxc4-haddock-library-1.5.0.1 --libdir=$prefix/lib/$compiler --libsubdir=$abi/$libname --with-gcc=gcc --package-db=/build/package.conf.d --ghc-option=-j1 --disable-split-objs --enable-library-profiling --profiling-detail=exported-functions --disable-profiling --enable-shared --disable-coverage --enable-static --disable-executable-dynamic --disable-tests --enable-library-vanilla --enable-library-for-ghci --ghc-option=-split-sections --extra-lib-dirs=/nix/store/2lbhgxlrhgnij2c3bm719xidymmhp0m0-ncurses-6.1-20181027/lib --extra-lib-dirs=/nix/store/077sn4sz2mxzjm5zqlxxag2170jkkc5n-gmp-6.1.2/lib
Using Parsec parser
Configuring haddock-library-1.5.0.1...
CallStack (from HasCallStack):
  die', called at libraries/Cabal/Cabal/Distribution/Simple/Configure.hs:950:20 in Cabal-2.4.0.1:Distribution.Simple.Configure
  configureFinalizedPackage, called at libraries/Cabal/Cabal/Distribution/Simple/Configure.hs:460:12 in Cabal-2.4.0.1:Distribution.Simple.Configure
  configure, called at libraries/Cabal/Cabal/Distribution/Simple.hs:596:20 in Cabal-2.4.0.1:Distribution.Simple
  confHook, called at libraries/Cabal/Cabal/Distribution/Simple/UserHooks.hs:67:5 in Cabal-2.4.0.1:Distribution.Simple.UserHooks
  configureAction, called at libraries/Cabal/Cabal/Distribution/Simple.hs:178:19 in Cabal-2.4.0.1:Distribution.Simple
  defaultMainHelper, called at libraries/Cabal/Cabal/Distribution/Simple.hs:115:27 in Cabal-2.4.0.1:Distribution.Simple
  defaultMain, called at Setup.hs:2:8 in main:Main
Setup: Encountered missing dependencies:
base >=4.5 && <4.12

builder for '/nix/store/kl0qfbqh20lcgzmqs80khh8migjdr419-haddock-library-1.5.0.1.drv' failed with exit code 1
error: build of '/nix/store/kl0qfbqh20lcgzmqs80khh8migjdr419-haddock-library-1.5.0.1.drv' failed

Steps to reproduce

Technical details

I also tried to jailbreak haddock-library with an overlay:

self: super: 
let 
  doJailbreak = super.haskell.lib.doJailbreak;
in 
{
  haskell = super.haskell // {
    packages = super.haskell.packages // {
      ghc863 = super.haskell.packages.ghc863.override {
        overrides = newSelf: newSuper: {
          haddock-library = builtins.trace "*****JAILBREAKING HADDOCK-LIBRARY*****" (doJailbreak newSuper.haddock-library);
        };
      };
    };
  };
}

Whilst I could see my overridden version was called, I still got the same error. (AFAIK jailbreaking remove constraints on a package, so my thought process was 'I should jailbreak to remove that pesky constraint base >= 4.5 && <4.12'. I suppose this is wrong.)

I apologies if this is trivial - I've only ever used stack before so I'm not used to these kinds of errors.

System details:

[ben@tigger:~]$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 4.14.92, NixOS, 18.09.1898.001b34abcb4 (Jellyfish)`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.1.3`
 - channels(ben): `""`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`
lippirk commented 5 years ago

Okay, so nix-shell -p haskell.packages.ghc863.cabal-install doesn't work either. The error is the same: Encountered missing dependencies: base >=4.5 && <4.12. I realised that this certainly makes sense ghc863 comes with base-4.12.0.0.

Overriding cabal-install, cryptohash-sha256 and resolv with doJailbreak in turn leads me to different error messages, but it doesn't seem to be going anywhere (I have finally reached a compilation error). This cannot possibly be what I'm supposed to be doing.

What am I doing wrong? I feel nix-shell -p haskell.packages.ghc863.cabal-install should 'just work' but it doesn't (for me)

matthewbauer commented 5 years ago

ghc 863 came out after 18.09 branched off. I wonder if it has not gotten the updates since then?

You are probably going to be better off using haskell.packages.ghc844 (haskellPackages) for now. You can also try ghc 863 from unstable.

lippirk commented 5 years ago

Thanks for your response. That would make sense. I will stick to 844 for now and try 863 in a little while