Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to compile several Yesod projects quickly?

As far as I know to make new projects yosog and yosog2 I do the following

$ yesod init
$ cd yosog
yosog$ cabal sandbox init
yosog$ cabal install

$ yesod init
$ cd yosog2
yosog2$ cabal sandbox init
yosog2$ cabal install

But each cabal install takes forever. How am I suppose to make a bunch of Yesod projects if each takes forever to compile?

like image 878
user782220 Avatar asked Dec 25 '13 04:12

user782220


2 Answers

It sounds like what you're really trying to do is have multiple separate projects reuse the same cabal sandbox. You can do this by specifying a shared --sandbox option to the cabal sandbox command. Note, however, that by sharing a sandbox, you're giving up on some of the protection that sandboxes are intended to provide.

like image 165
Michael Snoyman Avatar answered Oct 23 '22 18:10

Michael Snoyman


It is kind of unusual to run multiple projects Yesod at the same time. Each would need their own tcp port, and run a completely separate server. Two Yesod projects would usually indicate completely different websites that have nothing to do with each other.

You can put multiple handlers and routes in one single project, so if you have related web pages/APIs you would install them with a single command. If you have pieces that are truly modular and reusable, you could put those handlers in library packages, but the main project will still build and install under a single Yesod program.

like image 40
jamshidh Avatar answered Oct 23 '22 16:10

jamshidh