caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Török Edwin" <edwin+ml-ocaml@etorok.net>
To: caml-list@inria.fr
Subject: Re: [Caml-list] inconsistent assumptions over implementation Printf
Date: Tue, 23 Jun 2015 23:41:52 +0300	[thread overview]
Message-ID: <5589C490.2030804@etorok.net> (raw)
In-Reply-To: <20150623195254.GA32190@annexia.org>

On 06/23/2015 10:52 PM, Richard W.M. Jones wrote:
> This seems like a rather basic question, but here goes.
> 
> For a long time in Fedora we've used RPM dependencies to enforce that
> the "inconsistent assumptions" error does not occur for end users.
> This means encoding the OCaml version + MD5 hash of each interface.
> For example:
> 
>   $ rpm -q --provides ocaml-runtime
>   ...
>   ocaml(Printf) = eb49a17645c5ea2dd298430a3c986186
>   ...
>   ocaml(runtime) = 4.02.2
> 
> With the move from 4.02.2+rc1 to 4.02.2 final, we've suddenly started
> to see:
> 
>   Error: Files /usr/lib64/ocaml/gettext/gettextBase.cmxa
>        and /usr/lib64/ocaml/stdlib.cmxa
>        make inconsistent assumptions over implementation Printf
> 
> The ocaml(runtime) version string didn't change, so we're relying
> solely on the ocaml(Printf) dependency to prevent this.  According to
> my understanding the above error "cannot" happen, not least because
> Printf didn't change its interface between -rc1 and final.

The error message refers to the compiled *implementation* (cmx), not the interface.

> 
> ocamlobjinfo from the relevant libraries:
> 
>   http://oirase.annexia.org/tmp/stdlib.cmxa.txt
>   http://oirase.annexia.org/tmp/gettextBase.cmxa.txt
> 
> Can someone explain where my understanding is wrong?

The implementation hash for Printf is different in those two cmxa:

Implementations imported:
	04c9d8650cdb1dfb88a0138d7aa7f627	Printf
Implementations imported:	
	3f8359483c50f1154e7f110de488d53c	Printf

If you use ocamlobjinfo to track down the changed implementation hashes you end up in camlinternalFormat changing, which changed due to Sys changing,
which changed due to the (inlinable) version number changing:

-File /home/edwin/.opam/4.02.2+rc1/lib/ocaml/sys.cmx
+File /home/edwin/.opam/4.02.2/lib/ocaml/sys.cmx
 Name: Sys
-CRC of implementation: 0f8a319756ebc1cd7f8defc8ada059bb
+CRC of implementation: 68274db6c865f50a2652e53becb14c88
 Globals defined:
 	Sys
 Interfaces imported:
@@ -21,7 +21,7 @@
    29: const(-18); 30: const(-19); 31: const(-20); 32: const(-21);
    33: global(camlSys,33);
    34: function camlSys__catch_break_1066 arity 1 (closed) ->  _;
-   35: const("camlSys__2"="4.02.2+rc1"))
+   35: const("camlSys__2"="4.02.2"))


Now camlinternalFormat only uses Sys.max_string_length not Sys.ocaml_version, but the hash won't know that ...

> 
> Also - could we *please* make the error message more explanatory.
> Printing out the mismatching MD5 hashes would be a good start.
> 

Yeah, and a -r flag on ocamlobjinfo.

Best regards,
--Edwin


  reply	other threads:[~2015-06-23 20:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-23 19:52 Richard W.M. Jones
2015-06-23 20:41 ` Török Edwin [this message]
2015-06-25  7:58   ` Richard W.M. Jones
2015-06-26 21:27     ` Török Edwin

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=5589C490.2030804@etorok.net \
    --to=edwin+ml-ocaml@etorok.net \
    --cc=caml-list@inria.fr \
    /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;
as well as URLs for NNTP newsgroup(s).