hvr/head.hackage

Failure with Nixpkgs master

deepfire opened this issue · 4 comments

The aeson from recent Nixpkgs needs contravariant, which breaks generate-nix-overrides.hs:

building '/nix/store/5jjmr9p38205vigbx2p6cdcvljdf0k03-aeson-1.4.2.0.drv'...
setupCompilerEnvironmentPhase
Build with /nix/store/lpwsn2jcn1z2wngx9kljc3ksg4vypl97-ghc-8.2.2.
ignoring (possibly broken) abi-depends field for packages
ignoring (possibly broken) abi-depends field for packages
unpacking sources
unpacking source archive /nix/store/xwi199qhaihiyrbs1yyy63isrzbrk6q6-aeson-1.4.2.0.tar.gz
source root is aeson-1.4.2.0
patching sources
Replace Cabal file with edited version from http://hackage.haskell.org/package/aeson-1.4.2.0/revision/1.cabal.
Run jailbreak-cabal to lift version restrictions on build inputs.
compileBuildDriverPhase
setupCompileFlags: -package-db=/build/setup-package.conf.d -j4 -threaded
[1 of 1] Compiling Main             ( Setup.lhs, /build/Main.o )
Linking Setup ...
configuring
configureFlags: --verbose --prefix=/nix/store/qrykshrr7gh29x5psj2b2y99kjhvj96c-aeson-1.4.2.0 --libdir=$prefix/lib/$compiler --libsubdir=$abi/$libname --docdir=/nix/store/zpr518bp2rc4gvr1d0zfmx6h4ja8vpz3-aeson-1.4.2.0-doc/share/doc/aeson-1.4.2.0 --with-gcc=gcc --package-db=/build/package.conf.d --ghc-option=-j4 --disable-split-objs --enable-library-profiling --profiling-detail=exported-functions --disable-profiling --enable-shared --disable-coverage --disable-executable-dynamic --enable-tests --disable-benchmarks --enable-library-vanilla --enable-library-for-ghci --ghc-option=-split-sections --extra-lib-dirs=/nix/store/mi5krns5p204a3rdn1rj4ajnbqn2809i-ncurses-6.1-20181027/lib --extra-lib-dirs=/nix/store/rd7n0v6mymvyqbw3d307caqc23c8kc71-gmp-6.1.2/lib
Configuring aeson-1.4.2.0...
CallStack (from HasCallStack):
  die', called at libraries/Cabal/Cabal/Distribution/Simple/Configure.hs:948:20 in Cabal-2.0.1.0:Distribution.Simple.Configure
  configureFinalizedPackage, called at libraries/Cabal/Cabal/Distribution/Simple/Configure.hs:470:12 in Cabal-2.0.1.0:Distribution.Simple.Configure
  configure, called at libraries/Cabal/Cabal/Distribution/Simple.hs:570:20 in Cabal-2.0.1.0:Distribution.Simple
  confHook, called at libraries/Cabal/Cabal/Distribution/Simple/UserHooks.hs:67:5 in Cabal-2.0.1.0:Distribution.Simple.UserHooks
  configureAction, called at libraries/Cabal/Cabal/Distribution/Simple.hs:174:19 in Cabal-2.0.1.0:Distribution.Simple
  defaultMainHelper, called at libraries/Cabal/Cabal/Distribution/Simple.hs:119:27 in Cabal-2.0.1.0:Distribution.Simple
  defaultMain, called at Setup.lhs:3:10 in main:Main
Setup: Encountered missing dependencies:
contravariant >=1.4.1 && <1.6
note: keeping build directory '/tmp/nix-build-aeson-1.4.2.0.drv-5'
builder for '/nix/store/5jjmr9p38205vigbx2p6cdcvljdf0k03-aeson-1.4.2.0.drv' failed with exit code 1
cannot build derivation '/nix/store/qxw1i6y68dmdcp5glipn8b00smpmf2n2-ghc-8.2.2-with-packages.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/k3mgf7azlxv0hpxkm20w4jhi1gfqpr61-hs-generate-overrides-0.1.drv': 1 dependencies couldn't be built
error: build of '/nix/store/k3mgf7azlxv0hpxkm20w4jhi1gfqpr61-hs-generate-overrides-0.1.drv' failed
(use '--show-trace' to show detailed location information)
``

aeson has

if !impl(ghc>=8.6)
  contravariant (>=1.4.1 && <1.6)

which GHC do you use?

My understanding is that Nix's support for conditional dependencies in .cabal files is somewhat limited (see NixOS/jailbreak-cabal#7), so one often has to explicitly override things like this. (Someone knowledgeable in Nix correct me if I'm speaking mistruths.)

EDIT: My comments above are not the actual problem. See here for the real explanation.

@RyanGlScott my point is that with GHC-HEAD you shouldn't need contravariant for aeson at all.

I'm confused why GHC-8.2.2 is used here?

The fix was merged: #93