haskellcabalhunit

Dependency issues running "cabal test" for Haskell


I'm running my first "cabal test" for Haskell, but I get the error:

Package has never been configured. Configuring with default flags. If this
fails, please run configure manually.
Resolving dependencies...
Configuring sample-0.1.0.0...
cabal: At least the following dependencies are missing:
base ==4.7.*

sampel.cabal:

-- Initial sample.cabal generated by cabal init.  For further 
-- documentation, see http://haskell.org/cabal/users-guide/

name:                sample
version:             0.1.0.0
build-type:          Simple
cabal-version:       >=1.10

executable SampleTest
  main-is:             SampleTest.hs
  build-depends:       base >= 4.7 && <4.8, HUnit >=1.2 && <1.3
  hs-source-dirs:      test, src
  default-language:    Haskell2010

Any help appreciated.


Solution

  • Versions of GHC come bundled with versions of base. GHC 7.10.2 uses base 4.8.1.0.

    Your cabal must be using a slightly out of date template....

    You should either change the range of acceptable base version (as you did in your comment above), or use a different version of GHC.