[Haskell-cafe] Building with some dependencies pre-installed in a sandbox

Elliot Cameron elliot.cameron at covenanteyes.com
Mon Feb 9 14:12:10 UTC 2015


Jakub, 


It's certainly a hack, but one thing you can do is the following: 


In your main package (the one which depends on your customization), simply set up a sandbox like this: 


$ cd /home/me/my-package 
$ cabal sandbox init 


Then, in your custom mysql package, tell it to *share* a sandbox with "my-package" and then install it, like this: 


$ cd /home/me/mysql-custom 
$ cabal sandbox init --sandbox /home/me/my-package/.cabal-sandbox 
$ cabal install 


Now, back in "my-package", "cabal install --dependencies-only" will not re-download mysql. Make sure that your cabal config depends on the same package name and version that you have customized. 


Hope this helps: 


Elliot 


----- Original Message -----

From: "Miëtek Bak" <mietek at bak.io> 
To: "Jakub Arnold" <darthdeus at gmail.com> 
Cc: haskell-cafe at haskell.org 
Sent: Saturday, February 7, 2015 9:50:08 PM 
Subject: Re: [Haskell-cafe] Building with some dependencies pre-installed in a sandbox 

It sounds like you’re looking for `cabal sandbox add-source`: 
https://www.haskell.org/cabal/users-guide/installing-packages.html#developing-with-sandboxes 


-- 
Miëtek 




On 2015-02-08, at 02:33, Jakub Arnold <darthdeus at gmail.com> wrote: 

> Hey guys, sorry for re-posting, but I feel that my original question is largely different from this one. 
> 
> I've managed to get my broken dependency to build (the mysql package), but unfortunately I had to manually change its source code to make this happen, (original post https://www.haskell.org/pipermail/haskell-cafe/2015-February/118064.html), but I do have the package installed locally (or in the sandbox of my app). 
> 
> The problem is that when I try to `cabal install` the whole application, it will re-download the `mysql` package from Hackage and try to build it again, instead of using the version I custom built and installed myself. Is it normal that cabal won't re-use the already existing packages, or did I somehow change it so that it won't recognize it? 
> 
> Also, is it possible to explicitly say where should cabal resolve some of its dependencies? Such as this case when one package is in a local path, and other should be built from hackage. I'm not really sure what the best approach is here. 
> 
> again sorry for posting twice in a row, but I just can't seem to find this information anywhere in the docs 
> 
> Thanks! 
> _______________________________________________ 
> Haskell-Cafe mailing list 
> Haskell-Cafe at haskell.org 
> http://www.haskell.org/mailman/listinfo/haskell-cafe 


_______________________________________________ 
Haskell-Cafe mailing list 
Haskell-Cafe at haskell.org 
http://www.haskell.org/mailman/listinfo/haskell-cafe 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20150209/00b882b9/attachment.html>


More information about the Haskell-Cafe mailing list