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 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id 03AE3BC6B for ; Fri, 2 Nov 2007 16:33:12 +0100 (CET) X-IronPort-AV: E=Sophos;i="4.21,363,1188770400"; d="scan'208";a="18866302" Received: from peray.inria.fr (HELO ausone.inria.fr) ([128.93.8.98]) by mail4-relais-sop.national.inria.fr with SMTP; 02 Nov 2007 16:33:11 +0100 Received: by ausone.inria.fr (sSMTP sendmail emulation); Fri, _d Nov 2007 16:32:33 +0100 From: "Nicolas Pouillard" Cc: caml-list Subject: Re: [Caml-list] Working on dependent projects with ocamlbuild To: Daniel Bünzli References: <7BE597C9-3EF8-4DF4-946F-826FF312A256@erratique.ch> <12B29D95-87FB-43F1-A26F-6128EB41FDF5@erratique.ch> In-Reply-To: <12B29D95-87FB-43F1-A26F-6128EB41FDF5@erratique.ch> Date: Fri, 02 Nov 2007 16:32:33 +0100 Message-Id: <1194016932-sup-3939@ausone.local> User-Agent: Sup/0.2 Content-Type: text/plain; charset=UTF-8 X-Spam: no; 0.00; cmi:01 cmi:01 abstraction:01 fine-grained:01 pathname:01 pathname:01 compilers:01 caml-list:01 precisely:01 cma:01 define:02 define:02 modules:02 mentionned:03 dispatch:03 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