From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: * X-Spam-Status: No, score=1.1 required=5.0 tests=AWL,SPF_NEUTRAL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id DD2DABC69 for ; Wed, 24 Oct 2007 15:09:39 +0200 (CEST) X-IronPort-AV: E=Sophos;i="4.21,324,1188770400"; d="scan'208";a="3553879" Received: from peray.inria.fr (HELO ausone.inria.fr) ([128.93.8.98]) by mail2-relais-roc.national.inria.fr with SMTP; 24 Oct 2007 15:09:39 +0200 Received: by ausone.inria.fr (sSMTP sendmail emulation); Wed, _d Oct 2007 15:09:01 +0200 From: "Nicolas Pouillard" Cc: caml-list Subject: Re: [Caml-list] Working on dependent projects with ocamlbuild To: Daniel Bünzli References: <7BE597C9-3EF8-4DF4-946F-826FF312A256@erratique.ch> In-Reply-To: <7BE597C9-3EF8-4DF4-946F-826FF312A256@erratique.ch> Date: Wed, 24 Oct 2007 15:09:01 +0200 Message-Id: <1193230994-sup-2584@port-ext2.ensta.fr> User-Agent: Sup/0.1 Content-Type: text/plain; charset=UTF-8 X-Spam: no; 0.00; dependencies:01 recompile:01 rework:01 wiki:01 cheers:01 caml-list:01 cma:01 cma:01 caml:02 tagged:02 btw:03 bugs:03 embedding:03 dependent:04 daniel:04 Excerpts from Daniel Bünzli's message of Wed Oct 24 13:07:27 +0200 2007: > Hello, 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 ": include" >> p1/_tags > echo ": 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 myocamlbuild.ml instructions into p1 and > p2's myocamlbuild.ml (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 myocamlbuild.ml is egoistic, but is there to insist on the fact that your are customizing the tool and not giving him full instructions/recipes. What about ocamlbuildrc.ml? However this setup definitely needs to go on the wiki. Would you mind adding it? Cheers, -- Nicolas Pouillard aka Ertai