caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Inconsistent assumptions over interface
@ 2018-04-22 14:53 Yann Hamdaoui
  2018-04-22 15:29 ` Nicolás Ojeda Bär
  0 siblings, 1 reply; 9+ messages in thread
From: Yann Hamdaoui @ 2018-04-22 14:53 UTC (permalink / raw)
  To: Caml List

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

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

* Re: [Caml-list] Inconsistent assumptions over interface
  2018-04-22 14:53 [Caml-list] Inconsistent assumptions over interface Yann Hamdaoui
@ 2018-04-22 15:29 ` Nicolás Ojeda Bär
  2018-04-23 14:14   ` Yann Hamdaoui
  0 siblings, 1 reply; 9+ messages in thread
From: Nicolás Ojeda Bär @ 2018-04-22 15:29 UTC (permalink / raw)
  To: Yann Hamdaoui; +Cc: Caml List

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

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

* Re: [Caml-list] Inconsistent assumptions over interface
  2018-04-22 15:29 ` Nicolás Ojeda Bär
@ 2018-04-23 14:14   ` Yann Hamdaoui
  2018-06-02 20:02     ` Yawar Amin
  0 siblings, 1 reply; 9+ messages in thread
From: Yann Hamdaoui @ 2018-04-23 14:14 UTC (permalink / raw)
  To: Nicolás Ojeda Bär; +Cc: Caml List

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

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

* Re: [Caml-list] Inconsistent assumptions over interface
  2018-04-23 14:14   ` Yann Hamdaoui
@ 2018-06-02 20:02     ` Yawar Amin
  0 siblings, 0 replies; 9+ messages in thread
From: Yawar Amin @ 2018-06-02 20:02 UTC (permalink / raw)
  To: Yann Hamdaoui; +Cc: Nicolás Ojeda Bär, Caml List

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

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
>

-- 
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: 3923 bytes --]

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

* Re: [Caml-list] inconsistent assumptions over interface
  2015-04-27 15:02 ` Daniel Bünzli
@ 2015-04-27 15:07   ` Ashish Agarwal
  0 siblings, 0 replies; 9+ messages in thread
From: Ashish Agarwal @ 2015-04-27 15:07 UTC (permalink / raw)
  To: Daniel Bünzli; +Cc: Caml List

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

> server code with client code, both seem to have a different
Eliommod_parameters module

Right, thanks! This explains it. There are two Eliommod_parameters
interfaces. We have client/eliom_pervasives.cmi compiled agains the client
one, and _server/foo.cmi compiled against the server one. And then I'm
mixing them somehow.

> Usually in these cases it's a good idea to have a look at the hash of the
inconsistent .cmi files with ocamlobjinfo and try to locate the
corresponding .cmi in the included dirs to get a better idea of what's
going on.

Great suggestion. I'll try this.



On Mon, Apr 27, 2015 at 11:02 AM, Daniel Bünzli <daniel.buenzli@erratique.ch
> wrote:

> > It's Eliom related, though I don't know why that would matter.
> >
> > # Error: The files ~/.opam/4.02.1/lib/eliom/client/eliom_pervasives.cmi
> > # and ../_server/foo.cmi make inconsistent assumptions
> > # over interface Eliommod_parameters
>
> Don't know anything about eliom but it seems that you are trying to
> compile server code with client code, both seem to have a different
> Eliommod_parameters module. I don't know if the Eliommod_parameters cmi are
> supposed to be the same in both cases (if there's a discrepancy that didn't
> use to exist it may be due to compiling with `-keep-locs` which could
> result in problems along the line of [1,2] but I don't know how eliom's
> source is structured).
>
> Usually in these cases it's a good idea to have a look at the hash of the
> inconsistent .cmi files with ocamlobjinfo and try to locate the
> corresponding .cmi in the included dirs to get a better idea of what's
> going on.
>
> Best,
>
> Daniel
>
> [1] https://github.com/ocamllabs/ocaml-ctypes/issues/283
> [2] http://caml.inria.fr/mantis/view.php?id=6311#c13598
>
>
>
>

