当我只请求 `haskellPackages` 的 `library` 时,为什么 `nix-shell` 会因缺少 `test-suite` 依赖项而失败?

Why does `nix-shell` fail with missing `test-suite` dependencies when I only ask for a `library` of `haskellPackages`?

有没有人知道为什么

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

失败

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

?

(为分隔和强调而添加的空行)

我在问,因为据我所知,我没有要求 nixcompose-ltr 的 build/run 单元测试,所以为什么它关心 [=15] =] 和 hspec?

是的,提到了 QuickCheck 和 hspec in the .cabal file, but only for test-suite spec and not library


此外,我可以通过

解决这个问题吗
  1. 在我的 nix-shell 命令中进一步指定内容,
  2. 更改 compose-ltr.cabal 文件中的某些内容,或
  3. .nix 文件添加到 compose-ltr?

我不会说我对 nix 有很多经验,所以欢迎详细回复。

替换

p.compose-ltr

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

禁用此包的测试。总的来说,这应该包含在 https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/haskell-modules/configuration-common.nix 中(我认为 GitHub 上的 PR 将受到欢迎)