dan
dan

Reputation: 45592

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

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?

Upvotes: 8

Views: 121

Answers (1)

Kostia R
Kostia R

Reputation: 2565

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

Upvotes: 3

Related Questions