exact version dependency for ocaml libraries

Anil Madhavapeddy avsm at macports.org
Fri Feb 19 02:49:55 PST 2010

On 9 Feb 2010, at 00:15, Ryan Schmidt wrote:

> On Feb 8, 2010, at 17:50, Anil Madhavapeddy wrote:
>> OCaml ports are very sensitive to the exact version of the compiler (and dependent libraries) used to compile them, since the type signature is a hash over the binary output.  If the compiler is upgraded, but libraries are not recompiled, then the whole compilation fails with a slightly obscure error like:
>> File "db.ml", line 1, characters 0-1:
>> Error: The files /opt/local/lib/ocaml/site-lib/calendar/calendarLib.cmi
>>     and /opt/local/lib/ocaml/printf.cmi make inconsistent assumptions
>>     over interface Buffer
>> So... I was wondering how to encode the depends_lib so that the OCaml libraries in MacPorts depend on the *exact* version of OCaml they were compiled with, and a subsequent upgrade of the OCaml port will also trigger a recompile of the dependent libraries.  Could someone advise me of the TCL-foo to make this possible (if so) ?
> There is no syntax in MacPorts to make that possible.
> So, you'll have to manually increase the revision of the ocaml ports when the compiler version increases.

Does the revision have to be an integer, or will a string comparison do?

I was thinking of including the version of the OCaml port appended to the version of the library in question. That would guarantee binary compatibility, but I'm not sure how version comparisons would work in this situation.



Or just bite the bullet and bump the whole set of revisions for all those dependent ports, argh :)


More information about the macports-dev mailing list