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 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 BCAD7BC69 for ; Wed, 21 Nov 2007 12:20:32 +0100 (CET) X-IronPort-AV: E=Sophos;i="4.21,446,1188770400"; d="scan'208";a="6035292" Received: from peray.inria.fr (HELO ausone.inria.fr) ([128.93.8.98]) by mail3-relais-sop.national.inria.fr with SMTP; 21 Nov 2007 12:20:32 +0100 Received: by ausone.inria.fr (sSMTP sendmail emulation); Wed, _d Nov 2007 12:19:44 +0100 From: "Nicolas Pouillard" Cc: caml-list Subject: Re: [Caml-list] ocamlbuild missing links: using a bash script To: hmf References: <47440DEA.9060104@inescporto.pt> In-Reply-To: <47440DEA.9060104@inescporto.pt> Date: Wed, 21 Nov 2007 12:19:44 +0100 Message-Id: <1195643622-sup-4152@port-ext2.ensta.fr> User-Agent: Sup/0.2 Content-Type: text/plain; charset=UTF-8 X-Spam: no; 0.00; compilation:01 byte:01 byte:01 binaries:01 unix:01 unix:01 symbolic:01 caml-list:01 bin:01 behaviour:01 modules:02 modules:02 exit:04 compiled:04 compiled:04 Excerpts from hmf's message of Wed Nov 21 11:52:26 +0100 2007: > Hello, > > I have a very simple bash script that I use to > build my project using ocamlbuild. The idea is > to build modules successively and execute tests > until compilation fails, a test fails or all > modules are correctly compiled. > > It goes something like this: > ................................................. > #!/bin/bash > > # Exit on error > set -e > > ocamlbuild src/comb/tests_comb.d.byte -- > > ocamlbuild -lib unix src/uf/bench.d.byte -- > ................................................. > > I have noticed however that the build (if > successful) only retains the last symbolic > link to the compiled artefacts. > > My questions are: > > 1. Is the above behaviour intended? Yes, links made by ocamlbuild are made each time. > 2. If so how can I keep all resulting links If you ask for multiple programs you will get multiple links. ocamlbuild -lib unix src/comb/tests_comb.d.byte src/uf/bench.d.byte However it doesn't work in combination with running the given command (using '--'). The second option is to forget about this (mis-)feature of links. And use binaries from the _build dir. -- Nicolas Pouillard aka Ertai