caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Nicolas Pouillard" <nicolas.pouillard@gmail.com>
To: Daniel Bünzli <daniel.buenzli@erratique.ch>
Cc: caml-list <caml-list@yquem.inria.fr>
Subject: Re: [Caml-list] Working on dependent projects with ocamlbuild
Date: Fri, 02 Nov 2007 16:32:33 +0100	[thread overview]
Message-ID: <1194016932-sup-3939@ausone.local> (raw)
In-Reply-To: <12B29D95-87FB-43F1-A26F-6128EB41FDF5@erratique.ch>

Excerpts from Daniel Bünzli's message of Thu Nov 01 11:53:44 +0100 2007:
> Hello,
Hello,

[...]

> But if I use the approach mentionned in my initial posting users of  
> base will see the unconstrained a.cmi and b.cmi. Is there a way that  
> allows me to use this approach while maintaining the abstraction I  
> get with cma's ? Even if it means plugins in p1 and p2 ? I have the  
> impression that the response is negative because even if I try to  
> build a .cma with a mllib the build directory with have all .cmi and  
> the compilers will look at them.

There  is  a  solution  to specify directory scoping in a fine-grained manner.
This way you can explain precisely which directory is seen by a directory.

This  is  done  in  a  plugin  using the function Pathname.define_context that
takes  a  directory  (an  implicit  pathname  starting  from  the root of your
project) and a list of directories seen by it.

You  can then setup your sources in order to confine some files in a directory
only seen by the modules that wrap them.

p1/src/implem/a.ml
p1/src/implem/b.ml
p1/src/base.ml
p1/myocamlbuild.ml

in p1/myocamlbuild.ml...
open Ocamlbuild_pack;;
dispatch begin function
| After_rules ->
    Pathname.define_context "src" ["src/implem"]
| _ -> ()
end;;

HTH,
-- 
Nicolas Pouillard aka Ertai


  parent reply	other threads:[~2007-11-02 15:33 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-24 11:07 Daniel Bünzli
2007-10-24 12:10 ` [Caml-list] " Matthieu Dubuget
2007-10-24 13:09 ` Nicolas Pouillard
2007-11-01 10:53 ` Daniel Bünzli
2007-11-01 12:51   ` Daniel Bünzli
2007-11-02 15:32   ` Nicolas Pouillard [this message]
2007-11-04 21:08     ` Daniel Bünzli
2007-11-05 10:02       ` Nicolas Pouillard

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=1194016932-sup-3939@ausone.local \
    --to=nicolas.pouillard@gmail.com \
    --cc=caml-list@yquem.inria.fr \
    --cc=daniel.buenzli@erratique.ch \
    /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).