compatibility with lwt 6 (#128)

* compatibility with lwt 6

* try to work for lwt 5 and lwt 6

* CI: try lwt 5 then lwt 6

* only try lwt 6 on OCaml >= 5

* relax lwt bounds

* more robust dune rule

* CI

---------

Co-authored-by: Simon Cruanes <simon.cruanes.2007@m4x.org>
This commit is contained in:
Raphaël Proust 2026-03-13 20:17:09 +01:00 committed by GitHub
parent c0d949259f
commit 74022be198
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 27 additions and 4 deletions

View file

@ -42,10 +42,8 @@ jobs:
allow-prerelease-opam: true
- run: |
opam pin trace https://github.com/ocaml-tracing/ocaml-trace.git#main -y -n
opam pin https://github.com/ocaml-tracing/ambient-context.git#HEAD -y -n
opam install pbrt.4.0 -y
opam install ambient-context
opam install ambient-context lwt.5.9.2
# We cannot install packages that need eio on ocaml versions before 5
- run: |
@ -62,6 +60,11 @@ jobs:
- run: opam install trace
- run: opam exec -- dune build @install -p opentelemetry
- run: opam install lwt.6.1.1 -y
if: ${{ matrix.ocaml-compiler == '5.3.x' }}
- run: opam exec -- dune build @install -p opentelemetry,opentelemetry-client,opentelemetry-lwt,opentelemetry-client-cohttp-lwt
if: ${{ matrix.ocaml-compiler == '5.3.x' }}
- run: opam install ocaml-protoc
- run: opam exec -- dune build @lint

View file

@ -25,3 +25,19 @@
mtime.clock.os
lwt.unix)
(synopsis "Lwt-specific helpers for opentelemetry-client"))
(rule
(enabled_if
(and
%{lib-available:lwt}
(>= %{version:lwt} 6.0)))
(action
(copy types_.ml.6 types_.ml)))
(rule
(enabled_if
(and
%{lib-available:lwt}
(< %{version:lwt} 6.0)))
(action
(copy types_.ml.5 types_.ml)))

View file

@ -5,7 +5,7 @@ module IO = Io_lwt
type t = {
notified: bool Atomic.t;
cond: unit Lwt_condition.t;
notification: int;
notification: Types_.notification;
lwt_tid: int; (** thread ID where lwt runs *)
deleted: bool Atomic.t;
}

View file

@ -0,0 +1,2 @@
type notification = int

View file

@ -0,0 +1,2 @@
type notification = Lwt_unix.notification