caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Dynlinking plugins defining the same unit name but with different  implementations.
@ 2010-07-01 19:01 Daniel Bünzli
  2010-07-01 19:16 ` Daniel Bünzli
  0 siblings, 1 reply; 11+ messages in thread
From: Daniel Bünzli @ 2010-07-01 19:01 UTC (permalink / raw)
  To: caml-list List

Hello,

On osx 10.6.4 with ocaml 3.12.0+beta1

Suppose I have two following two plugins

a.cmxs, containing a/a.cmx using M.test and a/m.cmx defining M.test
b.cmxs, containing b/b.cmx using M.test and M.test2 and b/m.cmx
defining M.test and M.test2

of course a/m.cmx and b/m.cmx are different implementations except
they define the same interface for M.test

If I Dynlink.loadfile or Dynlink.loadfile_private first a.cmxs and
then b.cmxs there are no errors reported and b uses M.test of a/m.cmx
but M.test2 of b/m.cmx (since the m.cmx in a.cmxs doesn't define it)

Is that expected behaviour ? That looks like dll hell.

Best,

Daniel

P.S. Here's how the plugins are constructed and an invocation of a
test program to give an idea :

> > ocamlbuild a.cmxs b.cmxs test.native
> /usr/local/bin/ocamlopt.opt -shared a/m.cmx a/a.cmx -o a/a.cmxs
> /usr/local/bin/ocamlopt.opt -shared b/m.cmx b/b.cmx -o b/b.cmxs

> > ./test.native
> A using M.test in a/m.ml
> B using M.test in a/m.ml and M.test2 b/m.ml

The last line should be

> B using M.test in b/ml.ml and M.test2 b/m.ml

or some kind of error should be reported.


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2010-07-05 11:41 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-01 19:01 Dynlinking plugins defining the same unit name but with different implementations Daniel Bünzli
2010-07-01 19:16 ` Daniel Bünzli
2010-07-02  8:07   ` [Caml-list] " Alain Frisch
2010-07-02  8:27     ` Daniel Bünzli
2010-07-02  8:40       ` Alain Frisch
2010-07-02  8:47         ` Alain Frisch
2010-07-02  9:19           ` Daniel Bünzli
2010-07-02 17:48             ` Daniel Bünzli
2010-07-05  7:27               ` Alain Frisch
2010-07-05 11:15                 ` Daniel Bünzli
2010-07-05 11:41               ` Alain Frisch

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).