
I am trying to understand how to organize my code and edit-compile-run cycles. I can't figure out how to setup environment in such why that when I build some program using cabal, cabal will rebuild program dependencies if some was changed. I don't want to configure/build/install manually. Having program 'foo' depends on lib 'bar' I want to edit some files in 'bar' than build 'foo' and get 'bar' rebuilt and 'foo' rebuilt/relink. How can I do this?

On Thu, Oct 27, 2011 at 10:02 AM, Konstantin Litvinenko
I am trying to understand how to organize my code and edit-compile-run cycles. I can't figure out how to setup environment in such why that when I build some program using cabal, cabal will rebuild program dependencies if some was changed. I don't want to configure/build/install manually. Having program 'foo' depends on lib 'bar' I want to edit some files in 'bar' than build 'foo' and get 'bar' rebuilt and 'foo' rebuilt/relink. How can I do this?
I use make. I think cabal may not have any understanding of rebuilding dependencies, it just calls ghc --make, which does dependency resolution on its own, but only for one target. You could just always build all the deps and rely on ghc --make to figure out if any recompilation need be done, but it will get slow as the number of files increases. There's a haskell-using build system called "shake" that shows promising, but the open source version openshake seems to be on hold at the moment. So as far as I know there isn't really a build system for larger or cross language haskell repos beyond make (I've played with waf some, that also might be a possibility).

On Thu, Oct 27, 2011 at 1:00 PM, Evan Laforge
So as far as I know there isn't really a build system for larger or cross language haskell repos beyond make (I've played with waf some, that also might be a possibility).
We use waf to drive cabal. It supports parallel builds at the 'cabal build' level and mixed language projects. I've uploaded the script we're using for our 50 package source tree. It works for us but is by no means complete. If you use it feel free to send pull requests with patches :-) https://github.com/alphaHeavy/cabal-waf I have a second tool that invokes ghc directly (no cabal required) but it's not quite release ready. -n

This is not evident in hte documentation, but Leksah does these things
for you if you add your packages to the workspace list..
It is necessary to use the background compilation option, that is, set by
default.
Alberto
2011/10/27 Konstantin Litvinenko
I am trying to understand how to organize my code and edit-compile-run cycles. I can't figure out how to setup environment in such why that when I build some program using cabal, cabal will rebuild program dependencies if some was changed. I don't want to configure/build/install manually. Having program 'foo' depends on lib 'bar' I want to edit some files in 'bar' than build 'foo' and get 'bar' rebuilt and 'foo' rebuilt/relink. How can I do this?
______________________________**_________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/**mailman/listinfo/haskell-cafehttp://www.haskell.org/mailman/listinfo/haskell-cafe

This is not evident in hte documentation, but Leksah does these things
for you if you add your packages to the workspace list..
It is necessary to use the background compilation option, that is, set by
default.
Alberto
2011/10/27 Konstantin Litvinenko
I am trying to understand how to organize my code and edit-compile-run cycles. I can't figure out how to setup environment in such why that when I build some program using cabal, cabal will rebuild program dependencies if some was changed. I don't want to configure/build/install manually. Having program 'foo' depends on lib 'bar' I want to edit some files in 'bar' than build 'foo' and get 'bar' rebuilt and 'foo' rebuilt/relink. How can I do this?
______________________________**_________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/**mailman/listinfo/haskell-cafehttp://www.haskell.org/mailman/listinfo/haskell-cafe

Hi On Thu, Oct 27, 2011 at 08:02:58PM +0300, Konstantin Litvinenko wrote:
Having program 'foo' depends on lib 'bar' I want to edit some files in 'bar' than build 'foo' and get 'bar' rebuilt and 'foo' rebuilt/relink. How can I do this?
I use cabal-dev [1] along with the react tool [2]. The former does the dependencies-configure-build-install and the latter is a command-line wrapper around inotify. With this combo you can rebuild your project whenever any Haskell source file changes: react -p "*.hs" src/ "cabal-dev install" For my workflow, I have an additional wrapper script for cabal-dev that generates a quickfix file for Vim [3]. Then the workflow goes like: safe file -> wait for build to complete (OSD/libnotify) -> press F5 to jump to the location of the first compiler error or warning. Together with NERDTree [4] this is almost like an IDE ;-) Greetings Alex [1] https://github.com/creswick/cabal-dev [2] https://github.com/copton/react [3] http://vimdoc.sourceforge.net/htmldoc/quickfix.html [4] http://www.vim.org/scripts/script.php?script_id=1658
participants (5)
-
Alberto G. Corona
-
Alexander Bernauer
-
Evan Laforge
-
Konstantin Litvinenko
-
Nathan Howell