Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
Working on dependent projects with ocamlbuild
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Nicolas Pouillard <nicolas.pouillard@g...>
Subject: Re: [Caml-list] Working on dependent projects with ocamlbuild
Excerpts from Daniel Bünzli's message of Wed Oct 24 13:07:27 +0200 2007:
> Hello,

> Somewhat related to the discussion we had about the (bad) idea of  
> embedding dependencies into projects. I'd like to share the following  
> setup with ocamlbuild that allows me to work simultaneously on a  
> 'base' project and two independent projects 'p1' and 'p2' that use  
> 'base'. Basically my sources are distributed as follows :
> base/src
> p1/src
> p2/src
> What I used to do is to build a .cma out of the sources in base/src  
> and point the others to that .cma. When I did a change in base, I had  
> to build that .cma again, sometimes forgetting and seeking for bugs  
> in code while it was just a .cma freshness issue.
> What I do now is that I completly forget about .cma's. I just create  
> the following links in p1 and p2
> ln -s ../base/src p1/base
> ln -s ../base/src p2/base
> And add the following to their _tags file :
> echo "<base>: include" >> p1/_tags
> echo "<base>: include" >> p2/_tags
> The rest is simply sorted out by ocamlbuild. Whenever I do a change  
> in base/src I don't need to recompile anything there, if I rework in  
> p1 or p2 things are automatically updated, I always use the latest  
> version of base's code. Of course this means longer build time when  
> you ocamlbuild -clean in p1 and p2 since they each build their own  
> version of base. But on the scale at which I work it is currently not  
> an issue.
> The only caveat (that may disappear in the future) is that base/src  
> should be able to build without a plugin. Otherwise you will
> have to integrate base's instructions into p1 and  
> p2's (btw. couldn't we find a less egoistic name for  
> that file). But if you are only working with _tagged caml sources it  
> should works perfectly, put your tags for base in base/src/_tags.

Right. Multiple plugins should be the next new big feature of ocamlbuild.

The is egoistic, but is there to insist on the fact that your
are  customizing  the  tool and not giving him full instructions/recipes. What

However  this  setup definitely needs to go on the wiki.

Would you mind adding it?

Nicolas Pouillard aka Ertai