From dfilip at colornet.com Sun Aug 23 10:24:53 2020 From: dfilip at colornet.com (David Filip) Date: Sun, 23 Aug 2020 10:24:53 -0400 Subject: [Unison-hackers] Building Compatible Unison: macOS + Raspbian Message-ID: <0738C1F6-2E13-4A47-93F3-17FEB42D7E73@colornet.com> Dear Unison Hackers: Was wondering if anyone out there could provide some Unison build help? I'm trying to get Unison 2.51 running on both macOS (High Sierra, 10.13) and Raspberry Pi (Raspbian / Debain 9.13). So the latest version of Unison on macOS Brew is: $ unison -version unison version 2.51.2 (ocaml 4.08.1) So I installed OCaml on Raspbian (apt-get install ocaml), downloaded the latest Unison source code (2.51.2) from this page: https://github.com/bcpierce00/unison/releases and was able to successfully compile and install Unison 2.51.2 on Raspbian: $ unison -version unison version 2.51.2 (ocaml 4.02.3) However, when I try to sync between macOS and Raspbian, I receive the following error: Fatal error: Server: Fatal error during unmarshaling (input_value: ill-formed message), possibly because client and server have been compiled with differentversions of the OCaml compiler. So assuming that is an accurate message -- and not a red herring -- it appears that now not only the versions if Unison have to match, but also the same version of OCaml! So I download OCaml 4.08 to Raspbian, and successfully built and installed it: # ocaml -version The OCaml toplevel, version 4.08.0 I then went back to Unison 2.51, and did a: # make clean # make but whereas with OCaml 4.02 I just received a bunch of warnings, I now receive a fatal error when compiling Unison with OCaml 4.08 (to match the version that Unison on Brew was built with): ocamlopt: system.mli ---> system.cmi ocamlopt -g -unsafe-string -I lwt -I ubase -I system -I fsmonitor -I fsmonitor/linux -I fsmonitor/windows -I system/generic -I lwt/generic -c /opt/unison-2.51.2/src/system.mli ocamlopt: system.ml ---> system.cmx ocamlopt -g -unsafe-string -I lwt -I ubase -I system -I fsmonitor -I fsmonitor/linux -I fsmonitor/windows -I system/generic -I lwt/generic -c /opt/unison-2.51.2/src/system.ml File "/opt/unison-2.51.2/src/system.ml", line 1: Error: The implementation /opt/unison-2.51.2/src/system.ml does not match the interface system.cmi: Values do not match: val link : ?follow:bool -> string -> string -> unit is not included in val link : fspath -> fspath -> unit File "/opt/unison-2.51.2/src/system/system_intf.ml", line 70, characters 0-35: Expected declaration File "/opt/unison-2.51.2/src/system/system_generic.ml", line 50, characters 4-8: Actual declaration Makefile.OCaml:422: recipe for target 'system.cmx' failed make[1]: *** [system.cmx] Error 2 make[1]: Leaving directory '/opt/unison-2.51.2/src' Makefile:6: recipe for target 'text' failed make: *** [text] Error 2 Unfortunately, I don't know anything about OCaml to know exactly what this means or how to fix it. Any ideas on how to fix this? The Brew version of OCaml for macOS is actually 4.0.9. BTW - I have been using Unison 2.40 on macOS + Raspbian + CentOS Linux for many years, but have decided it is probably time for an upgrade. Any help would be appreciated. Thanks, Dave. -------------- next part -------------- An HTML attachment was scrubbed... URL: From steph at glondu.net Sun Aug 23 10:39:00 2020 From: steph at glondu.net (=?UTF-8?Q?St=c3=a9phane_Glondu?=) Date: Sun, 23 Aug 2020 16:39:00 +0200 Subject: [Unison-hackers] Building Compatible Unison: macOS + Raspbian In-Reply-To: <0738C1F6-2E13-4A47-93F3-17FEB42D7E73@colornet.com> References: <0738C1F6-2E13-4A47-93F3-17FEB42D7E73@colornet.com> Message-ID: Dear David, Le 23/08/2020 ? 16:24, David Filip a ?crit?: > So the latest version of Unison on macOS Brew is: > > $ unison -version > unison version 2.51.2 (ocaml 4.08.1) > > [...] > > So I download OCaml 4.08 to Raspbian, and successfully built and > installed it: > > # ocaml -version > The OCaml toplevel, version 4.08.0 I would advise you to use the exact same version, 4.08.1. It is probably easier to use opam. > I then went back to Unison 2.51, and did a: > > # make clean > # make > > > but whereas with OCaml 4.02 I just received a bunch of warnings, I now > receive a fatal error when compiling Unison with OCaml 4.08 (to match > the version that Unison on Brew was built with): > > ocamlopt: system.mli ---> system.cmi > ocamlopt -g -unsafe-string -I lwt -I ubase -I system -I fsmonitor -I > fsmonitor/linux -I fsmonitor/windows -I system/generic -I > lwt/generic -c /opt/unison-2.51.2/src/system.mli > ocamlopt: system.ml ---> system.cmx > ocamlopt -g -unsafe-string -I lwt -I ubase -I system -I fsmonitor -I > fsmonitor/linux -I fsmonitor/windows -I system/generic -I > lwt/generic -c /opt/unison-2.51.2/src/system.ml > *File "/opt/unison-2.51.2/src/system.ml", line 1*: > *Error*: The implementation /opt/unison-2.51.2/src/system.ml > ?? ? ? does not match the interface system.cmi: > ?? ? ? Values do not match: > ?? ? ? ? val link : ?follow:bool -> string -> string -> unit > ?? ? ? is not included in > ?? ? ? ? val link : fspath -> fspath -> unit > ?? ? ? *File "/opt/unison-2.51.2/src/system/system_intf.ml", line > 70, characters 0-35*: > ?? ? ? ? Expected declaration > ?? ? ? *File "/opt/unison-2.51.2/src/system/system_generic.ml", line > 50, characters 4-8*: > ?? ? ? ? Actual declaration > Makefile.OCaml:422: recipe for target 'system.cmx' failed > make[1]: *** [system.cmx] Error 2 > make[1]: Leaving directory '/opt/unison-2.51.2/src' > Makefile:6: recipe for target 'text' failed > make: *** [text] Error 2 Unison 2.51.2 does not compile with OCaml 4.08.1. In the following branch: https://github.com/glondu/unison/tree/unison-2.51 you will find a fix for that. > Any ideas on how to fix this? ?The Brew version of OCaml for macOS is > actually 4.0.9. This seems to contradict what you said above... unless Brew provides binary packages that are not recompiled on each OCaml update. Cheers, -- St?phane From dfilip at colornet.com Sun Aug 23 11:07:56 2020 From: dfilip at colornet.com (David Filip) Date: Sun, 23 Aug 2020 11:07:56 -0400 Subject: [Unison-hackers] Building Compatible Unison: macOS + Raspbian In-Reply-To: References: <0738C1F6-2E13-4A47-93F3-17FEB42D7E73@colornet.com> Message-ID: <00ACEF2B-ECE2-4D63-AD5F-1B0979B7999C@colornet.com> Stephane, This seems to contradict what you said above... unless Brew provides binary packages that are not recompiled on each OCaml update. Yes, Brew provides binary packages. But for Raspbian, I am doing the compiling myself. > Unison 2.51.2 does not compile with OCaml 4.08.1. In the following branch: > > https://github.com/glondu/unison/tree/unison-2.51 > > you will find a fix for that. OK, I'll check out that fix, and see if I get any further. > I would advise you to use the exact same version, 4.08.1. It is probably > easier to use opam. OK, what I found before was a page on ocaml.org which had 4.08.0 as the latest version, with older versions also listed, but I've looked around and found another page on that site which has later releases (got to the earlier page via Google). So you are saying that the even the patch (.0 vs .1) level of OCaml has to match? Let me give this another try and report back. Cheers, Dave. > On Aug 23, 2020, at 10:39 AM, St?phane Glondu wrote: > > Dear David, > > Le 23/08/2020 ? 16:24, David Filip a ?crit : >> So the latest version of Unison on macOS Brew is: >> >> $ unison -version >> unison version 2.51.2 (ocaml 4.08.1) >> >> [...] >> >> So I download OCaml 4.08 to Raspbian, and successfully built and >> installed it: >> >> # ocaml -version >> The OCaml toplevel, version 4.08.0 > > I would advise you to use the exact same version, 4.08.1. It is probably > easier to use opam. > >> I then went back to Unison 2.51, and did a: >> >> # make clean >> # make >> >> >> but whereas with OCaml 4.02 I just received a bunch of warnings, I now >> receive a fatal error when compiling Unison with OCaml 4.08 (to match >> the version that Unison on Brew was built with): >> >> ocamlopt: system.mli ---> system.cmi >> ocamlopt -g -unsafe-string -I lwt -I ubase -I system -I fsmonitor -I >> fsmonitor/linux -I fsmonitor/windows -I system/generic -I >> lwt/generic -c /opt/unison-2.51.2/src/system.mli >> ocamlopt: system.ml ---> system.cmx >> ocamlopt -g -unsafe-string -I lwt -I ubase -I system -I fsmonitor -I >> fsmonitor/linux -I fsmonitor/windows -I system/generic -I >> lwt/generic -c /opt/unison-2.51.2/src/system.ml >> *File "/opt/unison-2.51.2/src/system.ml", line 1*: >> *Error*: The implementation /opt/unison-2.51.2/src/system.ml >> does not match the interface system.cmi: >> Values do not match: >> val link : ?follow:bool -> string -> string -> unit >> is not included in >> val link : fspath -> fspath -> unit >> *File "/opt/unison-2.51.2/src/system/system_intf.ml", line >> 70, characters 0-35*: >> Expected declaration >> *File "/opt/unison-2.51.2/src/system/system_generic.ml", line >> 50, characters 4-8*: >> Actual declaration >> Makefile.OCaml:422: recipe for target 'system.cmx' failed >> make[1]: *** [system.cmx] Error 2 >> make[1]: Leaving directory '/opt/unison-2.51.2/src' >> Makefile:6: recipe for target 'text' failed >> make: *** [text] Error 2 > > Unison 2.51.2 does not compile with OCaml 4.08.1. In the following branch: > > https://github.com/glondu/unison/tree/unison-2.51 > > you will find a fix for that. > >> Any ideas on how to fix this? The Brew version of OCaml for macOS is >> actually 4.0.9. > > This seems to contradict what you said above... unless Brew provides > binary packages that are not recompiled on each OCaml update. > > > Cheers, > > -- > St?phane > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dfilip at colornet.com Sun Aug 23 11:27:36 2020 From: dfilip at colornet.com (David Filip) Date: Sun, 23 Aug 2020 11:27:36 -0400 Subject: [Unison-hackers] Building Compatible Unison: macOS + Raspbian In-Reply-To: <00ACEF2B-ECE2-4D63-AD5F-1B0979B7999C@colornet.com> References: <0738C1F6-2E13-4A47-93F3-17FEB42D7E73@colornet.com> <00ACEF2B-ECE2-4D63-AD5F-1B0979B7999C@colornet.com> Message-ID: Stephane, Just want to confirm that the GitHub URL you provided: >> https://github.com/glondu/unison/tree/unison-2.51 fixed the compile problem, as you had predicted (although I was thrown off by the URL being -2.51 and the source being -2.53). I did not upgrade OCaml from .0 to .1, but I have tested and now have the following successfully working together: macOS: unison version 2.51.2 (ocaml 4.08.1) Raspbian: unison version 2.51.3 (ocaml 4.08.0) which is apparently close enough. Not sure if it is always a good idea or not, but I've many times in the past used Unison versions that are a patch level off and not had any problems. Thanks for your help! This is my first time dipping my toe into building Unison from scratch -- I have always used pre-builts in the past, and tried to keep them in-sync between macOS + Raspbian + CentOS, which has not always been easy. But moreover, the pre-builts that I am finding are really quite old (5 to 9 years old). Regards, Dave. > On Aug 23, 2020, at 11:07 AM, David Filip wrote: > > Stephane, > > This seems to contradict what you said above... unless Brew provides > binary packages that are not recompiled on each OCaml update. > > Yes, Brew provides binary packages. But for Raspbian, I am doing the compiling myself. > >> Unison 2.51.2 does not compile with OCaml 4.08.1. In the following branch: > >> > >> https://github.com/glondu/unison/tree/unison-2.51 >> > >> you will find a fix for that. > > > OK, I'll check out that fix, and see if I get any further. > >> I would advise you to use the exact same version, 4.08.1. It is probably >> easier to use opam. > > > OK, what I found before was a page on ocaml.org which had 4.08.0 as the latest version, with older versions also listed, but I've looked around and found another page on that site which has later releases (got to the earlier page via Google). > > So you are saying that the even the patch (.0 vs .1) level of OCaml has to match? > > Let me give this another try and report back. > > Cheers, > > Dave. > >> On Aug 23, 2020, at 10:39 AM, St?phane Glondu > wrote: >> >> Dear David, >> >> Le 23/08/2020 ? 16:24, David Filip a ?crit : >>> So the latest version of Unison on macOS Brew is: >>> >>> $ unison -version >>> unison version 2.51.2 (ocaml 4.08.1) >>> >>> [...] >>> >>> So I download OCaml 4.08 to Raspbian, and successfully built and >>> installed it: >>> >>> # ocaml -version >>> The OCaml toplevel, version 4.08.0 >> >> I would advise you to use the exact same version, 4.08.1. It is probably >> easier to use opam. >> >>> I then went back to Unison 2.51, and did a: >>> >>> # make clean >>> # make >>> >>> >>> but whereas with OCaml 4.02 I just received a bunch of warnings, I now >>> receive a fatal error when compiling Unison with OCaml 4.08 (to match >>> the version that Unison on Brew was built with): >>> >>> ocamlopt: system.mli ---> system.cmi >>> ocamlopt -g -unsafe-string -I lwt -I ubase -I system -I fsmonitor -I >>> fsmonitor/linux -I fsmonitor/windows -I system/generic -I >>> lwt/generic -c /opt/unison-2.51.2/src/system.mli >>> ocamlopt: system.ml ---> system.cmx >>> ocamlopt -g -unsafe-string -I lwt -I ubase -I system -I fsmonitor -I >>> fsmonitor/linux -I fsmonitor/windows -I system/generic -I >>> lwt/generic -c /opt/unison-2.51.2/src/system.ml >>> *File "/opt/unison-2.51.2/src/system.ml", line 1*: >>> *Error*: The implementation /opt/unison-2.51.2/src/system.ml >>> does not match the interface system.cmi: >>> Values do not match: >>> val link : ?follow:bool -> string -> string -> unit >>> is not included in >>> val link : fspath -> fspath -> unit >>> *File "/opt/unison-2.51.2/src/system/system_intf.ml", line >>> 70, characters 0-35*: >>> Expected declaration >>> *File "/opt/unison-2.51.2/src/system/system_generic.ml", line >>> 50, characters 4-8*: >>> Actual declaration >>> Makefile.OCaml:422: recipe for target 'system.cmx' failed >>> make[1]: *** [system.cmx] Error 2 >>> make[1]: Leaving directory '/opt/unison-2.51.2/src' >>> Makefile:6: recipe for target 'text' failed >>> make: *** [text] Error 2 >> >> Unison 2.51.2 does not compile with OCaml 4.08.1. In the following branch: >> >> https://github.com/glondu/unison/tree/unison-2.51 >> >> you will find a fix for that. >> >>> Any ideas on how to fix this? The Brew version of OCaml for macOS is >>> actually 4.0.9. >> >> This seems to contradict what you said above... unless Brew provides >> binary packages that are not recompiled on each OCaml update. >> >> >> Cheers, >> >> -- >> St?phane >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From frederik at ofb.net Sun Aug 23 13:50:03 2020 From: frederik at ofb.net (frederik at ofb.net) Date: Sun, 23 Aug 2020 10:50:03 -0700 Subject: [Unison-hackers] Building Compatible Unison: macOS + Raspbian In-Reply-To: <0738C1F6-2E13-4A47-93F3-17FEB42D7E73@colornet.com> References: <0738C1F6-2E13-4A47-93F3-17FEB42D7E73@colornet.com> Message-ID: <20200823175003.GT3883797@localhost> Hi David, For myself, I wrote a little script which builds a fixed version of Unison against a fixed version of OCaml. I find it helpful for syncing between different architectures (Arch Linux + Raspbian). I don't know if it'll work on MacOS, but maybe it is simple enough that you can fix whatever bugs you run into. It's in this repo: https://github.com/navarum/tweaks I shared this with the list in January as well. Let me know if it is useful. Frederick On Sun, Aug 23, 2020 at 10:24:53AM -0400, David Filip wrote: >Dear Unison Hackers: > >Was wondering if anyone out there could provide some Unison build help? I'm trying to get Unison 2.51 running on both macOS (High Sierra, 10.13) and Raspberry Pi (Raspbian / Debain 9.13). > >So the latest version of Unison on macOS Brew is: > >$ unison -version >unison version 2.51.2 (ocaml 4.08.1) > >So I installed OCaml on Raspbian (apt-get install ocaml), downloaded the latest Unison source code (2.51.2) from this page: > >https://github.com/bcpierce00/unison/releases > >and was able to successfully compile and install Unison 2.51.2 on Raspbian: > >$ unison -version >unison version 2.51.2 (ocaml 4.02.3) > >However, when I try to sync between macOS and Raspbian, I receive the following error: > >Fatal error: Server: Fatal error during unmarshaling (input_value: ill-formed message), >possibly because client and server have been compiled with differentversions of the OCaml compiler. > >So assuming that is an accurate message -- and not a red herring -- it appears that now not only the versions if Unison have to match, but also the same version of OCaml! > >So I download OCaml 4.08 to Raspbian, and successfully built and installed it: > ># ocaml -version >The OCaml toplevel, version 4.08.0 > >I then went back to Unison 2.51, and did a: > ># make clean ># make > >but whereas with OCaml 4.02 I just received a bunch of warnings, I now receive a fatal error when compiling Unison with OCaml 4.08 (to match the version that Unison on Brew was built with): > >ocamlopt: system.mli ---> system.cmi >ocamlopt -g -unsafe-string -I lwt -I ubase -I system -I fsmonitor -I fsmonitor/linux -I fsmonitor/windows -I system/generic -I lwt/generic -c /opt/unison-2.51.2/src/system.mli >ocamlopt: system.ml ---> system.cmx >ocamlopt -g -unsafe-string -I lwt -I ubase -I system -I fsmonitor -I fsmonitor/linux -I fsmonitor/windows -I system/generic -I lwt/generic -c /opt/unison-2.51.2/src/system.ml >File "/opt/unison-2.51.2/src/system.ml", line 1: >Error: The implementation /opt/unison-2.51.2/src/system.ml > does not match the interface system.cmi: > Values do not match: > val link : ?follow:bool -> string -> string -> unit > is not included in > val link : fspath -> fspath -> unit > File "/opt/unison-2.51.2/src/system/system_intf.ml", line 70, characters 0-35: > Expected declaration > File "/opt/unison-2.51.2/src/system/system_generic.ml", line 50, characters 4-8: > Actual declaration >Makefile.OCaml:422: recipe for target 'system.cmx' failed >make[1]: *** [system.cmx] Error 2 >make[1]: Leaving directory '/opt/unison-2.51.2/src' >Makefile:6: recipe for target 'text' failed >make: *** [text] Error 2 > >Unfortunately, I don't know anything about OCaml to know exactly what this means or how to fix it. > >Any ideas on how to fix this? The Brew version of OCaml for macOS is actually 4.0.9. > >BTW - I have been using Unison 2.40 on macOS + Raspbian + CentOS Linux for many years, but have decided it is probably time for an upgrade. > >Any help would be appreciated. > >Thanks, > >Dave. > >_______________________________________________ >Unison-hackers mailing list >Unison-hackers at LISTS.SEAS.UPENN.EDU >https://LISTS.SEAS.UPENN.EDU/mailman/listinfo/unison-hackers From dfilip at colornet.com Mon Aug 24 07:55:44 2020 From: dfilip at colornet.com (David Filip) Date: Mon, 24 Aug 2020 07:55:44 -0400 Subject: [Unison-hackers] Inquiry: Specifying Alternate Server Command Message-ID: Dear Unison Hackers, I have a question about whether or not it is possible to specify an alternate command on the server to start Unison, as specified in the profile (.prf) fie? There are so many things that can be overridden, I thought that this might be possible. but I can't find it in the user manual. Specifically, I have the following use case: I have a server that I am using for storage across multiple systems, and I am upgrading from Unison 2.40 to Unison 2.51 on some of those systems. As we all know, Unison requires that the version matches between the client and server. However, it is going to take some time to get all of the systems upgraded to 2.51. I fully realize that the 'ar' and 'fp' files cannot be shared across versions. However, those are system (client) specific, and most of what I am sync'ing would not overlap between versions. The challenge is that I am not sure if it is possible to start a different command -- other than '/usr/local/bin/unison' -- from different clients, e.g., '/usr/local/bin/unison-2.40' from a 2.40 Unison client, vs. '/usr/local/bin/unison-2.51' from a 2.51 Unison client. If anyone is aware of if that is possible, and how to do it (e.g., something in the .prf file), please advise. If this is an obvious question that is already covered in the Unison documentation, I apologize, please publicly flog me, and then point me to the appropriate configuration parameter, as for some reason I missed it. If it is not possible, then I offer it as a suggestion for a future release. Thanks in advance for any feedback on this. Regards, Dave Filip p.s. If you are wondering why needing to support two versions of Unison on a common server is necessary, without boring you with all the details, it is because I have a single (NAS) server that I share across multiple operating systems, and now that I am building Unison from source, it will take some time to get everything totally in-sync. Previously I just relied on pre-built binaries of a particular Unison version and matching repository (yum, apt-get, etc.) versions, but using that approach I have been stuck on 2.40 -- which appears to be the most ubiquitous version -- for a very long time. p.p.s. I realize that one approach to this might be creating a separate login for each version of Unison on the server and then adjusting the path to point to different Unison executables, but that creates additional complexity that I was hoping to avoid (my current configuration does not make that easy given different file permissions across different accounts, and I am loathe to set up different accounts with the same uid/gid but different names just for Unison, because that usually runs into trouble later on). From steph at glondu.net Tue Aug 25 02:18:33 2020 From: steph at glondu.net (=?UTF-8?Q?St=c3=a9phane_Glondu?=) Date: Tue, 25 Aug 2020 08:18:33 +0200 Subject: [Unison-hackers] Inquiry: Specifying Alternate Server Command In-Reply-To: References: Message-ID: Le 24/08/2020 ? 13:55, David Filip a ?crit?: > I have a question about whether or not it is possible to specify an alternate command on the server to start Unison, as specified in the profile (.prf) fie? There are so many things that can be overridden, I thought that this might be possible. but I can't find it in the user manual. Yes: the "servercmd" option. Cheers, -- St?phane From dfilip at colornet.com Wed Aug 26 10:13:12 2020 From: dfilip at colornet.com (David Filip) Date: Wed, 26 Aug 2020 10:13:12 -0400 Subject: [Unison-hackers] Inquiry: Specifying Alternate Server Command In-Reply-To: References: Message-ID: <3AB1A1FD-E6CA-44D1-9D3D-16A1ADE78A05@colornet.com> Thanks! Somehow I missed that as a profile (.prf) parameter! > On Aug 25, 2020, at 2:18 AM, St?phane Glondu wrote: > > Le 24/08/2020 ? 13:55, David Filip a ?crit : >> I have a question about whether or not it is possible to specify an alternate command on the server to start Unison, as specified in the profile (.prf) fie? There are so many things that can be overridden, I thought that this might be possible. but I can't find it in the user manual. > > Yes: the "servercmd" option. > > > Cheers, > > -- > St?phane From andrex at utexas.edu Sun Aug 30 11:13:04 2020 From: andrex at utexas.edu (Andrew Schulman) Date: Sun, 30 Aug 2020 11:13:04 -0400 Subject: [Unison-hackers] OCaml version mismatch breaks Unison 2.48.4 Message-ID: <22fnkfd80djs5gh3fg2nvbfcg2gs8ck31f@4ax.com> Hi. For years I've been syncing my Cygwin and Ubuntu hosts, using Unison 2.48.4. It worked fine. Now I've just upgraded Ubuntu to Focal (20.04). It still has Unison 2.48.4, but syncing now fails with the dreaded Fatal error: Fatal error during unmarshaling (input_value: ill-formed message), possibly because client and server have been compiled with differentversions of the OCaml compiler. How can I solve this? * In Ubuntu, the only Unison package is 2.48.4, compiled apparently with OCaml 4.08.1. * In Cygwin, the existing 2.48.4 package was built several years ago, probably with OCaml 4.01. The current OCaml in Cygwin is 4.10.0, but when I try to compile Unison 2.48.4 with that, the build fails almost immediately: $ cygport unison.cygport make >>> Compiling unison2.48-2.48.4-2.x86_64 UISTYLE = text Building for Unix NATIVE = true THREADS = false STATIC = false OSTYPE = cygwin OSARCH = Cygwin ocamlopt: unicode.ml ---> unicode.cmx ocamlopt -g -I lwt -I ubase -I system -I fsmonitor -I fsmonitor/linux -I fsmonitor/windows -I system/generic -I lwt/generic -c unison2.48-2.48.4-2.x86_64/build/unicode.ml File "unison2.48-2.48.4-2.x86_64/build/unicode.ml", line 25, characters 16-33: 25 | let set s i v = String.unsafe_set s i (Char.unsafe_chr v) ^^^^^^^^^^^^^^^^^ Alert deprecated: Stdlib.String.unsafe_set File "unison2.48-2.48.4-2.x86_64/build/unicode.ml", line 822, characters 20-21: 822 | String.blit s k s (k + d) (i - k); ^ Error: This expression has type string but an expression was expected of type bytes make: *** [Makefile.OCaml:435: unicode.cmx] Error 2 It seems that I need either: * A patch to allow Unison 2.48.4 to build with OCaml 4.10, or * An OCaml 4.08 package for Cygwin, so I can try to build Unison with that. 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. Thanks! Andrew From steph at glondu.net Mon Aug 31 01:41:47 2020 From: steph at glondu.net (=?UTF-8?Q?St=c3=a9phane_Glondu?=) Date: Mon, 31 Aug 2020 07:41:47 +0200 Subject: [Unison-hackers] OCaml version mismatch breaks Unison 2.48.4 In-Reply-To: <22fnkfd80djs5gh3fg2nvbfcg2gs8ck31f@4ax.com> References: <22fnkfd80djs5gh3fg2nvbfcg2gs8ck31f@4ax.com> Message-ID: <0265c23f-c4c1-1af5-bfc9-3da59c7446ab@glondu.net> Le 30/08/2020 ? 17:13, Andrew Schulman a ?crit?: > Hi. For years I've been syncing my Cygwin and Ubuntu hosts, using Unison 2.48.4. > It worked fine. Now I've just upgraded Ubuntu to Focal (20.04). It still has > Unison 2.48.4, but syncing now fails with the dreaded > > Fatal error: Fatal error during unmarshaling (input_value: ill-formed message), > possibly because client and server have been compiled with differentversions of > the OCaml compiler. > > How can I solve this? > > * In Ubuntu, the only Unison package is 2.48.4, compiled apparently with OCaml > 4.08.1. > > * In Cygwin, the existing 2.48.4 package was built several years ago, probably > with OCaml 4.01. The current OCaml in Cygwin is 4.10.0, but when I try to > compile Unison 2.48.4 with that, the build fails almost immediately: > [...] > > 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.) > * 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). > 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. Cheers, -- St?phane From andrex at utexas.edu Mon Aug 31 09:08:06 2020 From: andrex at utexas.edu (Andrew Schulman) Date: Mon, 31 Aug 2020 09:08:06 -0400 Subject: [Unison-hackers] OCaml version mismatch breaks Unison 2.48.4 References: <22fnkfd80djs5gh3fg2nvbfcg2gs8ck31f@4ax.com> <0265c23f-c4c1-1af5-bfc9-3da59c7446ab@glondu.net> Message-ID: 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 From steph at glondu.net Mon Aug 31 09:27:58 2020 From: steph at glondu.net (=?UTF-8?Q?St=c3=a9phane_Glondu?=) Date: Mon, 31 Aug 2020 15:27:58 +0200 Subject: [Unison-hackers] OCaml version mismatch breaks Unison 2.48.4 In-Reply-To: References: <22fnkfd80djs5gh3fg2nvbfcg2gs8ck31f@4ax.com> <0265c23f-c4c1-1af5-bfc9-3da59c7446ab@glondu.net> Message-ID: <6b2569ec-c894-f918-22eb-2c755d0876d5@glondu.net> Andrew, Le 31/08/2020 ? 15:08, Andrew Schulman a ?crit?: >>> 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. It will work with OCaml 4.08.1, but not with OCaml 4.10.x. > 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. This was done also in Debian/Ubuntu, until we realized Unison was dependent of the OCaml version too. Now, what I will do (I am the Unison maintainer in Debian) is embed the OCaml version in the package name (e.g. unison-2.52+4.08.1) so that one can have many combinations co-installed... but there will always be a single OCaml version in the official Debian archive for a given suite. > 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. It is because Unison uses OCaml's built-in marshalling, which used to be compatible across OCaml versions, but is not any more (and OCaml itself doesn't want to guarantee it). I am working on using different marshalling, which should make Unison independent of the version of OCaml used to compile it... but for now I'm focusing on making a new release that compiles out-of-the box with modern versions of OCaml. Cheers, -- St?phane From andrex at utexas.edu Mon Aug 31 10:29:33 2020 From: andrex at utexas.edu (Andrew Schulman) Date: Mon, 31 Aug 2020 10:29:33 -0400 Subject: [Unison-hackers] OCaml version mismatch breaks Unison 2.48.4 References: <22fnkfd80djs5gh3fg2nvbfcg2gs8ck31f@4ax.com> <0265c23f-c4c1-1af5-bfc9-3da59c7446ab@glondu.net> <6b2569ec-c894-f918-22eb-2c755d0876d5@glondu.net> Message-ID: <712qkf99fo5vjp0qkii41u6ig33osg0499@4ax.com> > > 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. > > This was done also in Debian/Ubuntu, until we realized Unison was > dependent of the OCaml version too. > > Now, what I will do (I am the Unison maintainer in Debian) is embed the > OCaml version in the package name (e.g. unison-2.52+4.08.1) so that one > can have many combinations co-installed... but there will always be a > single OCaml version in the official Debian archive for a given suite. > > > 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. > > It is because Unison uses OCaml's built-in marshalling, which used to be > compatible across OCaml versions, but is not any more (and OCaml itself > doesn't want to guarantee it). I am working on using different > marshalling, which should make Unison independent of the version of > OCaml used to compile it... but for now I'm focusing on making a new > release that compiles out-of-the box with modern versions of OCaml. Thank you St?phane, this is very helpful. At least I can explain it to the Cygwin users. For now I'm just going to update our unison2.48 package by rebuilding it with OCaml 4.08.1, but I can see that we may need a more general approach. Too bad about the OCaml problem. I hope you're able to fix the marshalling - I'm definitely not the right person for that. Thank you for your work on Unison! Andrew