From d9e76ea9c72edd65c0c0014ff5fc1a524fca0542 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?T=C3=B5ivo=20Leedj=C3=A4rv?= Date: Mon, 29 Apr 2024 21:47:00 +0200 Subject: [PATCH 1/3] GHA: Remove testing against 2.48 This does not (yet) mean that compatibility with 2.48 is intentionally broken. The testing is currently doing little more than waste resources. --- .github/workflows/CI.yml | 325 --------------------------------------- 1 file changed, 325 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 9cee87a3a..20daaad95 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -399,7 +399,6 @@ jobs: - { os: ubuntu-22.04 , ocaml-version: 4.14.x , ref: v2.51.5 , oldmake: true } - { os: ubuntu-22.04 , ocaml-version: 4.08.x , ref: v2.51.5 , oldmake: true } - { os: ubuntu-22.04 , ocaml-version: 4.08.x , ref: v2.51.2 , oldmake: true } - - { os: ubuntu-22.04 , ocaml-version: 4.08.x , ref: 2.48.4 , oldmake: true } - { os: windows-2019 , ocaml-version: ocaml-variants.4.14.0+mingw64c , ref: v2.53.4 } - { os: windows-2019 , ocaml-version: ocaml-variants.4.14.0+mingw64c , ref: v2.52.1 , oldmake: true } - { os: windows-2019 , ocaml-version: ocaml-variants.4.08.1+mingw32c , ref: v2.51.5 , oldmake: true } @@ -436,62 +435,6 @@ jobs: with: path: _new - - name: "2.48: Patch tests in _new" - if: contains(matrix.job.ref, '2.48') - shell: bash - run: | - # 'atomic' was introduced in 2.51.0 - cd _new && git apply - <<"EOF" - diff --git a/src/test.ml b/src/test.ml - index 60ccd05..45395e5 100644 - --- a/src/test.ml - +++ b/src/test.ml - @@ -351,43 +351,6 @@ let test() = - ) - done; - - - (* Test that .git is treated atomically. *) - - runtest "Atomicity of certain directories 1" ["atomic = Name .git"; - - "force = newer"] (fun() -> - - let orig = (Dir ["foo", Dir [".git", Dir ["a", File "foo"; - - "b", File "bar"; - - "c", File "baz"]]]) in - - put R1 orig; - - Unix.sleep 2; (* in case time granularity is coarse on this FS *) - - put R2 orig; sync(); - - let expected = (Dir ["foo", Dir [".git", Dir ["a", File "modified on R1"; - - "b", File "bar"; - - "c", File "modified on R1"]]]) in - - put R2 (Dir ["foo", Dir [".git", - - Dir ["a", File "foo"; - - "b", File "modified on R2"; - - "c", File "modified on R2"]]]); - - Unix.sleep 2; - - put R1 expected; - - sync (); - - check "1" R2 expected; - - check "2" R1 expected - - ); - - - - runtest "Atomicity of certain directories 2" ["atomic = Name .git"] (fun() -> - - let a = (Dir ["foo", Dir [".git", Dir ["a", File "foo"; - - "b", File "bar"; - - "c", File "baz"; - - "d", File "quux"]]]) in - - let b = (Dir ["foo", Dir [".git", Dir ["a", File "foo"; - - "b", File "bar"; - - "c", File "baz"; - - "e", File "quux"]]]) in - - put R1 a; put R2 b; sync(); - - check "1" R1 a; - - check "2" R2 b - - ); - - - (* Check for the bug reported by Ralf Lehmann *) - if not bothRootsLocal then - runtest "backups 1 (remote)" ["backup = Name *"] (fun() -> - EOF - - run: cd _new && opam exec -- make tui shell: bash @@ -501,260 +444,6 @@ jobs: ref: "${{ matrix.job.ref }}" path: _prev - - name: "2.48: Patch tests in _prev" - if: contains(matrix.job.ref, '2.48') - shell: bash - run: | - cd _prev && git apply - <<"EOF" - diff --git a/src/test.ml b/src/test.ml - index 6e8f943c..6c0bbded 100644 - --- a/src/test.ml - +++ b/src/test.ml - @@ -324,7 +324,7 @@ let test() = - - (* Check for the bug reported by Ralf Lehmann *) - if not bothRootsLocal then - - runtest "backups 1 (remote)" ["backup = Name *"] (fun() -> - + runtest "backups 1 (remote)" ["backup = Name *"; "fastcheck = false"] (fun() -> - put R1 (Dir []); put R2 (Dir []); sync(); - debug (fun () -> Util.msg "First check\n"); - checkmissing "1" BACKUP1; - @@ -370,7 +370,6 @@ let test() = - check "4" R2 (Dir ["x", File "foo"]); - ); - - - (raise (Util.Fatal "Skipping some tests -- remove me!\n") : unit); - - if bothRootsLocal then - runtest "backups 1 (local)" ["backup = Name *"] (fun() -> - @@ -397,12 +397,12 @@ let test() = - check "1" R2 (Dir [(".bak.0.x", File "foo"); (".bak.0.d", Dir [("a", File "barr")])]); - ); - - - runtest "backups 2a" ["backup = Name *"; "backuplocation = local"] (fun() -> - + runtest "backups 2a" ["backup = Name *"; "backuplocation = local"; "fastcheck = false"] (fun() -> - put R1 (Dir []); put R2 (Dir []); sync(); - (* Create a file and a directory *) - put R1 (Dir ["foo", File "1"]); sync(); - check "1" R1 (Dir [("foo", File "1")]); - - check "2" R1 (Dir [("foo", File "1")]); - + check "2" R2 (Dir [("foo", File "1")]); - put R1 (Dir ["foo", File "2"]); sync(); - check "3" R1 (Dir [("foo", File "2")]); - check "4" R2 (Dir [("foo", File "2"); (".bak.0.foo", File "1")]); - @@ -487,6 +486,77 @@ let test() = - ); - end; - - + if not bothRootsLocal then - + begin - + let localR, remoteR, localRaw = - + match r1 with - + | Common.Local, _ -> R1, R2, r1 - + | _ -> R2, R1, r2 - + in - + - + (* Test RPC function "fingerprintSubfile" *) - + runtest "RPC: transfer append" [] (fun () -> - + let prefixLen = 1024 * 1024 + 1 in - + let len = prefixLen + 31 in - + let contents = String.make len '.' in - + let fileName = "bigfile" in - + let prefixPath = Path.fromString fileName in - + let (workingDir, _) = Fspath.findWorkingDir (snd localRaw) prefixPath in - + let prefixName = Path.toString (Os.tempPath ~fresh:false workingDir prefixPath) in - + put remoteR (Dir [(fileName, File contents)]); - + put localR (Dir [(prefixName, File (String.sub contents 0 prefixLen))]); - + sync (); - + check "1" localR (Dir [(fileName, File contents)]); - + ); - + - + (* Test RPC function "updateProps" *) - + runtest "RPC: update props" ["times = true"] (fun () -> - + let state = [("a", File "x")] in - + put remoteR (Dir state); - + put localR (Dir []); - + sync (); - + (* Having to sleep here is an unfortunate side-effect of the current - + Windows limitations-inspired time comparison algorithm which is - + designed to work on FAT filesystems (2-second granularity). *) - + Unix.sleep 2; - + put remoteR (Dir state); - + sync (); - + check "1" localR (Dir state); - + ); - + - + (* Test RPC function "replaceArchive" *) - + runtest "RPC: replaceArchive" [] (fun () -> - + put localR (Dir [("n", File "to delete")]); - + put remoteR (Dir []); - + sync (); - + put remoteR (Dir []); - + sync (); - + check "1" localR (Dir []); - + ); - + - + (* Test RPC functions "mkdir" and "setDirProp" *) - + runtest "RPC: mkdir, setDirProp" [] (fun () -> - + let state = [("subd", Dir [])] in - + put localR (Dir state); - + put remoteR (Dir []); - + sync (); - + check "1" remoteR (Dir state); - + ); - + - + (* Test RPC function "setupTargetPaths" *) - + runtest "RPC: merge" ["merge = Name ma -> echo x> NEW"; "backupcurr = Name ma"; "fastcheck = false"] (fun () -> - + let result = match Sys.os_type with - + | "Win32" -> ("ma", File "x\r\n") - + | _ -> ("ma", File "x\n") - + in - + put localR (Dir [("ma", File "a")]); - + put remoteR (Dir [("ma", File "b")]); - + sync (); - + check "1" localR (Dir [result]); - + check "2" remoteR (Dir [result]); - + ); - + end; - + - if !failures = 0 then - Util.msg "Success :-)\n" - else - EOF - - - name: "2.48: Patch bugs in _prev" - if: contains(matrix.job.ref, '2.48') - shell: bash - run: | - cd _prev && git apply - <<"EOF" - diff --git a/src/bytearray_stubs.c b/src/bytearray_stubs.c - index 1ec18aef..664e3d96 100644 - --- a/src/bytearray_stubs.c - +++ b/src/bytearray_stubs.c - @@ -9,7 +9,7 @@ - CAMLprim value ml_marshal_to_bigarray(value v, value flags) - { - char *buf; - - long len; - + intnat len; - output_value_to_malloc(v, flags, &buf, &len); - return alloc_bigarray(BIGARRAY_UINT8 | BIGARRAY_C_LAYOUT | BIGARRAY_MANAGED, - 1, buf, &len); - EOF - - - name: "2.48: Patch _prev for mingw compilers" - if: contains(matrix.job.ref, '2.48') - shell: bash - run: | - cd _prev && git apply --ignore-whitespace - <<"EOF" - diff --git a/src/Makefile.OCaml b/src/Makefile.OCaml - index 21610ce6..4d605bbd 100644 - --- a/src/Makefile.OCaml - +++ b/src/Makefile.OCaml - @@ -104,8 +104,8 @@ CAMLFLAGS+=-I system/$(SYSTEM) -I lwt/$(SYSTEM) - ifeq ($(OSARCH),win32) - # Win32 system - EXEC_EXT=.exe - - OBJ_EXT=.obj - - OUTPUT_SEL=/Fo - + OBJ_EXT=.o - + OUTPUT_SEL=-o - CWD=. - # Fix suggested by Karl M, Jan 2009: - # "The new flexlink wrapper that OCaml 3.11 uses was gagging on the res - @@ -117,8 +117,6 @@ ifeq ($(OSARCH),win32) - COBJS+=system/system_win_stubs$(OBJ_EXT) lwt/lwt_unix_stubs$(OBJ_EXT) - WINOBJS=system/system_win.cmo - SYSTEM=win - - CLIBS+=-cclib "-link win32rc/unison.res" shell32.lib - - STATICLIBS+=-cclib "-link win32rc/unison.res" shell32.lib - buildexecutable:: - @echo Building for Windows - else - diff --git a/src/lwt/lwt_unix_stubs.c b/src/lwt/lwt_unix_stubs.c - index aa85e5bb..3717ddc2 100644 - --- a/src/lwt/lwt_unix_stubs.c - +++ b/src/lwt/lwt_unix_stubs.c - @@ -79,6 +79,7 @@ static value completionCallback; - - static void invoke_completion_callback - (long id, long len, long errCode, long action) { - + CAMLparam0(); - CAMLlocal2 (err, name); - value args[4]; - err = Val_long(0); - EOF - - - name: "2.48: Patch _prev for newer compilers/OS" - if: contains(matrix.job.ref, '2.48') && matrix.job.ocaml-version >= '4.03' - shell: bash - run: | - cd _prev && git apply - <<"EOF" - diff --git a/src/Makefile.OCaml b/src/Makefile.OCaml - index 21610ce6..75499079 100644 - --- a/src/Makefile.OCaml - +++ b/src/Makefile.OCaml - @@ -95,7 +95,7 @@ buildexecutable:: - ### Default parameters - - # Generate backtrace information for exceptions - -CAMLFLAGS+=-g - +CAMLFLAGS+=-g -unsafe-string - - INCLFLAGS=-I lwt -I ubase -I system - CAMLFLAGS+=$(INCLFLAGS) - @@ -187,7 +187,7 @@ endif - endif - endif - - -MINOSXVERSION=10.5 - +MINOSXVERSION=10.7 - # XCODEFLAGS=-sdk macosx$(MINOSXVERSION) - ifeq ($(OSARCH),osx) - CAMLFLAGS+=-ccopt -mmacosx-version-min=$(MINOSXVERSION) - diff --git a/src/files.ml b/src/files.ml - index ba42ad57..5babf21e 100644 - --- a/src/files.ml - +++ b/src/files.ml - @@ -722,7 +722,7 @@ let get_files_in_directory dir = - with End_of_file -> - dirh.System.closedir () - end; - - Sort.list (<) !files - + List.sort String.compare !files - - let ls dir pattern = - Util.convertUnixErrorsToTransient - diff --git a/src/recon.ml b/src/recon.ml - index 5ed358d7..0df2cfe4 100644 - --- a/src/recon.ml - +++ b/src/recon.ml - @@ -651,8 +651,8 @@ let rec reconcile - - (* Sorts the paths so that they will be displayed in order *) - let sortPaths pathUpdatesList = - - Sort.list - - (fun (p1, _) (p2, _) -> Path.compare p1 p2 <= 0) - + List.sort - + Path.compare - pathUpdatesList - - let rec enterPath p1 p2 t = - diff --git a/src/system/system_generic.ml b/src/system/system_generic.ml - index 9230cdc1..140bd849 100755 - --- a/src/system/system_generic.ml - +++ b/src/system/system_generic.ml - @@ -47,7 +47,7 @@ let open_out_gen = open_out_gen - let chmod = Unix.chmod - let chown = Unix.chown - let utimes = Unix.utimes - -let link = Unix.link - +let link x y = Unix.link x y - let openfile = Unix.openfile - let opendir f = - let h = Unix.opendir f in - EOF - - name: "2.51.0: Patch connection header in _prev" if: contains(matrix.job.ref, '2.51.0') shell: bash @@ -1039,21 +728,7 @@ jobs: sleep 1 # Wait for the server to be fully started _new/src/unison -ui text -selftest testr_c socket://127.0.0.1:55443/testr_s -killserver - - name: "2.48: Run self-tests over RPC - prev client to new server" - if: contains(matrix.job.ref, '2.48') - env: - UNISON: test2 - shell: bash - run: | - cp _new/src/unison _new/src/unison-2.48 - # Separate backup dir must be set for server instance so that the central - # backup location of both instances doesn't overlap - UNISONBACKUPDIR=./_new/src/testbak_s _new/src/unison-2.48 -socket 55443 & - sleep 1 # Wait for the server to be fully started - _prev/src/unison -ui text -selftest testr_c socket://127.0.0.1:55443/testr_s -killserver - - name: Run self-tests over RPC - prev client to new server - if: ${{ !contains(matrix.job.ref, '2.48') }} env: UNISON: test2 shell: bash From 0260ddfbeb2be0e89f4431198bd3ac733f4508f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?T=C3=B5ivo=20Leedj=C3=A4rv?= Date: Sun, 2 Jun 2024 20:29:06 +0200 Subject: [PATCH 2/3] GHA: Update ABI testing to latest version --- .github/workflows/CI.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 20daaad95..19b357be4 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -393,16 +393,16 @@ jobs: # This list is intended to balance good enough coverage and # limited resource usage. job: - - { os: ubuntu-22.04 , ocaml-version: 5.1.x , ref: v2.53.4 } - - { os: ubuntu-22.04 , ocaml-version: 4.14.x , ref: v2.53.4 } + - { os: ubuntu-22.04 , ocaml-version: 5.1.x , ref: v2.53.5 } + - { os: ubuntu-22.04 , ocaml-version: 4.14.x , ref: v2.53.5 } - { os: ubuntu-22.04 , ocaml-version: 4.14.x , ref: v2.52.1 , oldmake: true } - { os: ubuntu-22.04 , ocaml-version: 4.14.x , ref: v2.51.5 , oldmake: true } - { os: ubuntu-22.04 , ocaml-version: 4.08.x , ref: v2.51.5 , oldmake: true } - { os: ubuntu-22.04 , ocaml-version: 4.08.x , ref: v2.51.2 , oldmake: true } - - { os: windows-2019 , ocaml-version: ocaml-variants.4.14.0+mingw64c , ref: v2.53.4 } + - { os: windows-2019 , ocaml-version: ocaml-variants.4.14.0+mingw64c , ref: v2.53.5 } - { os: windows-2019 , ocaml-version: ocaml-variants.4.14.0+mingw64c , ref: v2.52.1 , oldmake: true } - { os: windows-2019 , ocaml-version: ocaml-variants.4.08.1+mingw32c , ref: v2.51.5 , oldmake: true } - - { os: macos-12 , ocaml-version: 4.14.x , ref: v2.53.4 } + - { os: macos-12 , ocaml-version: 4.14.x , ref: v2.53.5 } - { os: macos-12 , ocaml-version: 4.14.x , ref: v2.52.1 , oldmake: true } - { os: macos-12 , ocaml-version: 4.08.x , ref: v2.51.2 , oldmake: true } From f189d20573a4fc6f841b64e6136065f3dabb438f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?T=C3=B5ivo=20Leedj=C3=A4rv?= Date: Sun, 2 Jun 2024 20:31:34 +0200 Subject: [PATCH 3/3] GHA: OCaml 5.1.1 -> 5.2.0 --- .github/workflows/CI.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 19b357be4..73d6d7de6 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -57,10 +57,10 @@ jobs: fail-fast: false matrix: job: - - { os: macos-14 , ocaml-version: "5.1.1+options,ocaml-option-no-compression" } + - { os: macos-14 , ocaml-version: 5.2.0 } - { os: macos-14 , ocaml-version: 4.14.2 , publish: true , fnsuffix: -macos-arm64 } - { os: macos-12 , ocaml-version: 4.14.2 , publish: true , fnsuffix: -macos-x86_64 } - - { os: ubuntu-22.04 , ocaml-version: "5.1.1+options,ocaml-option-no-compression" } + - { os: ubuntu-22.04 , ocaml-version: 5.2.0 } - { os: ubuntu-22.04 , ocaml-version: 4.14.2 } - { os: ubuntu-20.04 , ocaml-version: 4.14.2 } - { os: windows-2022 , ocaml-version: 4.14.0+mingw64c , publish: true , fnsuffix: -windows-x86_64 } @@ -393,7 +393,7 @@ jobs: # This list is intended to balance good enough coverage and # limited resource usage. job: - - { os: ubuntu-22.04 , ocaml-version: 5.1.x , ref: v2.53.5 } + - { os: ubuntu-22.04 , ocaml-version: 5.2.x , ref: v2.53.5 } - { os: ubuntu-22.04 , ocaml-version: 4.14.x , ref: v2.53.5 } - { os: ubuntu-22.04 , ocaml-version: 4.14.x , ref: v2.52.1 , oldmake: true } - { os: ubuntu-22.04 , ocaml-version: 4.14.x , ref: v2.51.5 , oldmake: true }