[Haskell-cafe] Maintaining test-suite dependencies with cabal

Omari Norman omari at smileystation.com
Fri Aug 22 17:22:43 UTC 2014


On Fri, Aug 22, 2014 at 12:49 PM, Bram Neijt <bneijt at gmail.com> wrote:

>
> Can I easily depend on the dependencies of another package or should I
> create a library  and depend on that in my test and executable?
>
>
There's no way to do what you're trying to do without putting your
functionality into a library.  Cabal then has a feature that allows you to
depend on the library in your executables and test suites.  Then you don't
repeat your library dependencies in your executables and test suites.

This feature has, however, some unresolved bugs:

https://github.com/haskell/cabal/issues/1919

so I wouldn't recommend its use unless you are willing to deal with some
bugs.  I would just gulp and deal with the duplication in your Cabal file
(and the longer compile times) or, alternatively, adopt a tool to deal
directly with the problem of duplication, such as:

https://hackage.haskell.org/package/cartel

But a tool like Cartel does nothing about compile times.  If compile times
are really a concern, I would just put the library in a completely separate
package and package the executables and tests separately.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20140822/b934f79d/attachment.html>


More information about the Haskell-Cafe mailing list