From: Alain Frisch <alain.frisch@lexifi.com>
To: Nick Chapman <nchapman@janestreet.com>
Cc: OCaml Mailing List <caml-list@inria.fr>
Subject: Re: [Caml-list] ocamldep, transitive dependencies, build systems, flambda
Date: Mon, 18 Jul 2016 16:47:49 +0200 [thread overview]
Message-ID: <a0fd6322-cb22-c226-ffdf-e4869a60be27@lexifi.com> (raw)
In-Reply-To: <CANViCaQozEoDvXf4NcOt-xr3dgjWZfujBWX6zZXh5H3ExejWtg@mail.gmail.com>
Thanks to everyone who commented on my message!
On 05/07/2016 11:17, Nick Chapman wrote:
> There was a further issue we needed to solve to get our scheme working.
> Suppose library A lists library B as a dependency and allows this
> dependence to be exposed in its interface. Clients of library A will
> require access to the .cmi's of library B to be compiled but it seems
> unreasonable to require them to explicitly list library B as a
> dependency. We solve this by automatically running ocamlinfo on the
> public .cmi's of a library to discover additional library deps required
> by clients of the library.
I think this is another instance of the same problem, namely that there
as "implicit" dependencies that cannot be seen by ocamldep. It's just
reduced a bit thanks to the less fine-grained dependency analysis across
libraries (which we try to avoid in our case).
If we wanted to use the same trick on a per file-basis, one would need
to inject dynamic dependencies (obtained after compilation), but I don't
see how to do that with our omake-based build system.
Have you had to change some build rules to account for flambda (I guess
you must now look for implementation deps in .cmx in addition to
interface deps in .cmi)?
Here is the solution we you have adopted for now for our experiments
with flambda. We apply the same "dependency restriction" for .cmx files
as we do for .cmi files, namely: whenever the compiler tries to open
A.cmx when compiling B.ml, it does as if A had been compiled with
-opaque unless A is an explicit dependency of B.ml (i.e. ocamldep would
see "A" when analyzing "B.ml"). In effect, this will prevent some
cross-module optimizations, but we don't see how to do better without
significantly changing our build strategy. This solution is similar to
Hongbo's comment about cross-module inlining in Bucklescript.
Alain
next prev parent reply other threads:[~2016-07-18 14:47 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-04 16:49 Alain Frisch
2016-07-05 9:17 ` Nick Chapman
2016-07-18 14:47 ` Alain Frisch [this message]
2016-07-19 9:20 ` Goswin von Brederlow
2016-07-19 9:46 ` Daniel Bünzli
2016-07-05 12:00 ` François Bobot
2016-07-05 13:53 ` Gerd Stolpmann
2016-07-05 13:06 Hongbo Zhang (BLOOMBERG/ 731 LEX)
2016-07-05 13:17 ` 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=a0fd6322-cb22-c226-ffdf-e4869a60be27@lexifi.com \
--to=alain.frisch@lexifi.com \
--cc=caml-list@inria.fr \
--cc=nchapman@janestreet.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