Skip to content

Commit 6ea2ff0

Browse files
smondetrr0gi
authored andcommitted
Improve ocaml-ci builds
- `String.starts_with` added in 4.13. - `__FUNCTION__` added in 4.12. - Force version of PCRE bindings (from 2020, OCaml 4.08). - Force version of Lwt (`Lwt.reraise` added in 5.7.0).
1 parent 1f3f7ed commit 6ea2ff0

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

devkit.opam

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ depends: [
1818
"camlzip"
1919
"libevent" {>= "0.8.0"}
2020
"ocurl" {>= "0.7.2"}
21-
"pcre"
21+
"pcre" {>= "7.4.6"}
2222
"trace" {>= "0.4"}
2323
"extunix" {>= "0.1.4"}
24-
"lwt" {>= "2.5.2"}
24+
"lwt" {>= "5.7.0"}
2525
"lwt_ppx"
2626
"base-bytes"
2727
"base-unix"

web.ml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ module Http (IO : IO_TYPE) (Curl_IO : CURL with type 'a t = 'a IO.t) : HTTP with
247247
(* Given a list of strings, check pre-existing entry starting with `~name`; and adds the concatenation of `~name` and `~value` if not. *)
248248
let add_if_absent ~name ~value strs =
249249
match strs with
250-
| Some strs when List.exists (StringLabels.starts_with ~prefix:(name^":")) strs -> strs
250+
| Some strs when List.exists (fun s -> Stre.starts_with s (name^":")) strs -> strs
251251
| Some strs -> (String.concat ": " [name; value]) :: strs
252252
| None -> [String.concat ": " [name; value]]
253253

@@ -301,7 +301,10 @@ module Http (IO : IO_TYPE) (Curl_IO : CURL with type 'a t = 'a IO.t) : HTTP with
301301
"url.full", `String url;
302302
]
303303
in
304-
let explicit_span = Possibly_otel.enter_manual_span ~__FUNCTION__ ~__FILE__ ~__LINE__ ~data:describe action_name in
304+
let explicit_span =
305+
(* We set the value of `__FUNCTION__` to preserve the build with OCaml < 4.12. *)
306+
Possibly_otel.enter_manual_span
307+
~__FUNCTION__:"Devkit.Web.Http.http_request'" ~__FILE__ ~__LINE__ ~data:describe action_name in
305308

306309
let headers = match Possibly_otel.Traceparent.get_ambient ~explicit_span () with
307310
| None -> headers

0 commit comments

Comments
 (0)