Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Stack: How can I use a multi-package dependency in `Setup.hs`?

I have a stack multi-package project where the "multi-package" is zip-conduit-0.2.2.2 (I needed to tweak some dependency versions to get it to compile with nightly-2015-10-12).

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

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

Can I use a multi-package dependency in Setup.hs? If so how? and if not, what is my alternative?

Note: I have seen this reference https://github.com/commercialhaskell/stack/pull/899, but I don't understand it.

like image 431
helpwithhaskell Avatar asked Oct 19 '15 15:10

helpwithhaskell


1 Answers

It looks like you need to set the explicit-setup-deps setting to true for that package. It's unfortunate that Stack can't handle this situation automatically, but without dependency information in .cabal files, there seems to be no alternative.

See the linked issues from the documentation if you're interested in the history here.

like image 104
Michael Snoyman Avatar answered Sep 23 '22 21:09

Michael Snoyman