Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Gabriel Scherer <gabriel.scherer@gmail.com>
To: Dario Teixeira <dario.teixeira@nleyten.com>,
	caml-list <caml-list@inria.fr>
Subject: Re: [Caml-list] Forcing OCamlbuild to compile a file before another
Date: Sat, 24 Jan 2015 13:56:18 +0100	[thread overview]
Message-ID: <CAPFanBEU-ztN1jqamar6wmJ-P0i-nGhpaHsbYLvUjSzNmWFK_g@mail.gmail.com> (raw)
In-Reply-To: <0fd907ee06bedeff816160b9e7b9c027@nleyten.com>

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

Currently there is nothing specific in ocamlbuild to support
-no-alias-deps. What the open(Foo) flag does is to to pass the "-open Foo"
option to ocamldep, which in turns merely adds Foo to the list of
dependencies of the compiled module. My understand of the situation is that
it guarantees that project using "-open ..." in their build system will
build correctly with ocamlbuild, with two limitations:
(1) if you use crazy recursive-but-not-really schemes, you'll get a
circular dependencies error
(2) if Foo is a list of aliases, it will act as a bottleneck in the
dependency graph

Any good proposal to change the statu quo will of course be considered --
but I myself have little time to implement new OCamlbuild features -- and I
will try to be as reactive on possible bugs (eg. #6755) as possible, as the
de-facto maintainer of ocamlbuild.

I am not sure what should be done about (1). The almost-recursive scheme
was adopted by Jane Street for the extremely specific use-case of migrating
an enormous code-base from -pack to -no-alias-deps, but I am not sure it is
reasonable to expect it to work for other users (and I doubt it's wise to
advertise it as such).

In slightly more details: I think the idea of distributing a
short-name-giving lambwiki.ml to your users is a good way to emulate -pack
without the downsides of -pack, but that you could avoid using the short
names in the project itself (that is use Lambda_Parser explicitly rather
than Parser). If you did this, the spurious cyclic dependencies disappaear,
you can simply use ocamlbuild without any dependency hack, and your users
see the short names.

On Fri, Jan 23, 2015 at 8:09 PM, Dario Teixeira <dario.teixeira@nleyten.com>
wrote:

> Hi,
>
>  I am not sure. But: why isn't the dependency explicit in
>> lambwiki_parser.mly? Doesn't it mention the module name
>> "Lambwiki" somewhere? If not, perhaps you could add a
>> fake dependency by declaring "module L = LambWiki" at
>> the top of lambwiki_parser.mly. Would that help?
>>
>
> I'm still poking at it, but it seems there may be a bug in OCamlbuild,
> or at least a difference of opinion. (I am using module aliases and
> -no-alias-deps, and some of these waters are uncharted).
>
> In the tags file, I had declared a tag "open(Lambwiki)" for file
> <lambwiki_parser.mly>.  I assumed this would automatically add a
> dependency on lambwiki.ml for lambwiki_parser.mly.
>
> Now, lambwiki.ml contains only module aliases, for instance:
>
> module Parser = Lambwiki_parser
> module Scanner = Lambwiki_scanner
>
> To avoid a circular dependency, in myocamlbuild I use the non_dependency
> function (part of OCamlbuild's API) to declare that lambwiki.ml does not
> in fact depend on Lambwiki_parser and Lambwiki_scanner.
>
> I wonder if the tooling expects module aliases to produce dependencies
> the other way around, ie, Lambwiki_parser depends on Lambwiki but not
> vice-versa.  This is not clear to me.
>
> Anyway, adding a dummy dependency as you suggested does the trick for
> this particular problem.
>
> Kind regards,
> Dario Teixeira
>
>
>
> --
> 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: 4536 bytes --]

  reply	other threads:[~2015-01-24 12:57 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 [this message]
2015-01-25 18:16       ` Dario Teixeira
2015-01-26 12:30         ` Dario Teixeira
2015-02-03 21:13           ` Gabriel Scherer
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=CAPFanBEU-ztN1jqamar6wmJ-P0i-nGhpaHsbYLvUjSzNmWFK_g@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