Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When you depend on a cabal package, it seems to draw in dependencies in all cabal stanzas

Tags:

haskell

cabal

I made my own cabal package (let's call it package-1) with two targets, a library and a executable. The library section has a build-depends list, and the executable has another build-depends list that is much larger.

Now I create package-2, which lists package-1 in its build-depends section. I would like to only bring in the dependencies listed in the library target of package-1. But it seems to bring in all the dependencies listed in all the sections of package-1, including the dependencies for the executable target.

Is there any way to prune the dependency graph to just the library inside package-1, or do I have to resort to breaking out that library target into a separate standalone package?

like image 768
dan Avatar asked Feb 25 '15 15:02

dan


1 Answers

You can put Buildable: False to executable, and then build it explicitly when needed with cabal build Foo, or via flag (cabal configure -fbuild-foo or -fbuild-executables).

Example that might be helpful: Cabal Multiple Executables

like image 94
Konstantine Rybnikov Avatar answered Oct 20 '22 17:10

Konstantine Rybnikov