JP Moresmau | 8 Feb 15:21 2013
Picon

cabal-dev add-source

Hello, I'm trying to understand cabal-dev, and I seem to be missing some basic point, because I can't get dependencies between projects working properly.
I have two projects, let's call them P1 and P2. P2 depends on P1, as indicated by its cabal file build-depends field.
I run cabal-dev add-source ..\P1 inside P2
then cabal-dev install
Everything works fine, and my project compiles, with modules in P2 calling functions from P1.
Then I add a new function if an exposed module of P1. I rerun the cabal-dev add-source and cabal-dev install commands to tell P2 of the change, as per the cabal-dev documentation. I change a file in P2 to use the new function, the compilation fails.
If I check into the cabal-dev folder, I see the .hi file for my changed module has not been updated (old date).
What am I missing?

Thanks

--
JP Moresmau
http://jpmoresmau.blogspot.com/
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Blake Rain | 8 Feb 18:53 2013
Picon

Re: cabal-dev add-source

You need to call cabal-dev add-source on P1 again to copy over the sdist, then do a cabal-dev install.

See notes under "Using a sandbox-local Hackage" on https://github.com/creswick/cabal-dev


On Feb 8, 2013 2:22 PM, "JP Moresmau" <jpmoresmau <at> gmail.com> wrote:
>
> Hello, I'm trying to understand cabal-dev, and I seem to be missing some basic point, because I can't get dependencies between projects working properly.
> I have two projects, let's call them P1 and P2. P2 depends on P1, as indicated by its cabal file build-depends field.
> I run cabal-dev add-source ..\P1 inside P2
> then cabal-dev install
> Everything works fine, and my project compiles, with modules in P2 calling functions from P1.
> Then I add a new function if an exposed module of P1. I rerun the cabal-dev add-source and cabal-dev install commands to tell P2 of the change, as per the cabal-dev documentation. I change a file in P2 to use the new function, the compilation fails.
> If I check into the cabal-dev folder, I see the .hi file for my changed module has not been updated (old date).
> What am I missing?
>
> Thanks
>
> --
> JP Moresmau
> http://jpmoresmau.blogspot.com/
>
> _______________________________________________
> 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
Johan Tibell | 8 Feb 19:02 2013
Picon

Re: cabal-dev add-source

On Fri, Feb 8, 2013 at 9:53 AM, Blake Rain <blake.rain <at> gmail.com> wrote:

You need to call cabal-dev add-source on P1 again to copy over the sdist, then do a cabal-dev install.

See notes under "Using a sandbox-local Hackage" on https://github.com/creswick/cabal-de


With the new cabal sandboxing (due in 1.18) this won't be necessary as we create a link to the repo, instead of installing a copy. We will rebuild the linked repo as needed.

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
JP Moresmau | 8 Feb 19:07 2013
Picon

Re: cabal-dev add-source

Johan, thanks, that brings me to a point that I wanted to raise. I'm playing with cabal-dev because users have asked me to add support for it in EclipseFP (so projects could have their own sandbox and have dependencies between projects without polluting the main package databases). It is worth it, or should I just wait for cabal 1.18 and use the sandboxing facility? Or will the two work similarly enough that supporting both will be easy? Does the sandboxing in cabal means that tools like cabal-dev are going to get deprecated?

Thanks

JP


On Fri, Feb 8, 2013 at 7:02 PM, Johan Tibell <johan.tibell <at> gmail.com> wrote:
On Fri, Feb 8, 2013 at 9:53 AM, Blake Rain <blake.rain <at> gmail.com> wrote:

You need to call cabal-dev add-source on P1 again to copy over the sdist, then do a cabal-dev install.

See notes under "Using a sandbox-local Hackage" on https://github.com/creswick/cabal-de


With the new cabal sandboxing (due in 1.18) this won't be necessary as we create a link to the repo, instead of installing a copy. We will rebuild the linked repo as needed.




--
JP Moresmau
http://jpmoresmau.blogspot.com/
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Johan Tibell | 8 Feb 19:19 2013
Picon

Re: cabal-dev add-source

On Fri, Feb 8, 2013 at 10:07 AM, JP Moresmau <jpmoresmau <at> gmail.com> wrote:

Johan, thanks, that brings me to a point that I wanted to raise. I'm playing with cabal-dev because users have asked me to add support for it in EclipseFP (so projects could have their own sandbox and have dependencies between projects without polluting the main package databases). It is worth it, or should I just wait for cabal 1.18 and use the sandboxing facility? Or will the two work similarly enough that supporting both will be easy? Does the sandboxing in cabal means that tools like cabal-dev are going to get deprecated?