[-- Attachment #2: Type: text/html, Size: 3129 bytes --]

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

* Re: [Caml-list] inconsistent assumptions over interface
  2015-04-27 14:39 [Caml-list] inconsistent " Ashish Agarwal
  2015-04-27 14:53 ` Drup
@ 2015-04-27 15:02 ` Daniel Bünzli
  2015-04-27 15:07   ` Ashish Agarwal
  1 sibling, 1 reply; 9+ messages in thread
From: Daniel Bünzli @ 2015-04-27 15:02 UTC (permalink / raw)
  To: Ashish Agarwal; +Cc: Caml List

> It's Eliom related, though I don't know why that would matter.
> 
> # Error: The files ~/.opam/4.02.1/lib/eliom/client/eliom_pervasives.cmi
> # and ../_server/foo.cmi make inconsistent assumptions
> # over interface Eliommod_parameters

Don't know anything about eliom but it seems that you are trying to compile server code with client code, both seem to have a different Eliommod_parameters module. I don't know if the Eliommod_parameters cmi are supposed to be the same in both cases (if there's a discrepancy that didn't use to exist it may be due to compiling with `-keep-locs` which could result in problems along the line of [1,2] but I don't know how eliom's source is structured).

Usually in these cases it's a good idea to have a look at the hash of the inconsistent .cmi files with ocamlobjinfo and try to locate the corresponding .cmi in the included dirs to get a better idea of what's going on.

Best,

Daniel

[1] https://github.com/ocamllabs/ocaml-ctypes/issues/283
[2] http://caml.inria.fr/mantis/view.php?id=6311#c13598




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

* Re: [Caml-list] inconsistent assumptions over interface
  2015-04-27 14:53 ` Drup
@ 2015-04-27 15:02   ` Ashish Agarwal
  0 siblings, 0 replies; 9+ messages in thread
From: Ashish Agarwal @ 2015-04-27 15:02 UTC (permalink / raw)
  To: Drup; +Cc: Caml List

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

Thanks for the suggestion. You're probably right, and so it is Eliom
specific. However, the error message is confusing. The file _server/foo.cmi
is generated. Regardless of what else I'm doing wrong, how could this
single cmi file make inconsistent assumptions with another cmi in the eliom
library.


On Mon, Apr 27, 2015 at 10:53 AM, Drup <drupyog+caml@zoho.com> wrote:

> According to the message, my guess is that you are trying to link a server
> file with a client library while having compiled it with the server library.
> Since client and server libraries don't have the same type, they disagree
> over the interface.
>
> My wild guess would be that your build script is broken.
>
>
> Le 27/04/2015 16:39, Ashish Agarwal a écrit :
>
>> The error "inconsistent assumptions over interface" has always been due
>> to a build artifact not being updated after upgrading some library.
>> Rebuilding one's files from scratch always solves the problem. However, I'm
>> in a situation where I've recompiled everything from scratch many times,
>> but I reproducibly get the error below. Does anyone know what else I should
>> look for?
>>
>> It's Eliom related, though I don't know why that would matter.
>>
>> # Error: The files ~/.opam/4.02.1/lib/eliom/client/eliom_pervasives.cmi
>> #        and ../_server/foo.cmi make inconsistent assumptions
>> #        over interface Eliommod_parameters
>> # *** omake: targets were not rebuilt because of errors:
>> #    _build/lib/_client/foo.cmi
>> #       depends on: _build/lib/foo.eliom
>> #    _build/lib/_client/foo.cmo
>> #       depends on: _build/lib/foo.eliom
>>
>>
>
>

[-- Attachment #2: Type: text/html, Size: 2193 bytes --]

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

* Re: [Caml-list] inconsistent assumptions over interface
  2015-04-27 14:39 [Caml-list] inconsistent " Ashish Agarwal
@ 2015-04-27 14:53 ` Drup
  2015-04-27 15:02   ` Ashish Agarwal
  2015-04-27 15:02 ` Daniel Bünzli
  1 sibling, 1 reply; 9+ messages in thread
From: Drup @ 2015-04-27 14:53 UTC (permalink / raw)
  To: Ashish Agarwal, Caml List

According to the message, my guess is that you are trying to link a 
server file with a client library while having compiled it with the 
server library.
Since client and server libraries don't have the same type, they 
disagree over the interface.

My wild guess would be that your build script is broken.

Le 27/04/2015 16:39, Ashish Agarwal a écrit :
> The error "inconsistent assumptions over interface" has always been 
> due to a build artifact not being updated after upgrading some 
> library. Rebuilding one's files from scratch always solves the 
> problem. However, I'm in a situation where I've recompiled everything 
> from scratch many times, but I reproducibly get the error below. Does 
> anyone know what else I should look for?
>
> It's Eliom related, though I don't know why that would matter.
>
> # Error: The files ~/.opam/4.02.1/lib/eliom/client/eliom_pervasives.cmi
> #        and ../_server/foo.cmi make inconsistent assumptions
> #        over interface Eliommod_parameters
> # *** omake: targets were not rebuilt because of errors:
> #    _build/lib/_client/foo.cmi
> #       depends on: _build/lib/foo.eliom
> #    _build/lib/_client/foo.cmo
> #       depends on: _build/lib/foo.eliom
>



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

* [Caml-list] inconsistent assumptions over interface
@ 2015-04-27 14:39 Ashish Agarwal
  2015-04-27 14:53 ` Drup
  2015-04-27 15:02 ` Daniel Bünzli
  0 siblings, 2 replies; 9+ messages in thread
From: Ashish Agarwal @ 2015-04-27 14:39 UTC (permalink / raw)
  To: Caml List

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

The error "inconsistent assumptions over interface" has always been due to
a build artifact not being updated after upgrading some library. Rebuilding
one's files from scratch always solves the problem. However, I'm in a
situation where I've recompiled everything from scratch many times, but I
reproducibly get the error below. Does anyone know what else I should look
for?

It's Eliom related, though I don't know why that would matter.

# Error: The files ~/.opam/4.02.1/lib/eliom/client/eliom_pervasives.cmi
#        and ../_server/foo.cmi make inconsistent assumptions
#        over interface Eliommod_parameters
# *** omake: targets were not rebuilt because of errors:
#    _build/lib/_client/foo.cmi
#       depends on: _build/lib/foo.eliom
#    _build/lib/_client/foo.cmo
#       depends on: _build/lib/foo.eliom

[-- Attachment #2: Type: text/html, Size: 1035 bytes --]

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

end of thread, other threads:[~2018-06-02 20:03 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-22 14:53 [Caml-list] Inconsistent assumptions over interface Yann Hamdaoui
2018-04-22 15:29 ` Nicolás Ojeda Bär
2018-04-23 14:14   ` Yann Hamdaoui
2018-06-02 20:02     ` Yawar Amin
  -- strict thread matches above, loose matches on Subject: below --
2015-04-27 14:39 [Caml-list] inconsistent " Ashish Agarwal
2015-04-27 14:53 ` Drup
2015-04-27 15:02   ` Ashish Agarwal
2015-04-27 15:02 ` Daniel Bünzli
2015-04-27 15:07   ` Ashish Agarwal

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