How to use unison across OS X and linux? Fatal error due to ocaml version

蓝咒 提交于 2020-07-06 09:37:47

问题


I am trying to use unison from my OS X machine to a linux box running: CentOS release 6.10 (Final)

I had to make a static compilation of unison 2.51 for the linux box. This version is:

unison version 2.51.2 (ocaml 4.02.3)

On the OS X machine I used "brew install unison". This gives me:

unison version 2.51.2 (ocaml 4.08.1)

If I try to now use unison I get:

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

What can I do to get unison to work?


回答1:


You will have to compile ocaml and unison from source on your linux box.

Ocaml: You can find ocaml 4.08 on https://caml.inria.fr/pub/distrib/. The instructions for compiling are in the readme.

Unison: From https://github.com/bcpierce00/unison/commits/master, you will see that the commit acfa105 is a verified commit compatible with Ocaml 4.08.1. Download this commit and run make.

I ran into the exact same issue and was able to resolve it using the above steps.




回答2:


I was running docker with a few containers and using docker-sync to keep things in sync with my local files on my Mac when i hit this issue.

My mac had the following installed:

unison -version
unison version 2.51.2 (ocaml 4.06.1)

My web-sync docker container used:

unison -version
unison version 2.51.2 (ocaml 4.08.1)

The solution that worked for me was:

brew uninstall unison && brew install unison


来源:https://stackoverflow.com/questions/58661715/how-to-use-unison-across-os-x-and-linux-fatal-error-due-to-ocaml-version

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!