Skip to content

Fix a couple of issues when compiling with future versions of dependencies #6391

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 1, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ DUNE_IU_PACKAGES1+=message-switch message-switch-cli message-switch-core message
DUNE_IU_PACKAGES1+=message-switch-unix xapi-idl xapi-forkexecd xapi-storage xapi-storage-script xapi-storage-cli
DUNE_IU_PACKAGES1+=xapi-nbd varstored-guard xapi-log xapi-open-uri xapi-tracing xapi-tracing-export xapi-expiry-alerts cohttp-posix
DUNE_IU_PACKAGES1+=xapi-rrd xapi-inventory clock xapi-sdk
DUNE_IU_PACKAGES1+=xapi-stdext-date xapi-stdext-encodings xapi-stdext-pervasives xapi-stdext-std xapi-stdext-threads xapi-stdext-unix xapi-stdext-zerocheck xapi-tools
DUNE_IU_PACKAGES1+=xapi-stdext-encodings xapi-stdext-pervasives xapi-stdext-std xapi-stdext-threads xapi-stdext-unix xapi-stdext-zerocheck xapi-tools


install-dune1:
Expand Down
10 changes: 0 additions & 10 deletions dune-project
Original file line number Diff line number Diff line change
Expand Up @@ -669,16 +669,6 @@ This package provides an Lwt compatible interface to the library.")
(name xapi-inventory)
)

(package
(name xapi-stdext-date)
(synopsis "Xapi's standard library extension, Dates")
(authors "Jonathan Ludlam")
(depends
(clock (= :version))
ptime
)
)

(package
(name xapi-stdext-encodings)
(synopsis "Xapi's standard library extension, Encodings")
Expand Down
1 change: 1 addition & 0 deletions ocaml/libs/resources/test/dune
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
(action (run %{test} -e))
(libraries
safe-resources
logs
logs.fmt
alcotest
)
Expand Down
35 changes: 0 additions & 35 deletions ocaml/libs/xapi-stdext/lib/xapi-stdext-date/date.ml

This file was deleted.

115 changes: 0 additions & 115 deletions ocaml/libs/xapi-stdext/lib/xapi-stdext-date/date.mli

This file was deleted.

6 changes: 0 additions & 6 deletions ocaml/libs/xapi-stdext/lib/xapi-stdext-date/dune

This file was deleted.

4 changes: 3 additions & 1 deletion ocaml/libs/xapi-stdext/lib/xapi-stdext-threads/ipq.ml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ type 'a t = {default: 'a event; mutable size: int; mutable data: 'a event array}

exception EmptyHeap

exception OutOfBounds of int

let create n default =
if n <= 0 then
invalid_arg "create"
Expand Down Expand Up @@ -61,7 +63,7 @@ let maximum h =
let remove h s =
if h.size <= 0 then raise EmptyHeap ;
if s < 0 || s >= h.size then
invalid_arg (Printf.sprintf "%s: index %d out of bounds" __FUNCTION__ s) ;
raise (OutOfBounds s) ;
let n = h.size - 1 in
let d = h.data in
let x = d.(n) in
Expand Down
2 changes: 2 additions & 0 deletions ocaml/libs/xapi-stdext/lib/xapi-stdext-threads/ipq.mli
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ type 'a t

exception EmptyHeap

exception OutOfBounds of int

val create : int -> 'a -> 'a t
(** [create n default] creates an empty Imperative priority queue.
The queue initially is initialized to store [n] elements.
Expand Down
9 changes: 2 additions & 7 deletions ocaml/libs/xapi-stdext/lib/xapi-stdext-threads/ipq_test.ml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,9 @@ module Ipq = Xapi_stdext_threads_scheduler.Ipq
let test_out_of_index () =
let q = Ipq.create 10 0 in
Ipq.add q {Ipq.ev= 123; Ipq.time= Mtime_clock.elapsed ()} ;
let is_oob = function
| Invalid_argument s when String.ends_with ~suffix:" out of bounds" s ->
true
| _ ->
false
in
let oob_check n =
(Alcotest.match_raises "out of bound" is_oob @@ fun () -> Ipq.remove q n) ;
let oob = Ipq.OutOfBounds n in
(Alcotest.check_raises "out of bound" oob @@ fun () -> Ipq.remove q n) ;
Alcotest.(check bool) "same value" false (Ipq.is_empty q)
in
oob_check 10 ;
Expand Down
29 changes: 0 additions & 29 deletions xapi-stdext-date.opam

This file was deleted.

Loading