Building with some dependencies pre-installed in a sandbox

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!

It sounds like you’re looking for `cabal sandbox add-source`:
https://www.haskell.org/cabal/users-guide/installing-packages.html#developin...
--
Miëtek
On 2015-02-08, at 02:33, Jakub Arnold
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@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

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"
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@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
participants (3)
-
Elliot Cameron
-
Jakub Arnold
-
Miëtek Bak