Yann, if you use the Dune build tool it automatically prefixes your package's modules with the package name, e.g. if you have `mypackage/src/format.ml` in your source, Dune will make sure it gets compiled to `mypackage__format.cmi`.

Regards,

Yawar

On Mon, Apr 23, 2018 at 10:14 AM, Yann Hamdaoui <yann.hamdaoui@gmail.com> wrote:
I see. I'm tempted to wait for 4.07 but keeping a module named Format
would still break compatibility for lower versions, so I guess I have to
come up with a different name.
Thank you for your help, Nicolás.

Y.H

On 22/04/2018 17:29, Nicolás Ojeda Bär wrote:
> Hello Yann,
>
> Indeed, you cannot link two different modules of the same name in the
> same program, where "same name" essentially means that their .cmi
> files are named similarly.
> The good news is that the upcoming 4.07 release fixes this
> long-standing issue by using long compilation unit names for stdlib
> modules which are unlikely to conflict with anything else.
> (e.g. the .cmi of the stdlib Format module is named stdlib__format.cmi in 4.07).
>
> Best wishes,
> Nicolás
>
> On Sun, Apr 22, 2018 at 4:53 PM, Yann Hamdaoui <yann.hamdaoui@gmail.com> wrote:
>> Dear list,
>>
>> I ran into a problem today while compiling a library of mine. I got the
>> following error :
>>
>> "Error: The files [...]/.opam/4.06.0/lib/re/re.cmi and src/format.cmi
>> make inconsistent assumptions over interface Format".
>>
>> After a quick search it should be solved by cleaning everything and make
>> a fresh build. In my case it didn't, and I suspect this is because I
>> declared a module named Format in my lib which clashes with the
>> Pervasive.Format that seems to be used by the re library (which is a
>> dependence). Does it mean that I can't use any XXX as a module name if
>> it already exists in Pervasives and is used by some library I depend on ?
>>
>>
>> Y.H
>>
>>
>> --
>> 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



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