Organizing big repository

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Organizing big repository

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
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: Organizing big repository

Evan Laforge
On Thu, Oct 27, 2011 at 10:02 AM, Konstantin Litvinenko
<[hidden email]> wrote:
> 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).

_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: Organizing big repository

Nathan Howell-2
On Thu, Oct 27, 2011 at 1:00 PM, Evan Laforge <[hidden email]> wrote:
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 :-)
I have a second tool that invokes ghc directly (no cabal required) but it's not quite release ready.

-n

_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: Organizing big repository

Alberto G. Corona
In reply to this post by Konstantin Litvinenko
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 <[hidden email]>
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
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe


_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Fwd: Organizing big repository

Alberto G. Corona

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 <[hidden email]>
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
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe



_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: Organizing big repository

Alexander Bernauer
In reply to this post by Konstantin Litvinenko
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

_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe

signature.asc (205 bytes) Download Attachment