From e9d3e672e581abd8aacf2f257fb5f9a51af0dc8a Mon Sep 17 00:00:00 2001 From: Jay Xu Date: Tue, 14 Oct 2025 09:51:56 +0800 Subject: [PATCH 1/2] fix cmdliner 2.0.0 --- dune-project | 2 +- lib/olly_common/cli.ml | 13 +++++++------ runtime_events_tools.opam | 2 +- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/dune-project b/dune-project index f07350c..d9e80ba 100644 --- a/dune-project +++ b/dune-project @@ -18,7 +18,7 @@ (depends (ocaml (>= "5.0.0~")) hdr_histogram - (cmdliner (>= 1.1.0)) + (cmdliner (>= 2.0.0)) (trace-fuchsia (>= 0.10)) (trace (>= 0.10)) (menhir :with-test) diff --git a/lib/olly_common/cli.ml b/lib/olly_common/cli.ml index 20d91a5..b9d743f 100644 --- a/lib/olly_common/cli.ml +++ b/lib/olly_common/cli.ml @@ -20,14 +20,15 @@ let help man_format cmds topic = | None -> `Help (`Pager, None) (* help about the program. *) | Some topic -> ( let topics = "topics" :: cmds in - let conv, _ = Cmdliner.Arg.enum (List.rev_map (fun s -> (s, s)) topics) in - match conv topic with - | `Error e -> `Error (false, e) - | `Ok t when t = "topics" -> + let conv = Cmdliner.Arg.enum (List.rev_map (fun s -> (s, s)) topics) in + let parse = Cmdliner.Arg.Conv.parser conv in + match parse topic with + | Error e -> `Error (false, e) + | Ok t when t = "topics" -> List.iter print_endline topics; `Ok () - | `Ok t when List.mem t cmds -> `Help (man_format, Some t) - | `Ok _t -> + | Ok t when List.mem t cmds -> `Help (man_format, Some t) + | Ok _t -> let page = ((topic, 7, "", "", ""), [ `S topic; `P "Say something" ]) in diff --git a/runtime_events_tools.opam b/runtime_events_tools.opam index 2641fd7..8ff0c27 100644 --- a/runtime_events_tools.opam +++ b/runtime_events_tools.opam @@ -12,7 +12,7 @@ depends: [ "dune" {>= "3.16"} "ocaml" {>= "5.0.0~"} "hdr_histogram" - "cmdliner" {>= "1.1.0"} + "cmdliner" {>= "2.0.0"} "trace-fuchsia" {>= "0.10"} "trace" {>= "0.10"} "menhir" {with-test} From d6aed82ffb5f19da3c5400f3611554adafbec975 Mon Sep 17 00:00:00 2001 From: Jay Xu Date: Thu, 12 Feb 2026 14:51:16 +0800 Subject: [PATCH 2/2] update `trace` and `trace-fuchsia` to 0.11 --- dune-project | 4 ++-- .../olly_format_backend/olly_format_fuchsia.ml | 12 ++++++------ runtime_events_tools.opam | 6 +++--- runtime_events_tools_bare.opam | 4 ++-- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/dune-project b/dune-project index 2599dd4..f1e1540 100644 --- a/dune-project +++ b/dune-project @@ -19,8 +19,8 @@ (ocaml (>= "5.0.0~")) hdr_histogram (cmdliner (>= 2.0.0)) - (trace-fuchsia (>= 0.10)) - (trace (>= 0.10)) + (trace-fuchsia (>= 0.11)) + (trace (>= 0.11)) (menhir :with-test) (ocamlformat (and :with-dev-setup (= 0.27.0))) (alcotest (and :with-test (>= 1.9.0))))) diff --git a/lib/olly_trace/olly_format_backend/olly_format_fuchsia.ml b/lib/olly_trace/olly_format_backend/olly_format_fuchsia.ml index c869caf..35dcfaf 100644 --- a/lib/olly_trace/olly_format_backend/olly_format_fuchsia.ml +++ b/lib/olly_trace/olly_format_backend/olly_format_fuchsia.ml @@ -8,7 +8,7 @@ module Trace = Trace_fuchsia.Writer type trace = { doms : Trace.Thread_ref.t array; buf : Trace_fuchsia.Buf_chain.t; - subscriber : Trace_fuchsia.Subscriber.t; + collector : Trace_fuchsia.Collector_fuchsia.t; exporter : Trace_fuchsia.Exporter.t; } @@ -22,22 +22,22 @@ let create ~filename = let buf = Trace_fuchsia.Buf_chain.create ~sharded:true ~buf_pool () in let oc = Out_channel.open_bin filename in let exporter = Trace_fuchsia.Exporter.of_out_channel ~close_channel:true oc in - let subscriber = - Trace_fuchsia.Subscriber.create ~buf_pool ~pid:0 ~exporter () + let collector = + Trace_fuchsia.Collector_fuchsia.create ~buf_pool ~pid:0 ~exporter () in (* Adds the headers to output *) - Trace_fuchsia.Subscriber.Callbacks.on_init subscriber ~time_ns:0L; + Trace_fuchsia.Collector_fuchsia.callbacks.init collector; let doms = let max_doms = 128 in Array.init max_doms (fun i -> (* Use a different pid for each domain *) Trace.Thread_ref.ref (i + 1)) in - { doms; buf; subscriber; exporter } + { doms; buf; collector; exporter } let close trace = flush trace; - Trace_fuchsia.Subscriber.close trace.subscriber + Trace_fuchsia.Collector_fuchsia.close trace.collector let emit trace evt = let open Event in diff --git a/runtime_events_tools.opam b/runtime_events_tools.opam index 22bbcb2..734c3ce 100644 --- a/runtime_events_tools.opam +++ b/runtime_events_tools.opam @@ -12,8 +12,8 @@ depends: [ "ocaml" {>= "5.0.0~"} "hdr_histogram" "cmdliner" {>= "2.0.0"} - "trace-fuchsia" {>= "0.10"} - "trace" {>= "0.10"} + "trace-fuchsia" {>= "0.11"} + "trace" {>= "0.11"} "menhir" {with-test} "ocamlformat" {with-dev-setup & = "0.27.0"} "alcotest" {with-test & >= "1.9.0"} @@ -35,4 +35,4 @@ build: [ ] dev-repo: "git+https://github.com/tarides/runtime_events_tools.git" x-maintenance-intent: ["(latest)"] -available: os != "win32" +available: os != "win32" \ No newline at end of file diff --git a/runtime_events_tools_bare.opam b/runtime_events_tools_bare.opam index 270fb84..61fb89b 100644 --- a/runtime_events_tools_bare.opam +++ b/runtime_events_tools_bare.opam @@ -11,7 +11,7 @@ bug-reports: "https://github.com/tarides/runtime_events_tools/issues" depends: [ "dune" {>= "3.18"} "ocaml" {>= "5.0.0~"} - "cmdliner" {>= "2.0.0"} + "cmdliner" {>= "1.1.0" & < "2.0"} "odoc" {with-doc} ] build: [ @@ -30,4 +30,4 @@ build: [ ] dev-repo: "git+https://github.com/tarides/runtime_events_tools.git" x-maintenance-intent: ["(latest)"] -available: os != "win32" +available: os != "win32" \ No newline at end of file