caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Stephen Magill <stephen.magill@gmail.com>
To: "Daniel Bünzli" <daniel.buenzli@erratique.ch>
Cc: Anthony Tavener <anthony.tavener@gmail.com>,
	Gabriel Scherer <gabriel.scherer@gmail.com>,
	 "caml-list@inria.fr" <caml-list@inria.fr>
Subject: Re: [Caml-list] A way to avoid "WARNING: myocamlbuild.cmi occurs in several directories"?
Date: Thu, 12 Dec 2013 22:34:00 -0500	[thread overview]
Message-ID: <CAL8ktoRo5+GRY5U1+iunJEJNjkp=XNTrrXMBO+j9LZ_w1E-QOQ@mail.gmail.com> (raw)
In-Reply-To: <3029652948434D5A8C48531553154776@erratique.ch>

[-- Attachment #1: Type: text/plain, Size: 2612 bytes --]

I have a similar development setup and have made effective use of ocp-build
to enable a tight development loop while still supporting opam deployment.
 Suppose you have libraries A and B and a program P that uses these, each
in their own directory (or repository).  You set these up with a
per-project .ocp file that describes the library / program sources and a
per-project Makefile.  For each project X, the Makefile (or OPAM build
rules) executes:
  ocp-build init
  ocp-build configure
  ocp-build X

This configures ocp-build to only search in that directory when doing its
build.  When doing development, you skip the per-project makefiles and
instead arrange things as:
  projects/A
  projects/B
  projects/P

And you execute the "ocp-build init; ocp-build configure" portion in the
*projects* directory.  This sets "projects" as the ocp-build root directory
and causes ocp-build to find all the per-project .ocp files.  The
dependencies between the program and libraries will be properly resolved
and even if you have A or B installed with findlib, the local versions of
the libraries will take precedence when building / linking P.  Just compile
P with "ocp-build P" (executed somewhere in the projects/ directory tree).
 You do have to be careful to ensure that during development you never
accidentally create a "projects/X/_obuild" directory (e.g. you never
accidentally invoke "make" in any of the project directories).  ocp-build
will stop at the first _obuild directory it finds, so having _obuild
directories other than projects/_obuild will prevent the full traversal of
the projects/* subdirectories.

--Stephen


On Thu, Dec 12, 2013 at 7:12 PM, Daniel Bünzli
<daniel.buenzli@erratique.ch>wrote:

>
>
> Le vendredi, 13 décembre 2013 à 00:57, Anthony Tavener a écrit :
>
> > I regularly develop libraries in parallel with application code.
>
> Since you seem to be using ocamlbuild, at a certain point I was using (and
> still use sometimes) a workflow that I described here:
>
>
> http://brion.inria.fr/gallium/index.php/Working_on_dependent_projects_with_ocamlbuild
>
> If you work with version control you could also make local git package for
> the libs. That way you can update your all your libraries after new commits
> with a single `opam update && opam upgrade`.
>
> Best,
>
> Daniel
>
>
>
> --
> Caml-list mailing list.  Subscription management and archives:
> https://sympa.inria.fr/sympa/arc/caml-list
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs

[-- Attachment #2: Type: text/html, Size: 3533 bytes --]

      reply	other threads:[~2013-12-13  3:34 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-12 21:47 Anthony Tavener
2013-12-12 22:33 ` Gabriel Scherer
2013-12-12 23:57   ` Anthony Tavener
2013-12-13  0:12     ` Daniel Bünzli
2013-12-13  3:34       ` Stephen Magill [this message]

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='CAL8ktoRo5+GRY5U1+iunJEJNjkp=XNTrrXMBO+j9LZ_w1E-QOQ@mail.gmail.com' \
    --to=stephen.magill@gmail.com \
    --cc=anthony.tavener@gmail.com \
    --cc=caml-list@inria.fr \
    --cc=daniel.buenzli@erratique.ch \
    --cc=gabriel.scherer@gmail.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).