From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id 097EFBC37 for ; Sun, 25 Oct 2009 14:09:19 +0100 (CET) X-IronPort-AV: E=Sophos;i="4.44,620,1249250400"; d="scan'208";a="38920780" Received: from peray.inria.fr (HELO localhost) ([128.93.8.98]) by mail1-relais-roc.national.inria.fr with ESMTP; 25 Oct 2009 14:09:18 +0100 Content-Type: text/plain; charset=UTF-8 Cc: caml-list Subject: Re: [Caml-list] Ocamlbuild directory inclusion problem From: Nicolas Pouillard To: Dario Teixeira In-reply-to: <332954.66598.qm@web111506.mail.gq1.yahoo.com> References: <332954.66598.qm@web111506.mail.gq1.yahoo.com> Date: Sun, 25 Oct 2009 14:09:18 +0100 Message-Id: <1256475959-sup-4643@peray> User-Agent: Sup/git Content-Transfer-Encoding: 8bit X-Spam: no; 0.00; bug:01 lib:01 foo:01 foo:01 lib:01 ocamlc:01 -pack:01 cmo:01 cmo:01 mli:01 sig:01 val:01 exited:01 invocation:01 ocamlc:01 Excerpts from Dario Teixeira's message of Sat Oct 24 18:11:26 +0200 2009: > Hi, > > I've come across another issue with Ocamlbuild, and I'm not sure if this one > is a bug or a feature. Consider the project tree below; note that everything > under lib/ is supposed to produce a foo.cma library, while cmd/ is a command > line application that uses foo.cma (and which can be safely ignored for now). > > |-- _tags > |-- lib/ > | |-- _tags > | |-- foo.mllib > | |-- foo_core.mlpack > | |-- foo_core/ > | | |-- (...) > | | > | |-- foo_ext.mlpack > | |-- foo_ext/ > | |-- (...) > | > |-- cmd/ > |-- (...) > > The file lib/_tags just contains " or : include". If I issue > "ocamlbuild foo.cma" inside the lib/ directory, then foo.cma gets built as expected. > However, if I move to the parent directory and issue "ocamlbuild lib/foo.cma", > I get an error: > > ocamlc -pack lib/foo_ext/beta.cmo lib/foo_ext/alpha.cmo -o lib/foo_ext.cmo > File "_none_", line 1, characters 0-1: > Error: The implementation (obtained by packing) > does not match the interface lib/foo_ext.mli: > Modules do not match: > sig val num : int end > is not included in > Foo_core.Zero.S > Unbound module type Foo_core.Zero.S > Command exited with code 2. > > > The problem is of course that "-I lib" should be added to the invocation of ocamlc. > For this purpose I've created a myocamlbuild.ml in the root directory, with the > following contents: What about adding «"lib": tnclude» into the main _tags file? BTW « or : include» could be written «"foo_core" or "foo_ext": include» Best regards, -- Nicolas Pouillard http://nicolaspouillard.fr