hspec / hspec-hedgehog

A library to integrate hedgehog tests into your hspec test suite.
https://hackage.haskell.org/package/hspec-hedgehog
Other
28 stars 6 forks source link

Fails to build with Nix #5

Closed jezen closed 4 years ago

jezen commented 4 years ago

I'm trying to build hspec-hedgehog-0.0.1.1 with Nix, but it fails with a compilation error.

Here is the command I am using to generate the Nix expression for this package (since the only version on the pinned version of nixpkgs I am using is 0.0.0.1, which is marked as broken):

cabal2nix cabal://hspec-hedgehog-0.0.1.1

…Which generates the following expression:

{ mkDerivation, base, hedgehog, hspec, hspec-core, HUnit
, QuickCheck, splitmix, stdenv
}:
mkDerivation {
  pname = "hspec-hedgehog";
  version = "0.0.1.1";
  sha256 = "7217212eb0af1972d0ca59e138b6d81c186dfa52fcbdbcf299c7b03ba9a6c1f4";
  libraryHaskellDepends = [
    base hedgehog hspec hspec-core HUnit QuickCheck splitmix
  ];
  testHaskellDepends = [ base hedgehog hspec ];
  homepage = "https://github.com/parsonsmatt/hspec-hedgehog#readme";
  description = "Integrate Hedgehog and Hspec!";
  license = stdenv.lib.licenses.bsd3;
}

…which produces the following compilation error

building
Preprocessing library for hspec-hedgehog-0.0.1.1..
Building library for hspec-hedgehog-0.0.1.1..
[1 of 1] Compiling Test.Hspec.Hedgehog ( src/Test/Hspec/Hedgehog.hs, dist/build/Test/Hspec/Hedgehog.o )

src/Test/Hspec/Hedgehog.hs:102:46: error:
    Module
    ‘Hedgehog.Internal.Property’
    does not export
    ‘TerminationCriteria(..)’
    |
102 |                                              TerminationCriteria (..),
    |                                              ^^^^^^^^^^^^^^^^^^^^^^^^

builder for '/nix/store/pxbviqcsk3cafq3661ahcinp7wdl0yx7-hspec-hedgehog-0.0.1.1.drv' failed with exit code 1
cannot build derivation '/nix/store/yq3m761lzawj3rd5c1h49ddf7aramca0-ghc-8.6.5-with-packages.drv': 1 dependencies couldn't be built
error: build of '/nix/store/yq3m761lzawj3rd5c1h49ddf7aramca0-ghc-8.6.5-with-packages.drv' failed
jezen commented 4 years ago

Digging into this some more, it appears the problem is that the hspec-hedgehog.cabal file specifies a hedgehog dependency version range between >= 1.0.0 && < 2, whereas the TerminationCriteria type is not exported from Hedgehog.Internal.Property until version 1.0.2.

kozross commented 4 years ago

Stack cannot currently see the newest version of this (with this fix), which meant I encountered this exact same build issue.

parsonsmatt commented 4 years ago

You'll need to specify the newer version of hspec-hedgehog-0.0.1.2 in extra-deps or upgrade to the latest nightly resolver.