Stack: how can I use the dependency of several packages in `Setup.hs`?

I have a project with several stack packages, where "multi-package" is zip-conduit-0.2.2.2 (I needed to configure some versions of the dependencies in order to compile it with nightly-2015-10-12 ).

I use zip-conduit in the main package, and also want in Setup.hs to be able to unpack zip files.

I have build-type: Custom in my cache file, and stack build trying to build Setup.hs . The problem is that building Setup.hs cannot find the zip-conduit-0.2.2.2 .

Is it possible to use the dependency of several packages in Setup.hs ? If so, how? and if not, what is my alternative?

Note. I saw this link https://github.com/commercialhaskell/stack/pull/899 , but I do not understand it.

+5
source share
2 answers

It looks like you need to set the explicit-setup-deps parameter to true for this package. It is regrettable that Stack cannot handle this situation automatically, but without dependency information in the .cabal files, there seems to be no alternative.

See related issues from the documentation if you are interested in a story here.

+5
source

I don’t think you can declare package dependencies for Setup.hs itself.

Some ideas:

  • Require dependent packages to already be installed.

  • Highlight Setup.hs external command to perform zipping and simply Setup.hs external command to exist.

  • Make the installer an additional exe target program in the cabal file. Before building the library, Setup.hs can build the target installer program, then build the library, and then use the built-in exe installer to install the library.

0
source

Source: https://habr.com/ru/post/1234033/


All Articles