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=0.0 required=5.0 tests=none autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id 2DD85BC69 for ; Wed, 24 Oct 2007 13:07:12 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAAPzDHkfDuhNCnmdsb2JhbACOWQEBAQEHAggRGIEn X-IronPort-AV: E=Sophos;i="4.21,323,1188770400"; d="scan'208";a="5045915" Received: from mail22.bluewin.ch ([195.186.19.66]) by mail3-smtp-sop.national.inria.fr with ESMTP; 24 Oct 2007 13:07:11 +0200 Received: from [192.168.1.58] (85.2.50.217) by mail22.bluewin.ch (Bluewin 7.3.121) id 471B461B000C10F0 for caml-list@yquem.inria.fr; Wed, 24 Oct 2007 11:07:11 +0000 Mime-Version: 1.0 (Apple Message framework v752.2) Content-Transfer-Encoding: 7bit Message-Id: <7BE597C9-3EF8-4DF4-946F-826FF312A256@erratique.ch> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed To: caml-list caml-list From: =?ISO-8859-1?Q?Daniel_B=FCnzli?= Subject: Working on dependent projects with ocamlbuild Date: Wed, 24 Oct 2007 13:07:27 +0200 X-Mailer: Apple Mail (2.752.2) X-Spam: no; 0.00; bunzli:01 buenzli:01 dependencies:01 recompile:01 rework:01 cma:01 cma:01 caml:02 tagged:02 btw:03 bugs:03 embedding:03 dependent:04 daniel:04 daniel:04 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. Best, Daniel