Jürgen Hötzel
2023-May-20 16:16 UTC
[Libguestfs] [libguestfs-common PATCH] Add support for OCaml 5.0
Pervasives is deprecated since Ocaml 4.08 and has been removed in OCaml 5.0. https://github.com/ocaml/ocaml/pull/1605 --- mlstdutils/std_utils.ml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mlstdutils/std_utils.ml b/mlstdutils/std_utils.ml index 0d2fa22..86b21a7 100644 --- a/mlstdutils/std_utils.ml +++ b/mlstdutils/std_utils.ml @@ -341,12 +341,12 @@ module List = struct | x::xs, y::ys, z::zs -> (x, y, z) :: combine3 xs ys zs | _ -> invalid_arg "combine3" - let rec assoc_lbl ?(cmp = Pervasives.compare) ~default x = function + let rec assoc_lbl ?(cmp = Stdlib.compare) ~default x = function | [] -> default | (y, y') :: _ when cmp x y = 0 -> y' | _ :: ys -> assoc_lbl ~cmp ~default x ys - let uniq ?(cmp = Pervasives.compare) xs + let uniq ?(cmp = Stdlib.compare) xs let rec loop acc = function | [] -> acc | [x] -> x :: acc -- 2.40.1
Richard W.M. Jones
2023-May-22 16:29 UTC
[Libguestfs] [libguestfs-common PATCH] Add support for OCaml 5.0
On Sat, May 20, 2023 at 06:16:40PM +0200, J?rgen H?tzel wrote:> Pervasives is deprecated since Ocaml 4.08 and has been > removed in OCaml 5.0. > > https://github.com/ocaml/ocaml/pull/1605 > --- > mlstdutils/std_utils.ml | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/mlstdutils/std_utils.ml b/mlstdutils/std_utils.ml > index 0d2fa22..86b21a7 100644 > --- a/mlstdutils/std_utils.ml > +++ b/mlstdutils/std_utils.ml > @@ -341,12 +341,12 @@ module List = struct > | x::xs, y::ys, z::zs -> (x, y, z) :: combine3 xs ys zs > | _ -> invalid_arg "combine3" > > - let rec assoc_lbl ?(cmp = Pervasives.compare) ~default x = function > + let rec assoc_lbl ?(cmp = Stdlib.compare) ~default x = function > | [] -> default > | (y, y') :: _ when cmp x y = 0 -> y' > | _ :: ys -> assoc_lbl ~cmp ~default x ys > > - let uniq ?(cmp = Pervasives.compare) xs > + let uniq ?(cmp = Stdlib.compare) xs > let rec loop acc = function > | [] -> acc > | [x] -> x :: accThanks. This change has been made in the following commits: libguestfs-common d61cd820b49e403848d15c5deaccbf8dd7045370 libguestfs 3cb094083e61203a8751bcf31dcb56a47dec6840 guestfs-tools 6e11b3b90a751e013683cea21af802c6273da989 virt-v2v f046bb91b2e8166c8358b9f6799dbe8165ceb7b0 Note this makes it impossible to compile libguestfs, tools etc with OCaml < 4.07, in particular with OCaml 4.05 in RHEL 7, but that's now almost end of life. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com nbdkit - Flexible, fast NBD server with plugins https://gitlab.com/nbdkit/nbdkit
Apparently Analagous Threads
- [PATCH v3 0/2] common/mlstdutils: Extend the List module.
- [PATCH libguestfs] generator: Add --chown option for virt-customize
- [PATCH libguestfs 0/4] Fix ups for OCaml 5
- [PATCH] mllib: use Unix.isatty
- [PATCH v6 04/41] mllib: Split ‘Common_utils’ into ‘Std_utils’ + ‘Common_utils’.