[Unison-hackers] building the GTK2 UI on Cygwin

Lucas B. Cohen mli6 at free.fr
Wed Dec 12 01:39:47 EST 2007


> De : unison-hackers-bounces at lists.seas.upenn.edu [mailto:unison-hackers-
> bounces at lists.seas.upenn.edu] De la part de vouillon

> On Mon, Dec 10, 2007 at 09:07:02AM +0100, Lucas B. Cohen wrote:
> > I've read pretty much every thread on unison-users that contain the keyword
> > 'unicode' or 'utf'. I would really like to get Unison to operate between
> > Unix and NT machines, and I am willing to spend the necessary time to
> > achieve this.

> > At this point I'm not quite sure what exactly I would be trying to do. In
> > July 2004, Jérôme Vouillon mentioned that Unison "should eventually switch
> > to the Unicode API (or maybe allow to choose between the two APIs)".
> > But wouldn't getting Unison to access NT filesystems through the Windows
> > UTF-16 API cause it to behave even worse, not matching any 8-bit ASCII
> > character read from a UTF-8 encoded Unix filesystem with its corresponding
> > dual-byte UTF-16 counterpart?
> 
> Indeed, one would need to convert between UTF-16 and UTF-8.  But this
> is not a problem as the transcoding is precisely defined and
> invertible.  Besides, this can be done at a low level, in a few
> functions that access the filesystem, and the rest of Unison will only
> see UTF-8 strings.

In fact, this has already been done by Hisao Suzuki in his 'UTF-8 Cygwin' project.


His work can be used when Unison is compiled in a Cygwin environment, with the
Unix version of OCaml. The filesystem-related calls are made by the Unix module
instead of the win32unix substitute, and are thus handled by the Cygwin emulation.

Building the text version of Unison is pretty straightforward, however I was not
able to run the GTK2 one. Compiling it works, but the program crashes immediately
at runtime with the following error : Uncaught exception Gtk.Error("GtkMain.init:
initialization failed\nml_gtk_init: initialization failed").

This happens with OCaml 3.08.0 and 3.10.0, and with versions 2.4.0-2 or 20060908-1
of lablgtk2. 

Is there a structural reason why GTK2/lablgtk2 cannot function together ? I
noticed the Cygwin distribution ships OCaml and lablgtk2 binaries, but only the
text version of Unison.

Jacques : thanks for your answer.

LBC




More information about the Unison-hackers mailing list