Might anyone of you know why

$ nix-shell \
  -I nixpkgs=https://github.com/NixOS/nixpkgs-channels/archive/nixos-unstable.tar.gz \
  -p "haskellPackages.ghcWithPackages (p: [p.compose-ltr])" \
  --run ghci

fails with

Configuring compose-ltr-0.2.3...

Setup: Encountered missing dependencies:
QuickCheck ==2.8.1, hspec ==2.2.0

builder for ‘/nix/store/pvmm9qcp9xpj5hw77nbfyfj4wxs49jl8-compose-ltr-0.2.3.drv’ failed with exit code 1
cannot build derivation ‘/nix/store/41znxh9qi408n9j63fqvixrlkaasrgkx-ghc-8.0.1-with-packages.drv’: 1 dependencies couldn't be built

?

(blank lines added for separation and emphasis)

I'm asking since as far as I am aware I'm not asking nix to build/run unit tests of compose-ltr, so why does it care about QuickCheck and hspec?

Yes, QuickCheck and hspec are mentioned in the .cabal file, but only for test-suite spec and not library.


Additionally, can I fix this either by

  1. specifying something further in my nix-shell command,
  2. changing something in the .cabal file of compose-ltr, or
  3. adding a .nix file to compose-ltr?

I wouldn't say I have much experience with nix yet, so a detailed response is welcome.

1

There are 1 best solutions below

0
On BEST ANSWER

Replace

p.compose-ltr

with

(haskell.lib.dontCheck p.compose-ltr)

which disables tests for this package. Overall this should be included into https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/haskell-modules/configuration-common.nix (a PR on GitHub will be welcome, I think)