caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Gabriel Scherer <gabriel.scherer@gmail.com>
To: Dario Teixeira <dario.teixeira@nleyten.com>
Cc: caml users <caml-list@inria.fr>
Subject: Re: [Caml-list] Forcing OCamlbuild to compile a file before another
Date: Tue, 3 Feb 2015 22:13:50 +0100	[thread overview]
Message-ID: <CAPFanBEMeXE3Qem3cLCa1HtaR+j4FBEvgWZsV944hhp-_nRGMA@mail.gmail.com> (raw)
In-Reply-To: <5c76729753733a2ccbf1cad96879c312@nleyten.com>

I haven't given much thought to it yet, but here would a sketchy idea
of how to better support -no-alias-deps in OCamlbuild:

ocamldep) extend ocamldep with a new -paths (as an extension over
-modules) that returns not just the modules M appearing at the
beginning of paths in source files, but the full module-longident (eg.
M.Foo.Bar if you access the value M.Foo.Bar.baz or constructor
M.Foo.Bar.Foobar)

ocamlbuild) use ocamldep -modules (this happens in
ocaml_utils.ml:read_path_dependencies), and for a non-singleton path
of the form Foo.Bar, first type-check the compilation unit Foo, then
inspect the .cmi to know whether Bar is defined as a module alias of
Foo, and in that case depend on the aliased compilation unit

(This should be done as a modification to the tool itself rather than
a plugin, I think.)

On Mon, Jan 26, 2015 at 1:30 PM, Dario Teixeira
<dario.teixeira@nleyten.com> wrote:
> Hi again,
>
>> Yeap, I understand.  The good news is that it should be possible to use
>> module-aliases/no-aliases-deps/pseudo-circular-recursion within the
>> current
>> OASIS+OCamlbuild framework with only minimal extra burden on the user,
>> and zero modifications to OASIS or OCamlbuild.
>>
>> I had to bump my forehead against the wall a few times, but in the end
>> I've
>> managed to get the full combination working on a toy example, and I'm
>> confident
>> I can also get it to work on the much larger Lambdoc code base.  I'll keep
>> you posted...
>
>
> (replying to myself here)
>
> I may have spoken too soon on the ease of tweaking a build system based on
> OASIS + OCamlbuild to work with module aliases and -no-alias-deps: the toy
> example does compile from scratch, but the build system gets confused by
> subsequent modifications to source files.
>
> I have created a branch in the Lambdoc repo for experimenting with this
> process [1].  If you try to compile it, it almost works, but you do get
> lots of nasty warnings and a generally confused build system.
>
> Kind regards,
> Dario Teixeira
>
> [1] https://github.com/darioteixeira/lambdoc/tree/oasification
>
>
>
> --
> 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

  reply	other threads:[~2015-02-03 21:14 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-23 15:08 Dario Teixeira
2015-01-23 16:41 ` Francois Pottier
2015-01-23 19:09   ` Dario Teixeira
2015-01-24 12:56     ` Gabriel Scherer
2015-01-25 18:16       ` Dario Teixeira
2015-01-26 12:30         ` Dario Teixeira
2015-02-03 21:13           ` Gabriel Scherer [this message]
2015-02-04 13:18             ` Dario Teixeira
2015-02-04 14:52               ` Gabriel Scherer
2015-02-04 16:15                 ` Dario Teixeira
2015-02-04 16:44                   ` Gabriel Scherer
2015-02-06 17:01                     ` Dario Teixeira
2015-02-06 17:05                       ` Gabriel Scherer
2015-02-06 18:58                         ` Dario Teixeira
2015-02-15 10:41                           ` Gabriel Scherer
2015-02-15 13:55                             ` Dario Teixeira
2015-02-15 14:42                               ` Gabriel Scherer

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=CAPFanBEMeXE3Qem3cLCa1HtaR+j4FBEvgWZsV944hhp-_nRGMA@mail.gmail.com \
    --to=gabriel.scherer@gmail.com \
    --cc=caml-list@inria.fr \
    --cc=dario.teixeira@nleyten.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).