[Unison-hackers] OCaml version mismatch breaks Unison 2.48.4

Andrew Schulman andrex at utexas.edu
Mon Aug 31 09:08:06 EDT 2020


Thank you Stéphane.

> > It seems that I need either:
> > 
> > * A patch to allow Unison 2.48.4 to build with OCaml 4.10, or
> 
> The current master should compile with OCaml 4.10. Can you try in your
> Cygwin setup and report back here? (But wait for the next release before
> uploading that to Cygwin repos since there will be a version bump.)

The problem is that I need to package Unison 2.48. Because of the version
incompatibilities in Unison, we have separate unison2.48 and unison2.51
packages, as well as several older ones, to allow people to sync to hosts
running different versions of Unison.

But I see that there's a unison-2.48 branch. I can try that. I expect it
includes the compatibility patch for OCaml 4.08.1 that I found in the Ubuntu
Unison source.

> > * An OCaml 4.08 package for Cygwin, so I can try to build Unison with that.
> 
> If it is easy, this is what I would advise you until the next release.
> It would allow you to use directly the Ubuntu binary. Otherwise, you'll
> have to recompile Unison on Ubuntu as well (e.g. with opam since OCaml
> 4.10.0 is not yet available in Debian/Ubuntu).

Cygwin doesn't have an OCaml 4.08.1. But I was able to install it with OPAM,
apply the patch from Ubuntu that lets Unison 2.48.4 build with OCaml 4.08.1, and
successfully build Unison. I verified that it works to sync with Unison in
Ubuntu Focal.

> > Suggestions?
> > 
> > BTW I'm the Unison packager for Cygwin, so I need to solve this problem not just
> > for myself, but for any other Cygwin users who are trying to sync with Ubuntu.
> 
> You cannot guarantee that, there usually are at least two supported
> Ubuntu versions (last LTS and last non-LTS), and they can have different
> OCaml versions, leading to incompatible versions of Unison.
> 
> Besides, there is not only Ubuntu, there are Fedora, Suse, ...
> 
> Because the possibilities are too many, I would advise you to focus on
> Cygwin-Cygwin syncs and be explicit in your packaging metadata about
> which version of OCaml has been used to compile your Unison. This is
> what I am going to do with Unison in Debian.

I agree, this is a serious problem for packaging Unison. But even just for me
personally, synchronizing only Cygwin-Cygwin isn't good enough since all of my
Cygwin hosts are clients. The servers are Ubuntu or Red Hat.

In the past I've dealt with Unison versions by creating a separate package for
each version, such as unison2.48 and unison2.51. That's always worked fine.
Users can install them side-by-side, use whichever version they need with each
server, and use alternatives to choose a default version.

But now, if Unison is really incompatible with different versions of OCaml too,
that's a bigger problem. I can't create a new package for every combination of
Unison and OCaml.

By the way, it amazes me that Unison is incompatible across different versions
of OCaml. I don't know anything about OCaml - I'm just the packager. But it
seems like a bad feature.

Anyway, for now I'm just going to update our unison2.48 package, to a new build
with OCaml 4.08.1. That'll work for Cygwin and Ubuntu Focal, but not with older
Ubuntu releases. Not sure yet about any other distros.

Andrew



More information about the Unison-hackers mailing list