You can install Unison on the Mac via homebrew (brew install unison
),
but it's very likely that it won't work properly, resulting in errors like:
Unison failed: Uncaught exception Failure("input_value: bad bigarray kind")
Fatal error: Lost connection with the server
To solve this problem, you have to make sure that Unison is compiled with
the same version of ocaml
on both Mac & Vagrant. And this requires some
manual work.
Here are the steps involved:
# See: https://github.com/Homebrew/homebrew/issues/37378
brew tap Caskroom/cask
brew install Caskroom/cask/xquartz
cd `brew --prefix`/Homebrew/Library/Taps/homebrew/homebrew-core
git fetch --unshallow # by default, only has latest revision
git checkout b15592e087b968ccd7aee2a7ae1b6998116c2180 Formula/ocaml.rb # check out ocaml-4.05
brew install ocaml # this will take awhile
brew pin ocaml # prevent update/upgrade from blowing this away when repository is upgraded
git reset . && git checkout . # clean up
cd /tmp
wget http://www.seas.upenn.edu/~bcpierce/unison//download/releases/stable/unison-2.48.4.tar.gz
tar -xvzf unison-2.48.4.tar.gz
cd src
make UISTYLE=text
sudo cp unison /usr/local/bin
cd /tmp
mkdir unison
cd unison
wget http://caml.inria.fr/pub/distrib/ocaml-4.05/ocaml-4.05.0.tar.gz
tar -zxvf ocaml-4.05.0.tar.gz
cd ocaml-4.05.0
./configure
make world.opt
sudo make install
cd ..
wget http://www.seas.upenn.edu/~bcpierce/unison//download/releases/stable/unison-2.48.4.tar.gz
tar -zxvf unison-2.48.4.tar.gz
cd src
make UISTYLE=text NATIVE=false
sudo cp unison /usr/local/bin/
That's it. Unison sync should now work properly between Mac OS & Ubuntu on Vagrant.