Cabal woes

Mikhail Glushenkov mikhail.glushenkov at
Mon Apr 15 22:43:00 UTC 2019

Hello Simon,

On Mon, 15 Apr 2019 at 23:14, Simon Peyton Jones via ghc-devs
<ghc-devs at> wrote:
> It is terribly mysterious that “cabal install hspec” doesn’t, well, install hspec.

In the cabal v2-* model [1] installing libraries globally is no longer
the recommended mode of operation, which is why you now need to pass
--lib to 'install' to do that.

There are now better alternatives for most use cases of 'install --lib':

* For just trying out some set of libraries in REPL, you can use
`cabal new-repl --build-depends=foo,bar,baz` outside of a project
instead of ghci. [2] If you have .ghc.environment file generation
turned on, you can also use plain ghci inside your project, and it
will pick up the project context. [3]
* For running Haskell scripts that expect extra libraries in the
global package DB you can use `#! cabal` instead of `#! runghc`. [4]

> It must surely be a bug that “cabal install –lib hspec” simply crashes.

This is a bug that we haven't fixed yet [5]. Should've just worked.


More information about the ghc-devs mailing list