I think they will be similar enough that you could easily port the code. The new cabal sandboxing will work as follows:

cabal sandbox --init
cabal add-source <dir>

and then you use cabal commands like normal (e.g. configure, build, test). No installing necessary.

I cannot speak for the cabal-dev developers. We do intend to support a superset of the cabal-dev functionality eventually. What we're missing now is ghci support.

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Ozgun Ataman | 8 Feb 19:24 2013
Picon

Re: cabal-dev add-source


On Friday, February 8, 2013 at 1:19 PM, Johan Tibell wrote:

On Fri, Feb 8, 2013 at 10:07 AM, JP Moresmau <jpmoresmau <at> gmail.com> wrote:
Johan, thanks, that brings me to a point that I wanted to raise. I'm playing with cabal-dev because users have asked me to add support for it in EclipseFP (so projects could have their own sandbox and have dependencies between projects without polluting the main package databases). It is worth it, or should I just wait for cabal 1.18 and use the sandboxing facility? Or will the two work similarly enough that supporting both will be easy? Does the sandboxing in cabal means that tools like cabal-dev are going to get deprecated?

I think they will be similar enough that you could easily port the code. The new cabal sandboxing will work as follows:

cabal sandbox --init
cabal add-source <dir>

and then you use cabal commands like normal (e.g. configure, build, test). No installing necessary.

I cannot speak for the cabal-dev developers. We do intend to support a superset of the cabal-dev functionality eventually. What we're missing now is ghci support.
Which, thanks to Johan's help yesterday, can still be worked around (for now) by starting ghci with:

ghci -package-conf ./cabal-sandbox/your-package-conf-folder-here/ 

I'm trying to get Emacs haskell-mode and inferior-haskell to play nice with this, but it's not working so far for some reason.

_______________________________________________
Haskell-Cafe mailing list

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
Johan Tibell | 8 Feb 20:18 2013
Picon

Re: cabal-dev add-source

On Fri, Feb 8, 2013 at 10:24 AM, Ozgun Ataman <ozataman <at> gmail.com> wrote:

Which, thanks to Johan's help yesterday, can still be worked around (for now) by starting ghci with:

ghci -package-conf ./cabal-sandbox/your-package-conf-folder-here/ 

You can indeed do this. For real ghci support in cabal we need to also pass -package flags, C libraries, etc to ghci. That's why it's not done yet.

-- Johan
 
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe
JP Moresmau | 8 Feb 19:04 2013
Picon

Re: cabal-dev add-source

That's exactly what I'm doing, and I was exactly following these notes, but it doesn't work. This google+ post and the answers to it (https://plus.google.com/102016502921512042165/posts/TGaENqWfubP) lead me to at least one solution that seems to work: you need to unregister the changed package first.
So 
cabal-dev ghc-pkg unregister --force P1
cabal-dev add-source ../P1
cabal-dev install

Does the trick. There seems to be a way to pass a --reinstall flag to cabal-dev install but I haven't gotten it to work yet.

Thanks

JP


On Fri, Feb 8, 2013 at 6:53 PM, Blake Rain <blake.rain <at> gmail.com> wrote:

You need to call cabal-dev add-source on P1 again to copy over the sdist, then do a cabal-dev install.

See notes under "Using a sandbox-local Hackage" on https://github.com/creswick/cabal-dev


On Feb 8, 2013 2:22 PM, "JP Moresmau" <jpmoresmau <at> gmail.com> wrote:
>
> Hello, I'm trying to understand cabal-dev, and I seem to be missing some basic point, because I can't get dependencies between projects working properly.
> I have two projects, let's call them P1 and P2. P2 depends on P1, as indicated by its cabal file build-depends field.
> I run cabal-dev add-source ..\P1 inside P2
> then cabal-dev install
> Everything works fine, and my project compiles, with modules in P2 calling functions from P1.
> Then I add a new function if an exposed module of P1. I rerun the cabal-dev add-source and cabal-dev install commands to tell P2 of the change, as per the cabal-dev documentation. I change a file in P2 to use the new function, the compilation fails.
> If I check into the cabal-dev folder, I see the .hi file for my changed module has not been updated (old date).
> What am I missing?
>
> Thanks
>
> --
> JP Moresmau
> http://jpmoresmau.blogspot.com/
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe <at> haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>




--
JP Moresmau
http://jpmoresmau.blogspot.com/
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe <at> haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Gmane