Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Dario Teixeira <darioteixeira@yahoo.com>
To: OCaml mailing-list <caml-list@inria.fr>
Subject: [Caml-list] OASIS and -no-alias-deps: the non-evil approach
Date: Tue, 13 Jan 2015 14:38:50 +0000 (UTC)	[thread overview]
Message-ID: <1237960507.262399.1421159930645.JavaMail.yahoo@jws100108.mail.ne1.yahoo.com> (raw)

Hi,

I still haven't given up on using -no-alias-deps with a OASIS/OCamlbuild build
system, despite a critical component -- OCamldep -- seemingly not supporting
-no-alias-deps in 4.02 [1].  I've made a small experiment which suggests it
should be possible anyway, but I'll need a bit of help from someone who's
more familiar with OASIS and OCamlbuild.

I'm using the same dummy library I've described before [2].  Basically, I 
have three actual code files (foo_a.ml, foo_b.ml, foo_c.ml), plus a foo.ml
which only declares module aliases.  Due to ocamldep's obliviousness to
-no-alias-deps, it infers that foo.ml depends on the 3 other modules, 
whereas each in turn also depends on foo.ml, resulting in a circular build.

The small experiment I made was to rename ocamldep and to replace it with
a small frontend that detects whether it's being called on foo.ml, in which
case it declares no dependencies.  Something like this:

let () = match Sys.argv with
  | [| "ocamldep.opt";  "-modules";  "src/foo.ml" |] ->
    print_endline "src/foo.ml:"
  | x ->
    Unix.execv "/home/dario/.opam/4.02.1/bin/ocamldep.opt.orig" x


Pure evil, but it works.  Now, my question is: would it be possible to achieve
the same result in plain OASIS/OCamlbuild, ie, without the evil?  I reckon
one would need to tag a certain file in such a way that any invocation of
ocamldep for that file should be replaced with a string.  Your thoughts?

Thanks in advance for your time + best regards,
Dario Teixeira

[1] https://sympa.inria.fr/sympa/arc/caml-list/2014-09/msg00078.html
[2] https://sympa.inria.fr/sympa/arc/caml-list/2014-12/msg00097.html

                 reply	other threads:[~2015-01-13 14:39 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1237960507.262399.1421159930645.JavaMail.yahoo@jws100108.mail.ne1.yahoo.com \
    --to=darioteixeira@yahoo.com \
    --cc=caml-list@inria.fr \
    /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