Wednesday, January 13, 2010

Native Unison Unicode support

As has been already mentioned in the comments to my last Unison Unicode post, native Unicode support is now available in the development version av Unison. Up until now however, I had been sticking with my home brewed version, in the spirit of "if it ain't broken, don't fix it". But as problems with AppleDouble files started to surface, a bug has been fixed in later versions, it was time for to update.

Step 1, OSX binary: Couldn't find precompiled ones, but as I already had OCaml installed I just checked out the latest trunk and compiled with "make UISTYLE=text". If you want to avoid this hassle you can just get my binary here: (compiled under MacOSX 10.5.3, 568 kb).

Step 2, Win32 binary: Actually there are two options here. Initially I tried the precompiled binaries provided by Jérôme Vouillon, but the problem with the native win32-version is that it doesn't support symbolic links! Turns out I had lots of those, so that wasn't really an option. The other alternative is to run Unison from Cygwin (which I need for sshd on the Windows side anyway). That way symbolic links are supported (cygwin creates Windows style ".lnk" files, but Unison doesn't know this and assumes they are real symbolic links).

That means I have to compile Unison myself under Cygwin. Luckily this was surprisingly simple, just install Cygwin with packages "make" and "ocaml", check out the Unison trunk, and run "make UISTYLE=text" again! As before, if you want to avoid this hassle you can just get my binary here: (compiled under Cygwin 1.7.1/Win2k3 32bit SP2, 564 kb).

Step 3, update scripts and synchronize: Once this was done, I just modified my scripts to use the new binaries (note that I'm no longer using the unicode-hack for cygwin) and everything worked! Unicode support is completely automatic!

My thanks go out to all the developers of Unison!