caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Nicolas Pouillard <nicolas.pouillard@gmail.com>
To: Dario Teixeira <darioteixeira@yahoo.com>
Cc: caml-list <caml-list@yquem.inria.fr>
Subject: Re: [Caml-list] Ocamlbuild directory inclusion problem
Date: Sun, 25 Oct 2009 14:09:18 +0100	[thread overview]
Message-ID: <1256475959-sup-4643@peray> (raw)
In-Reply-To: <332954.66598.qm@web111506.mail.gq1.yahoo.com>

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 "<foo_core> or <foo_ext>: 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 «<foo_core> or <foo_ext>: include» could be written
  «"foo_core" or "foo_ext": include»

Best regards,

-- 
Nicolas Pouillard
http://nicolaspouillard.fr


  reply	other threads:[~2009-10-25 13:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-24 16:11 Dario Teixeira
2009-10-25 13:09 ` Nicolas Pouillard [this message]
2009-10-25 13:48 [Caml-list] " Dario Teixeira

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1256475959-sup-4643@peray \
    --to=nicolas.pouillard@gmail.com \
    --cc=caml-list@yquem.inria.fr \
    --cc=darioteixeira@yahoo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).