[Unison-hackers] OCaml version mismatch breaks Unison 2.48.4

Andrew Schulman andrex at utexas.edu
Sun Aug 30 11:13:04 EDT 2020


Hi. For years I've been syncing my Cygwin and Ubuntu hosts, using Unison 2.48.4.
It worked fine. Now I've just upgraded Ubuntu to Focal (20.04). It still has
Unison 2.48.4, but syncing now fails with the dreaded

Fatal error: Fatal error during unmarshaling (input_value: ill-formed message),
possibly because client and server have been compiled with differentversions of
the OCaml compiler.

How can I solve this?

* In Ubuntu, the only Unison package is 2.48.4, compiled apparently with OCaml
4.08.1.

* In Cygwin, the existing 2.48.4 package was built several years ago, probably
with OCaml 4.01. The current OCaml in Cygwin is 4.10.0, but when I try to
compile Unison 2.48.4 with that, the build fails almost immediately:

$ cygport unison.cygport make
>>> Compiling unison2.48-2.48.4-2.x86_64
UISTYLE = text
Building for Unix
NATIVE = true
THREADS = false
STATIC = false
OSTYPE = cygwin
OSARCH = Cygwin
ocamlopt: unicode.ml ---> unicode.cmx
ocamlopt -g -I lwt -I ubase -I system -I fsmonitor -I fsmonitor/linux -I
fsmonitor/windows -I system/generic -I lwt/generic -c
unison2.48-2.48.4-2.x86_64/build/unicode.ml
File "unison2.48-2.48.4-2.x86_64/build/unicode.ml", line 25, characters 16-33:
25 | let set s i v = String.unsafe_set s i (Char.unsafe_chr v)
                     ^^^^^^^^^^^^^^^^^
Alert deprecated: Stdlib.String.unsafe_set
File "unison2.48-2.48.4-2.x86_64/build/unicode.ml", line 822, characters 20-21:
822 |     String.blit s k s (k + d) (i - k);
                          ^
Error: This expression has type string but an expression was expected of type
         bytes
make: *** [Makefile.OCaml:435: unicode.cmx] Error 2


It seems that I need either:

* A patch to allow Unison 2.48.4 to build with OCaml 4.10, or
* An OCaml 4.08 package for Cygwin, so I can try to build Unison with that.

Suggestions?

BTW I'm the Unison packager for Cygwin, so I need to solve this problem not just
for myself, but for any other Cygwin users who are trying to sync with Ubuntu.

Thanks!
Andrew



More information about the Unison-hackers mailing list