Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package ocaml-sexplib0 for openSUSE:Factory checked in at 2023-01-05 15:00:58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ocaml-sexplib0 (Old) and /work/SRC/openSUSE:Factory/.ocaml-sexplib0.new.1563 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ocaml-sexplib0" Thu Jan 5 15:00:58 2023 rev:6 rq:1056081 version:0.15.1 Changes: -------- --- /work/SRC/openSUSE:Factory/ocaml-sexplib0/ocaml-sexplib0.changes 2022-04-06 21:51:49.059343787 +0200 +++ /work/SRC/openSUSE:Factory/.ocaml-sexplib0.new.1563/ocaml-sexplib0.changes 2023-01-05 15:01:19.581170026 +0100 @@ -1,0 +2,6 @@ +Sun Jan 1 01:01:01 UTC 2023 - oher...@suse.de + +- Update to version 0.15.1 + Handle OCaml 5.0 + +------------------------------------------------------------------- Old: ---- ocaml-sexplib0-0.15.0.tar.xz New: ---- ocaml-sexplib0-0.15.1.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ocaml-sexplib0.spec ++++++ --- /var/tmp/diff_new_pack.INZS9B/_old 2023-01-05 15:01:20.001172240 +0100 +++ /var/tmp/diff_new_pack.INZS9B/_new 2023-01-05 15:01:20.009172283 +0100 @@ -1,7 +1,7 @@ # # spec file for package ocaml-sexplib0 # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,7 +17,7 @@ Name: ocaml-sexplib0 -Version: 0.15.0 +Version: 0.15.1 Release: 0 %{?ocaml_preserve_bytecode} Summary: Library containing the definition of S-expressions and some base converters @@ -27,7 +27,7 @@ URL: https://opam.ocaml.org/packages/sexplib0 Source0: %name-%version.tar.xz BuildRequires: ocaml-dune -BuildRequires: ocaml-rpm-macros >= 20220222 +BuildRequires: ocaml-rpm-macros >= 20230101 BuildRequires: ocaml(ocaml_base_version) >= 4.04 %description ++++++ _service ++++++ --- /var/tmp/diff_new_pack.INZS9B/_old 2023-01-05 15:01:20.041172450 +0100 +++ /var/tmp/diff_new_pack.INZS9B/_new 2023-01-05 15:01:20.045172472 +0100 @@ -1,7 +1,7 @@ <services> <service name="tar_scm" mode="disabled"> <param name="filename">ocaml-sexplib0</param> - <param name="revision">486bed42dd1946666e6dba369d493dc472c874bd</param> + <param name="revision">4c3387b5890ed7f27d761d4926022efef5710463</param> <param name="scm">git</param> <param name="submodules">disable</param> <param name="url">https://github.com/janestreet/sexplib0.git</param> ++++++ ocaml-sexplib0-0.15.0.tar.xz -> ocaml-sexplib0-0.15.1.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-sexplib0-0.15.0/src/sexp_conv.ml new/ocaml-sexplib0-0.15.1/src/sexp_conv.ml --- old/ocaml-sexplib0-0.15.0/src/sexp_conv.ml 2022-02-15 15:18:18.000000000 +0100 +++ new/ocaml-sexplib0-0.15.1/src/sexp_conv.ml 2022-06-15 18:57:16.000000000 +0200 @@ -1,5 +1,4 @@ (* Utility Module for S-expression Conversions *) -let polymorphic_compare = compare open StdLabels open MoreLabels @@ -82,25 +81,6 @@ (* Fast and automatic exception registration *) - module Int = struct - type t = int - - let compare t1 t2 = polymorphic_compare (t1 : int) t2 - end - - module Exn_ids = Map.Make (Int) - - module Obj = struct - module Extension_constructor = struct - [@@@ocaml.warning "-3"] - - type t = extension_constructor - - let id = Obj.extension_id - let of_val = Obj.extension_constructor - end - end - module Registration = struct type t = { sexp_of_exn : exn -> Sexp.t @@ -109,73 +89,33 @@ } end - let exn_id_map - : (Obj.Extension_constructor.t, Registration.t) Ephemeron.K1.t Exn_ids.t ref - = - ref Exn_ids.empty - ;; + module Exn_table = Ephemeron.K1.Make (struct + type t = extension_constructor - (* [Obj.extension_id] works on both the exception itself, and the extension slot of the - exception. *) - let rec clean_up_handler (slot : Obj.Extension_constructor.t) = - let id = Obj.Extension_constructor.id slot in - let old_exn_id_map = !exn_id_map in - let new_exn_id_map = Exn_ids.remove id old_exn_id_map in - (* This trick avoids mutexes and should be fairly efficient *) - if !exn_id_map != old_exn_id_map - then clean_up_handler slot - else exn_id_map := new_exn_id_map - ;; + let equal = ( == ) + let hash = Obj.Extension_constructor.id + end) + + let the_exn_table : Registration.t Exn_table.t = Exn_table.create 17 (* Ephemerons are used so that [sexp_of_exn] closure don't keep the extension_constructor live. *) - let add ?(printexc = true) ?(finalise = true) extension_constructor sexp_of_exn = - let id = Obj.Extension_constructor.id extension_constructor in - let rec loop () = - let old_exn_id_map = !exn_id_map in - let ephe = Ephemeron.K1.create () in - Ephemeron.K1.set_data ephe ({ sexp_of_exn; printexc } : Registration.t); - Ephemeron.K1.set_key ephe extension_constructor; - let new_exn_id_map = Exn_ids.add old_exn_id_map ~key:id ~data:ephe in - (* This trick avoids mutexes and should be fairly efficient *) - if !exn_id_map != old_exn_id_map - then loop () - else ( - exn_id_map := new_exn_id_map; - if finalise - then ( - try Gc.finalise clean_up_handler extension_constructor with - | Invalid_argument _ -> - (* Pre-allocated extension constructors cannot be finalised *) - ())) - in - loop () - ;; - - let add_auto ?finalise exn sexp_of_exn = - add ?finalise (Obj.Extension_constructor.of_val exn) sexp_of_exn + let add ?(printexc = true) ?finalise:_ extension_constructor sexp_of_exn = + Exn_table.add the_exn_table extension_constructor { sexp_of_exn; printexc } ;; let find_auto ~for_printexc exn = - let id = Obj.Extension_constructor.id (Obj.Extension_constructor.of_val exn) in - match Exn_ids.find id !exn_id_map with - | exception Not_found -> None - | ephe -> - (match Ephemeron.K1.get_data ephe with - | None -> None - | Some { sexp_of_exn; printexc } -> - (match for_printexc, printexc with - | false, _ | _, true -> Some (sexp_of_exn exn) - | true, false -> None)) + let extension_constructor = Obj.Extension_constructor.of_val exn in + match Exn_table.find_opt the_exn_table extension_constructor with + | None -> None + | Some { sexp_of_exn; printexc } -> + (match for_printexc, printexc with + | false, _ | _, true -> Some (sexp_of_exn exn) + | true, false -> None) ;; module For_unit_tests_only = struct - let size () = - Exn_ids.fold !exn_id_map ~init:0 ~f:(fun ~key:_ ~data:ephe acc -> - match Ephemeron.K1.get_data ephe with - | None -> acc - | Some _ -> acc + 1) - ;; + let size () = (Exn_table.stats_alive the_exn_table).num_bindings end end @@ -452,14 +392,6 @@ , function | Stack.Empty -> Atom "Stack.Empty" | _ -> assert false ) - ; ( [%extension_constructor Stream.Failure] - , function - | Stream.Failure -> Atom "Stream.Failure" - | _ -> assert false ) - ; ( [%extension_constructor Stream.Error] - , function - | Stream.Error arg -> List [ Atom "Stream.Error"; Atom arg ] - | _ -> assert false ) ; ( [%extension_constructor Sys.Break] , function | Sys.Break -> Atom "Sys.Break" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-sexplib0-0.15.0/src/sexp_conv.mli new/ocaml-sexplib0-0.15.1/src/sexp_conv.mli --- old/ocaml-sexplib0-0.15.0/src/sexp_conv.mli 2022-02-15 15:18:18.000000000 +0100 +++ new/ocaml-sexplib0-0.15.1/src/sexp_conv.mli 2022-06-15 18:57:16.000000000 +0200 @@ -266,18 +266,10 @@ val sexp_of_exn_opt : exn -> Sexp.t option module Exn_converter : sig - val add_auto : ?finalise:bool -> exn -> (exn -> Sexp.t) -> unit - [@@deprecated "[since 2016-07] use Conv.Exn_converter.add"] - - (** [add ?finalise constructor sexp_of_exn] registers exception S-expression + (** [add constructor sexp_of_exn] registers exception S-expression converter [sexp_of_exn] for exceptions with the given [constructor]. - NOTE: If [finalise] is [true], then the exception will be automatically - registered for removal with the GC (default). Finalisation will not work - with exceptions that have been allocated outside the heap, which is the - case for some standard ones e.g. [Sys_error]. - - @param finalise default = [true] *) + NOTE: [finalise] is ignored, and provided only for backward compatibility. *) val add : ?printexc:bool -> ?finalise:bool