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

David Filip dfilip at colornet.com
Sun Aug 23 11:27:36 EDT 2020


Stephane,

Just want to confirm that the GitHub URL you provided:

>>  https://github.com/glondu/unison/tree/unison-2.51 <https://github.com/glondu/unison/tree/unison-2.51>
fixed the compile problem, as you had predicted (although I was thrown off by the URL being -2.51 and the source being -2.53).  I did not upgrade OCaml from .0 to .1, but I have tested and now have the following successfully working together:

macOS:		unison version 2.51.2 (ocaml 4.08.1)

Raspbian:	unison version 2.51.3 (ocaml 4.08.0)

which is apparently close enough.  Not sure if it is always a good idea or not, but I've many times in the past used Unison versions that are a patch level off and not had any problems.

Thanks for your help!

This is my first time dipping my toe into building Unison from scratch -- I have always used pre-builts in the past, and tried to keep them in-sync between macOS + Raspbian + CentOS, which has not always been easy.  But moreover, the pre-builts that I am finding are really quite old (5 to 9 years old).

Regards,

Dave.

> On Aug 23, 2020, at 11:07 AM, David Filip <dfilip at colornet.com> wrote:
> 
> Stephane,
> 
> This seems to contradict what you said above... unless Brew provides
> binary packages that are not recompiled on each OCaml update.
> 
> Yes, Brew provides binary packages.  But for Raspbian, I am doing the compiling myself.
> 
>> Unison 2.51.2 does not compile with OCaml 4.08.1. In the following branch:
> 
>> 
> 
>>  https://github.com/glondu/unison/tree/unison-2.51 <https://github.com/glondu/unison/tree/unison-2.51>
>> 
> 
>> you will find a fix for that.
> 
> 
> OK, I'll check out that fix, and see if I get any further.
> 
>> I would advise you to use the exact same version, 4.08.1. It is probably
>> easier to use opam.
> 
> 
> OK, what I found before was a page on ocaml.org <http://ocaml.org/> which had 4.08.0 as the latest version, with older versions also listed, but I've looked around and found another page on that site which has later releases (got to the earlier page via Google).
> 
> So you are saying that the even the patch (.0 vs .1) level of OCaml has to match?
> 
> Let me give this another try and report back.
> 
> Cheers,
> 
> Dave.
> 
>> On Aug 23, 2020, at 10:39 AM, Stéphane Glondu <steph at glondu.net <mailto:steph at glondu.net>> wrote:
>> 
>> Dear David,
>> 
>> Le 23/08/2020 à 16:24, David Filip a écrit :
>>> So the latest version of Unison on macOS Brew is:
>>> 
>>>    $ unison -version
>>>    unison version 2.51.2 (ocaml 4.08.1)
>>> 
>>> [...]
>>> 
>>> So I download OCaml 4.08 to Raspbian, and successfully built and
>>> installed it:
>>> 
>>>    # ocaml -version
>>>    The OCaml toplevel, version 4.08.0
>> 
>> I would advise you to use the exact same version, 4.08.1. It is probably
>> easier to use opam.
>> 
>>> 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
>> 
>> Unison 2.51.2 does not compile with OCaml 4.08.1. In the following branch:
>> 
>>  https://github.com/glondu/unison/tree/unison-2.51 <https://github.com/glondu/unison/tree/unison-2.51>
>> 
>> you will find a fix for that.
>> 
>>> Any ideas on how to fix this?  The Brew version of OCaml for macOS is
>>> actually 4.0.9.
>> 
>> This seems to contradict what you said above... unless Brew provides
>> binary packages that are not recompiled on each OCaml update.
>> 
>> 
>> Cheers,
>> 
>> -- 
>> Stéphane
>> 
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://LISTS.SEAS.UPENN.EDU/pipermail/unison-hackers/attachments/20200823/dee82196/attachment-0001.htm>


More information about the Unison-hackers mailing list