[Unison-hackers] Building Compatible Unison: macOS + Raspbian

frederik at ofb.net frederik at ofb.net
Sun Aug 23 13:50:03 EDT 2020


Hi David,

For myself, I wrote a little script which builds a fixed version of Unison against a fixed version of OCaml. I find it helpful for syncing between different architectures (Arch Linux + Raspbian). I don't know if it'll work on MacOS, but maybe it is simple enough that you can fix whatever bugs you run into. It's in this repo:

https://github.com/navarum/tweaks

I shared this with the list in January as well. Let me know if it is useful.

Frederick


On Sun, Aug 23, 2020 at 10:24:53AM -0400, David Filip wrote:
>Dear Unison Hackers:
>
>Was wondering if anyone out there could provide some Unison build help?  I'm trying to get Unison 2.51 running on both macOS (High Sierra, 10.13) and Raspberry Pi (Raspbian / Debain 9.13).
>
>So the latest version of Unison on macOS Brew is:
>
>$ unison -version
>unison version 2.51.2 (ocaml 4.08.1)
>
>So I installed OCaml on Raspbian (apt-get install ocaml), downloaded the latest Unison source code (2.51.2) from this page:
>
>https://github.com/bcpierce00/unison/releases <https://github.com/bcpierce00/unison/releases>
>
>and was able to successfully compile and install Unison 2.51.2 on Raspbian:
>
>$ unison -version
>unison version 2.51.2 (ocaml 4.02.3)
>
>However, when I try to sync between macOS and Raspbian, I receive the following error:
>
>Fatal error: Server: Fatal error during unmarshaling (input_value: ill-formed message),
>possibly because client and server have been compiled with differentversions of the OCaml compiler.
>
>So assuming that is an accurate message -- and not a red herring -- it appears that now not only the versions if Unison have to match, but also the same version of OCaml!
>
>So I download OCaml 4.08 to Raspbian, and successfully built and installed it:
>
># ocaml -version
>The OCaml toplevel, version 4.08.0
>
>I then went back to Unison 2.51, and did a:
>
># make clean
># make
>
>but whereas with OCaml 4.02 I just received a bunch of warnings, I now receive a fatal error when compiling Unison with OCaml 4.08 (to match the version that Unison on Brew was built with):
>
>ocamlopt: system.mli ---> system.cmi
>ocamlopt -g -unsafe-string -I lwt -I ubase -I system -I fsmonitor -I fsmonitor/linux -I fsmonitor/windows -I system/generic -I lwt/generic -c /opt/unison-2.51.2/src/system.mli
>ocamlopt: system.ml ---> system.cmx
>ocamlopt -g -unsafe-string -I lwt -I ubase -I system -I fsmonitor -I fsmonitor/linux -I fsmonitor/windows -I system/generic -I lwt/generic -c /opt/unison-2.51.2/src/system.ml
>File "/opt/unison-2.51.2/src/system.ml", line 1:
>Error: The implementation /opt/unison-2.51.2/src/system.ml
>       does not match the interface system.cmi:
>       Values do not match:
>         val link : ?follow:bool -> string -> string -> unit
>       is not included in
>         val link : fspath -> fspath -> unit
>       File "/opt/unison-2.51.2/src/system/system_intf.ml", line 70, characters 0-35:
>         Expected declaration
>       File "/opt/unison-2.51.2/src/system/system_generic.ml", line 50, characters 4-8:
>         Actual declaration
>Makefile.OCaml:422: recipe for target 'system.cmx' failed
>make[1]: *** [system.cmx] Error 2
>make[1]: Leaving directory '/opt/unison-2.51.2/src'
>Makefile:6: recipe for target 'text' failed
>make: *** [text] Error 2
>
>Unfortunately, I don't know anything about OCaml to know exactly what this means or how to fix it.
>
>Any ideas on how to fix this?  The Brew version of OCaml for macOS is actually 4.0.9.
>
>BTW - I have been using Unison 2.40 on macOS + Raspbian + CentOS Linux for many years, but have decided it is probably time for an upgrade.
>
>Any help would be appreciated.
>
>Thanks,
>
>Dave.
>

>_______________________________________________
>Unison-hackers mailing list
>Unison-hackers at LISTS.SEAS.UPENN.EDU
>https://LISTS.SEAS.UPENN.EDU/mailman/listinfo/unison-hackers



More information about the Unison-hackers mailing list