<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE message PUBLIC
  "-//MLarc//DTD MLarc output files//EN"
  "../../mlarc.dtd"[
  <!ATTLIST message
    listname CDATA #REQUIRED
    title CDATA #REQUIRED
  >
]>

  <?xml-stylesheet href="../../mlarc.xsl" type="text/xsl"?>


<message 
  url="2009/10/09f127b71d8981041946b6cf7b63bc0e"
  from="Nicolas Pouillard &lt;nicolas.pouillard@g...&gt;"
  author="Nicolas Pouillard"
  date="2009-10-25T13:09:19"
  subject="Re: [Caml-list] Ocamlbuild directory inclusion problem"
  prev="2009/10/3a7c95e710ce0c2cd377fe1fedaab619"
  next="2009/10/a14d04d2f47f019f098319c34066bb21"
  prev-in-thread="2009/10/3a7c95e710ce0c2cd377fe1fedaab619"
  prev-thread="2009/10/2bea75bf2ab07f700193e014678aa337"
  next-thread="2009/10/a14d04d2f47f019f098319c34066bb21"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="Ocamlbuild directory inclusion problem">
<msg 
  url="2009/10/3a7c95e710ce0c2cd377fe1fedaab619"
  from="Dario Teixeira &lt;darioteixeira@y...&gt;"
  author="Dario Teixeira"
  date="2009-10-24T16:11:28"
  subject="Ocamlbuild directory inclusion problem">
<msg 
  url="2009/10/09f127b71d8981041946b6cf7b63bc0e"
  from="Nicolas Pouillard &lt;nicolas.pouillard@g...&gt;"
  author="Nicolas Pouillard"
  date="2009-10-25T13:09:19"
  subject="Re: [Caml-list] Ocamlbuild directory inclusion problem">
</msg>
</msg>
</thread>

<contents>
Excerpts from Dario Teixeira's message of Sat Oct 24 18:11:26 +0200 2009:
&gt; Hi,
&gt; 
&gt; I've come across another issue with Ocamlbuild, and I'm not sure if this one
&gt; is a bug or a feature.  Consider the project tree below; note that everything
&gt; under lib/ is supposed to produce a foo.cma library, while cmd/ is a command
&gt; line application that uses foo.cma (and which can be safely ignored for now).
&gt; 
&gt; |-- _tags
&gt; |-- lib/
&gt; |   |-- _tags
&gt; |   |-- foo.mllib
&gt; |   |-- foo_core.mlpack
&gt; |   |-- foo_core/
&gt; |   |   |-- (...)
&gt; |   |
&gt; |   |-- foo_ext.mlpack
&gt; |   |-- foo_ext/
&gt; |       |-- (...)
&gt; |
&gt; |-- cmd/
&gt;     |-- (...)
&gt; 
&gt; The file lib/_tags just contains "&lt;foo_core&gt; or &lt;foo_ext&gt;: include".  If I issue
&gt; "ocamlbuild foo.cma" inside the lib/ directory, then foo.cma gets built as expected.
&gt; However, if I move to the parent directory and issue "ocamlbuild lib/foo.cma",
&gt; I get an error:
&gt; 
&gt; ocamlc -pack lib/foo_ext/beta.cmo lib/foo_ext/alpha.cmo -o lib/foo_ext.cmo
&gt; File "_none_", line 1, characters 0-1:
&gt; Error: The implementation (obtained by packing)
&gt;        does not match the interface lib/foo_ext.mli:
&gt;        Modules do not match:
&gt;          sig val num : int end
&gt;        is not included in
&gt;          Foo_core.Zero.S
&gt;        Unbound module type Foo_core.Zero.S
&gt; Command exited with code 2.
&gt; 
&gt; 
&gt; The problem is of course that "-I lib" should be added to the invocation of ocamlc.
&gt; For this purpose I've created a myocamlbuild.ml in the root directory, with the
&gt; following contents:

What about adding «"lib": tnclude» into the main _tags file?

BTW «&lt;foo_core&gt; or &lt;foo_ext&gt;: include» could be written
  «"foo_core" or "foo_ext": include»

Best regards,

-- 
Nicolas Pouillard
http://nicolaspouillard.fr

</contents>

</message>

