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`/Library
git checkout 924387b `brew --prefix`/Library/Formula/objective-caml.rb # check out ocaml-4.01
brew install objective-caml # this will take a while
git reset . && git clean -f # clean up
cd /tmp
curl -O http://www.seas.upenn.edu/~bcpierce/unison//download/releases/stable/unison-2.48.3.tar.gz
tar -xvzf unison-2.48.3.tar.gz
cd unison-2.48.3
make UISTYLE=text
sudo cp unison /usr/local/bin
sudo apt-get update
sudo apt-get install -y ocaml=4.01.0-3ubuntu3
cd ~
curl -O http://www.seas.upenn.edu/~bcpierce/unison//download/releases/stable/unison-2.48.3.tar.gz
tar zxvf unison-2.48.3.tar.gz
cd unison-2.48.3
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.
BTW, for Ubuntu you can fix the version, e.g.
sudo apt-get install -y ocaml=4.01.0-4ubuntu1