<div dir="ltr">Mikhail, the use case not addressed here is people who are used to v1-style and want to keep using it — and possibly aren't in a great position to rewire their setup to fit how v2 thinks. Personally, I have situations where I use v2 and others where v1 works better.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Apr 15, 2019 at 6:43 PM Mikhail Glushenkov <<a href="mailto:mikhail.glushenkov@gmail.com">mikhail.glushenkov@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hello Simon,<br>
<br>
On Mon, 15 Apr 2019 at 23:14, Simon Peyton Jones via ghc-devs<br>
<<a href="mailto:ghc-devs@haskell.org" target="_blank">ghc-devs@haskell.org</a>> wrote:<br>
><br>
> It is terribly mysterious that “cabal install hspec” doesn’t, well, install hspec.<br>
<br>
In the cabal v2-* model [1] installing libraries globally is no longer<br>
the recommended mode of operation, which is why you now need to pass<br>
--lib to 'install' to do that.<br>
<br>
There are now better alternatives for most use cases of 'install --lib':<br>
<br>
* For just trying out some set of libraries in REPL, you can use<br>
`cabal new-repl --build-depends=foo,bar,baz` outside of a project<br>
instead of ghci. [2] If you have .ghc.environment file generation<br>
turned on, you can also use plain ghci inside your project, and it<br>
will pick up the project context. [3]<br>
* For running Haskell scripts that expect extra libraries in the<br>
global package DB you can use `#! cabal` instead of `#! runghc`. [4]<br>
<br>
> It must surely be a bug that “cabal install –lib hspec” simply crashes.<br>
<br>
This is a bug that we haven't fixed yet [5]. Should've just worked.<br>
<br>
<br>
[1] <a href="https://cabal.readthedocs.io/en/latest/nix-local-build-overview.html" rel="noreferrer" target="_blank">https://cabal.readthedocs.io/en/latest/nix-local-build-overview.html</a><br>
[2] <a href="https://cabal.readthedocs.io/en/latest/nix-local-build.html#cabal-v2-repl" rel="noreferrer" target="_blank">https://cabal.readthedocs.io/en/latest/nix-local-build.html#cabal-v2-repl</a><br>
[3] <a href="https://cabal.readthedocs.io/en/latest/nix-local-build.html#cfg-field-write-ghc-environment-files" rel="noreferrer" target="_blank">https://cabal.readthedocs.io/en/latest/nix-local-build.html#cfg-field-write-ghc-environment-files</a><br>
[4] <a href="https://cabal.readthedocs.io/en/latest/nix-local-build.html#cabal-v2-run" rel="noreferrer" target="_blank">https://cabal.readthedocs.io/en/latest/nix-local-build.html#cabal-v2-run</a><br>
[5] <a href="https://github.com/haskell/cabal/issues/5990" rel="noreferrer" target="_blank">https://github.com/haskell/cabal/issues/5990</a><br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>brandon s allbery kf8nh</div><div><a href="mailto:allbery.b@gmail.com" target="_blank">allbery.b@gmail.com</a></div></div></div></div></div>