Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore compatibility with 2.48 #628

Merged
merged 2 commits into from Feb 18, 2022

Conversation

tleedjarv
Copy link
Contributor

@tleedjarv tleedjarv commented Feb 4, 2022

Description

Many users are still using Unison 2.48 and are unable to upgrade. This patch provides a best effort compatibility with 2.48. Even though there is no indication that interop with 2.48 clients and servers would not work, there are no guarantees of success. If it doesn't work, however, it is very unlikely to result in data loss or corruption.

With this patch, a single Unison version will be able to interoperate with 2.48, 2.51 and the future releases. It is also able to upgrade from 2.48 without needing to rescan the replicas.

Support for 2.48 is provided according the the table below. OCaml versions must still match.

Server
2.48With this PR
Client2.48OK, nativeSpecial setup is needed, see below
With this PROK, automaticallyOK, automatically

Server for 2.48 clients

Server support for 2.48 clients is not fully automatic. For the server to support 2.48 clients, the executable must be named with unison-2.48 prefix. Only the prefix matters. The full executable name could be unison-2.48.exe or unison-2.48-but-actually-2.52 or whatever you like. By using the name unison-2.48 there is the benefit of being able to use the -addversionno preference on the client (relevant only for SSH connections). With other names, use the -servercmd preference on client (relevant only for SSH connections).

A socket server started this way is able to serve 2.48 clients and any clients with this PR or with #626 but not 2.51 clients.

Notes on OCaml compiler version

It is possible to see the OCaml version used to compile Unison by executing unison -version. 2.48 did not display the OCaml version this way and it can be a bit difficult to find out the version. The easiest way is to see what is the ocaml package version in the same package repository where you got unison package from (hint, for Linux distributions, the typical version is 4.05). If that's not possible then the other way is trying your way through various versions (take this patch compiled with 4.05 and try, then compiled with another version and try and so on).

Testing

Volunteer testing is expected of users who would like to use this patch.

@gdt
Copy link
Collaborator

gdt commented Feb 6, 2022

Given the number of people who seem stuck on 2.48, surely there will be testers.

I just sent a message to unison-hackers@ asking for testing. I'fter umarshalis merged and probably released in an alpha. and we can rebase this and I'll followup to -users@

It is not needed on the server. Making it a local preference improves
backwards compatibility.
It turns out that given matching (or similar) OCaml versions, there is
compatibility between 2.51 and 2.48; the only real obstacle is the
connection header string which differs.

This patch provides mostly automatic backwards compatibility with 2.48
by 1) as a client, detecting the 2.48 header string; and 2) as a server,
outputting the 2.48 connection header string when in compatibility mode
and the executable name is "unison-2.48". The latter is the expected
executable name when the client uses the "-addversionno" preference.
Otherwise, when in compatibility mode, the server will output the 2.51
connection header string.
@gdt gdt merged commit 0fb477c into bcpierce00:master Feb 18, 2022
@tleedjarv tleedjarv deleted the umarshal-2.48-compat branch February 18, 2022 18:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants