diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 69194a46ccd..97e750708bc 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -17,7 +17,6 @@ jobs: matrix: os: - ubuntu-latest - packages: [ '.' ] ocaml-compiler: - 5.1.x @@ -30,33 +29,18 @@ jobs: git config --global core.eol lf - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Use OCaml ${{ matrix.ocaml-compiler }} uses: ocaml/setup-ocaml@v2 with: ocaml-compiler: ${{ matrix.ocaml-compiler }} - opam-local-packages: $${ matrix.opam-local-packages }} - opam-depext-flags: --with-test - - - name: Pin local packages - run: | - # Pin all local opam files to avoid internal conflicts - # - # TODO: replace with `opam pin --with-version` when Opam 2.1 is - # available via `setup-ocaml`. - find . -maxdepth 1 -name '*.opam' -printf '%P\n' |\ - cut -d. -f1 |\ - xargs -I{} -n 1 opam pin add {}.dev ./ -n - - - name: Install depexts - run: | - find . -maxdepth 1 -name '*.opam' -printf '%P\n' |\ - cut -d. -f1 |\ - xargs opam depext --update -y - name: Install Opam dependencies - run: opam install ${{ matrix.packages }} --with-test --deps-only + run: opam install . --with-test --deps-only + + - name: Build + run: opam exec -- dune build - name: Run tests with coverage instrumentation run: opam exec -- dune runtest --instrument-with bisect_ppx diff --git a/bench.Dockerfile b/bench.Dockerfile new file mode 100644 index 00000000000..1245344c244 --- /dev/null +++ b/bench.Dockerfile @@ -0,0 +1,11 @@ +FROM ocaml/opam:debian-ocaml-5.1 +RUN sudo ln -sf /usr/bin/opam-2.1 /usr/bin/opam +RUN mkdir bench-dir && chown opam:opam bench-dir +WORKDIR bench-dir +RUN sudo chown opam . +COPY *.opam ./ +RUN opam remote add origin https://github.com/ocaml/opam-repository.git && opam update +RUN opam pin -yn --with-version=dev . +RUN opam install -y --deps-only --with-test . +COPY . ./ +ENTRYPOINT opam exec -- make bench diff --git a/examples/dune b/examples/dune index 28f453fd479..60ceb8923fd 100644 --- a/examples/dune +++ b/examples/dune @@ -62,4 +62,15 @@ (mdx (files merkle_proofs.md) - (libraries irmin irmin-cli irmin-git.unix ppx_irmin)) + (deps %{bin:irmin}) + (libraries + irmin + irmin-cli + irmin-git + irmin-git.unix + eio + eio_main + eio.unix + lwt_eio) + (enabled_if + (<> %{model} "ppc64le"))) diff --git a/examples/merkle_proofs.md b/examples/merkle_proofs.md index 5c6c6000503..3ef39aefdfe 100644 --- a/examples/merkle_proofs.md +++ b/examples/merkle_proofs.md @@ -7,12 +7,12 @@ More specifically, for Irmin, a Merkle proof is the subset of a tree stored in a ### Setting up a Bank ```ocaml +# #require "eio_main";; # #require "digestif.ocaml";; # #require "checkseum.ocaml";; # #require "irmin";; # #require "irmin-git.unix";; # #require "ppx_irmin";; -# #require "eio_main";; ``` First, create an irmin-unix store module which uses `int` as contents. diff --git a/src/irmin-pack/io/store.ml b/src/irmin-pack/io/store.ml index 382c6cd8c40..bef47fe962a 100644 --- a/src/irmin-pack/io/store.ml +++ b/src/irmin-pack/io/store.ml @@ -293,9 +293,7 @@ struct | Some { gc; _ } -> if Atomic.get t.during_batch then Error `Gc_forbidden_during_batch - else - Eio.Mutex.use_rw ~protect:false t.lock @@ fun () -> - Gc.finalise ~wait gc + else Gc.finalise ~wait gc in match result with | Ok (`Finalised _ as x) -> @@ -319,7 +317,6 @@ struct match Atomic.get t.running_gc with | None | Some { use_auto_finalisation = false; _ } -> () | Some { use_auto_finalisation = true; _ } -> - Eio.Mutex.use_rw ~protect:true t.lock @@ fun () -> let _ = finalise_exn ~wait:false t in () diff --git a/src/libirmin/lib/dune b/src/libirmin/lib/dune index 5664d7a29ba..be7d224bbfa 100644 --- a/src/libirmin/lib/dune +++ b/src/libirmin/lib/dune @@ -14,11 +14,15 @@ (language c) (names irmin)) (flags - (:standard -w -unused-var-strict -ccopt "-Wl,-znow"))) + (:standard -w -unused-var-strict -ccopt "-Wl,-znow")) + (enabled_if + (<> %{ocaml_version} 5.2.0~alpha1))) (install (package libirmin) (section lib) (files (irmin.h as include/irmin.h) - (libirmin%{ext_dll} as lib/libirm%{ext_dll}))) + (libirmin%{ext_dll} as lib/libirm%{ext_dll})) + (enabled_if + (<> %{ocaml_version} 5.2.0~alpha1))) diff --git a/test/irmin-client/dune b/test/irmin-client/dune index e3734859743..c2c06c6e16a 100644 --- a/test/irmin-client/dune +++ b/test/irmin-client/dune @@ -8,4 +8,9 @@ websocket-lwt-unix conduit-lwt-unix irmin-test - irmin-watcher)) + irmin-watcher) + ; TODO: fix unix EMFILE error + (enabled_if + (and + (<> %{system} macosx) + (<> %{system} freebsd)))) diff --git a/test/irmin-pack/dune b/test/irmin-pack/dune index 6b3f9163392..87d5e3f31c9 100644 --- a/test/irmin-pack/dune +++ b/test/irmin-pack/dune @@ -48,7 +48,12 @@ ;; Attached to `irmin-tezos` to avoid a cyclic dependency with `irmin-pack` (package irmin-tezos) (action - (run ./test.exe -q --color=always))) + (run ./test.exe -q --color=always)) + ; TODO: Fix unix waitpid error in irmin-pack GC + (enabled_if + (and + (<> %{system} macosx) + (<> %{system} freebsd)))) (library (name common) diff --git a/test/irmin-tezos/dune b/test/irmin-tezos/dune index e716cc75ef5..1709b11f277 100644 --- a/test/irmin-tezos/dune +++ b/test/irmin-tezos/dune @@ -19,7 +19,11 @@ (deps (file irmin_fsck.exe) (file data) - (alias generate-cli-test-data))) + (alias generate-cli-test-data)) + (enabled_if + (and + (<> %{system} macosx) + (<> %{system} freebsd)))) ;FIXME: we should not depend on the version of cmdliner ;(rule diff --git a/test/libirmin/dune b/test/libirmin/dune index d71a6fa7822..e6f92990418 100644 --- a/test/libirmin/dune +++ b/test/libirmin/dune @@ -8,7 +8,9 @@ (setenv LD_LIBRARY_PATH ../../src/libirmin/lib - (run ./test.exe))))) + (run ./test.exe)))) + (enabled_if + (<> %{ocaml_version} 5.2.0~alpha1))) (rule (targets test.exe)