OCaml Forge

Detail: [#1383] oasis exposes internal modules to other libraries and executables in the same _oasis file

Bugs: Browse | Download .csv | Monitor

[#1383] oasis exposes internal modules to other libraries and executables in the same _oasis file

2014-03-31 13:34
Submitted by:
Hezekiah Carty (hcarty)
Assigned to:
Sylvain Le Gall (gildor-admin)
Due in version:
Accepted As Bug
Plugin OCamlbuild
Operating System:
oasis exposes internal modules to other libraries and executables in the same _oasis file

Detailed description
oasis does not seem to be able to build multiple libraries from a single _oasis file while keeping internal modules hidden.

For example, if I have two libraries each with a module A which is unique to the respective modules:

Library foo
Path: foo/
Pack: true
Modules: A

Library bar
BuildDepends: foo
Path: bar/
Pack: true
Modules: A

then compilation will fail because foo/a.cmi and bar/a.cmi do not match. I would expect foo/a.cmi to be hidden during the compilation of Bar.


Date: 2014-04-02 14:21
Sender: Sylvain Le Gall

Right now, it is not high priority for the next release (which will probably focus on Windows...)

Scheduling for the next one, hopefully.
Date: 2014-04-02 13:11
Sender: Hezekiah Carty

A new feature sounds like a good approach. I'm happy to help test.
Date: 2014-04-01 21:33
Sender: Sylvain Le Gall

I think we should start with pack/ and see if this can be good as well to isolate .mllib file (after all why not).

What about creating a feature for this new source layout ?
Date: 2014-04-01 17:54
Sender: Hezekiah Carty

I agree that it seems like a good approach. pack/ or _oasis/ for a directory perhaps?

Date: 2014-04-01 16:57
Sender: Sylvain Le Gall

I see what you mean. You rely on the fact that you can create .mlpack outside of the directory... This will create the target file outside of the directory and allows to hide implementation.

Right now, a little voice tells me: "what if the sources are in . (toplevel directory) for foo". Answer is probably that it will fail again...

So we are left with only one solution:
Create a specific directory for pack that will contains all .mlpack (e.g pack/ or builddef/ or ???)

Actually that may be a good idea, but I am not yet 100% sure. BTW, this will also allow to generate .mllib with a better separation of internal/public modules.
Date: 2014-04-01 16:32
Sender: Hezekiah Carty

I've attached a simple example. "ocamlbuild bar.cma" works in this case.
Date: 2014-03-31 16:06
Sender: Sylvain Le Gall

There is a way to fine tune include path for ocamlbuild BUT there is no way I am aware of to do that when library bar will build depends on library foo.

Do you have a working example how to do that with ocamlbuild ?

Attached Files:



Field Old Value Date By
Due in versionNone2014-04-02 14:21gildor-admin
File Added253: ocamlbuild-pack.tar.gz2014-04-01 16:32hcarty
assigned_tonone2014-03-31 16:06gildor-admin
ResolutionNone2014-03-31 16:06gildor-admin