From 617515d9cf7b3aea7f74fcc0135f004ad679165c Mon Sep 17 00:00:00 2001 From: Hugo Heuzard Date: Fri, 13 Jun 2025 08:53:10 +0200 Subject: [PATCH 1/6] constraints --- dune-project | 6 +++--- js_of_ocaml-lwt.opam | 2 +- js_of_ocaml-ppx.opam | 2 +- js_of_ocaml-tyxml.opam | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dune-project b/dune-project index 313679cb59..25d94fbcc2 100644 --- a/dune-project +++ b/dune-project @@ -49,7 +49,7 @@ (lwt (>= 2.4.4)) (num :with-test) (ppx_expect (and (>= v0.14.2) :with-test)) - (ppxlib (and (>= 0.22.0) :with-test)) + (ppxlib (and (>= 0.36) :with-test)) (re (and (>= 1.9.0) :with-test))) (depopts graphics @@ -79,7 +79,7 @@ (ocaml (>= 4.13)) (js_of_ocaml (= :version)) (ppxlib (>= 0.15)) - (ppxlib (and (< 0.36) :with-test)) + (ppxlib (and (>= 0.36) :with-test)) (num :with-test) (ppx_expect (and (>= v0.14.2) :with-test)) (re (and (>= 1.9.0) :with-test)) @@ -116,7 +116,7 @@ (tyxml (>= 4.6)) (num :with-test) (ppx_expect (and (>= v0.14.2) :with-test)) - (ppxlib (and (>= 0.22.0) :with-test)) + (ppxlib (and (>= 0.36) :with-test)) (re (and (>= 1.9.0) :with-test)) )) diff --git a/js_of_ocaml-lwt.opam b/js_of_ocaml-lwt.opam index 26e617fc71..a1c063b988 100644 --- a/js_of_ocaml-lwt.opam +++ b/js_of_ocaml-lwt.opam @@ -19,7 +19,7 @@ depends: [ "lwt" {>= "2.4.4"} "num" {with-test} "ppx_expect" {>= "v0.14.2" & with-test} - "ppxlib" {>= "0.22.0" & with-test} + "ppxlib" {>= "0.36" & with-test} "re" {>= "1.9.0" & with-test} "odoc" {with-doc} ] diff --git a/js_of_ocaml-ppx.opam b/js_of_ocaml-ppx.opam index 107dc15cd8..2340dbc902 100644 --- a/js_of_ocaml-ppx.opam +++ b/js_of_ocaml-ppx.opam @@ -16,7 +16,7 @@ depends: [ "ocaml" {>= "4.13"} "js_of_ocaml" {= version} "ppxlib" {>= "0.15"} - "ppxlib" {< "0.36" & with-test} + "ppxlib" {>= "0.36" & with-test} "num" {with-test} "ppx_expect" {>= "v0.14.2" & with-test} "re" {>= "1.9.0" & with-test} diff --git a/js_of_ocaml-tyxml.opam b/js_of_ocaml-tyxml.opam index f5d8ff7987..739ea596b0 100644 --- a/js_of_ocaml-tyxml.opam +++ b/js_of_ocaml-tyxml.opam @@ -21,7 +21,7 @@ depends: [ "tyxml" {>= "4.6"} "num" {with-test} "ppx_expect" {>= "v0.14.2" & with-test} - "ppxlib" {>= "0.22.0" & with-test} + "ppxlib" {>= "0.36" & with-test} "re" {>= "1.9.0" & with-test} "odoc" {with-doc} ] From 78e00066f6aeb3a4af97f21aecfbf86efce8db0a Mon Sep 17 00:00:00 2001 From: Hugo Heuzard Date: Fri, 13 Jun 2025 08:55:14 +0200 Subject: [PATCH 2/6] update ppx_deriving_json --- .../lib/ppx_deriving_json.ml | 7 +- ppx/ppx_deriving_json/tests/gen.mlt | 142 +++++++++--------- 2 files changed, 78 insertions(+), 71 deletions(-) diff --git a/ppx/ppx_deriving_json/lib/ppx_deriving_json.ml b/ppx/ppx_deriving_json/lib/ppx_deriving_json.ml index ae72fdc72c..22df5a8a01 100644 --- a/ppx/ppx_deriving_json/lib/ppx_deriving_json.ml +++ b/ppx/ppx_deriving_json/lib/ppx_deriving_json.ml @@ -174,7 +174,12 @@ let poly_fun_of_type_decl type_decl expr = fold_right_type_decl (fun name expr -> let name = name.txt in - Exp.fun_ nolabel None (pvar ("poly_" ^ name)) expr) + Ppxlib.Ast_builder.Default.pexp_fun + ~loc:Location.none + nolabel + None + (pvar ("poly_" ^ name)) + expr) type_decl expr diff --git a/ppx/ppx_deriving_json/tests/gen.mlt b/ppx/ppx_deriving_json/tests/gen.mlt index 3994e69fa3..bfb75877f4 100644 --- a/ppx/ppx_deriving_json/tests/gen.mlt +++ b/ppx/ppx_deriving_json/tests/gen.mlt @@ -20,17 +20,17 @@ type int_list = int list[@@deriving json] include struct let _ = fun (_ : int_list) -> () - let rec int_list_of_json : Deriving_Json_lexer.lexbuf -> int_list = + let rec (int_list_of_json : Deriving_Json_lexer.lexbuf -> int_list) = fun buf -> Deriving_Json.read_list (fun buf -> Deriving_Json.Json_int.read buf) buf let _ = int_list_of_json - let rec int_list_to_json : Buffer.t -> int_list -> unit = + let rec (int_list_to_json : Buffer.t -> int_list -> unit) = fun buf a -> Deriving_Json.write_list (fun buf a -> Deriving_Json.Json_int.write buf a) buf a let _ = int_list_to_json - let int_list_json : int_list Deriving_Json.t = + let (int_list_json : int_list Deriving_Json.t) = Deriving_Json.make int_list_to_json int_list_of_json let _ = int_list_json end[@@ocaml.doc "@inline"][@@merlin.hide ];; @@ -48,17 +48,17 @@ type int_ref = int ref[@@deriving json] include struct let _ = fun (_ : int_ref) -> () - let rec int_ref_of_json : Deriving_Json_lexer.lexbuf -> int_ref = + let rec (int_ref_of_json : Deriving_Json_lexer.lexbuf -> int_ref) = fun buf -> Deriving_Json.read_ref (fun buf -> Deriving_Json.Json_int.read buf) buf let _ = int_ref_of_json - let rec int_ref_to_json : Buffer.t -> int_ref -> unit = + let rec (int_ref_to_json : Buffer.t -> int_ref -> unit) = fun buf a -> Deriving_Json.write_ref (fun buf a -> Deriving_Json.Json_int.write buf a) buf a let _ = int_ref_to_json - let int_ref_json : int_ref Deriving_Json.t = + let (int_ref_json : int_ref Deriving_Json.t) = Deriving_Json.make int_ref_to_json int_ref_of_json let _ = int_ref_json end[@@ocaml.doc "@inline"][@@merlin.hide ];; @@ -76,17 +76,17 @@ type int_option = int option[@@deriving json] include struct let _ = fun (_ : int_option) -> () - let rec int_option_of_json : Deriving_Json_lexer.lexbuf -> int_option = + let rec (int_option_of_json : Deriving_Json_lexer.lexbuf -> int_option) = fun buf -> Deriving_Json.read_option (fun buf -> Deriving_Json.Json_int.read buf) buf let _ = int_option_of_json - let rec int_option_to_json : Buffer.t -> int_option -> unit = + let rec (int_option_to_json : Buffer.t -> int_option -> unit) = fun buf a -> Deriving_Json.write_option (fun buf a -> Deriving_Json.Json_int.write buf a) buf a let _ = int_option_to_json - let int_option_json : int_option Deriving_Json.t = + let (int_option_json : int_option Deriving_Json.t) = Deriving_Json.make int_option_to_json int_option_of_json let _ = int_option_json end[@@ocaml.doc "@inline"][@@merlin.hide ];; @@ -104,17 +104,17 @@ type int_array = int array[@@deriving json] include struct let _ = fun (_ : int_array) -> () - let rec int_array_of_json : Deriving_Json_lexer.lexbuf -> int_array = + let rec (int_array_of_json : Deriving_Json_lexer.lexbuf -> int_array) = fun buf -> Deriving_Json.read_array (fun buf -> Deriving_Json.Json_int.read buf) buf let _ = int_array_of_json - let rec int_array_to_json : Buffer.t -> int_array -> unit = + let rec (int_array_to_json : Buffer.t -> int_array -> unit) = fun buf a -> Deriving_Json.write_array (fun buf a -> Deriving_Json.Json_int.write buf a) buf a let _ = int_array_to_json - let int_array_json : int_array Deriving_Json.t = + let (int_array_json : int_array Deriving_Json.t) = Deriving_Json.make int_array_to_json int_array_of_json let _ = int_array_json end[@@ocaml.doc "@inline"][@@merlin.hide ];; @@ -132,7 +132,7 @@ type tuple1 = (int * string)[@@deriving json] include struct let _ = fun (_ : tuple1) -> () - let rec tuple1_of_json : Deriving_Json_lexer.lexbuf -> tuple1 = + let rec (tuple1_of_json : Deriving_Json_lexer.lexbuf -> tuple1) = fun buf -> Deriving_Json_lexer.read_lbracket buf; ignore (Deriving_Json_lexer.read_tag_1 0 buf); @@ -142,7 +142,7 @@ include (let b = Deriving_Json.Json_string.read buf in Deriving_Json_lexer.read_rbracket buf; (a, b))) let _ = tuple1_of_json - let rec tuple1_to_json : Buffer.t -> tuple1 -> unit = + let rec (tuple1_to_json : Buffer.t -> tuple1 -> unit) = fun buf a -> let (a, b) = a in Buffer.add_string buf "[0"; @@ -151,7 +151,7 @@ include Deriving_Json.Json_string.write buf b); Buffer.add_string buf "]" let _ = tuple1_to_json - let tuple1_json : tuple1 Deriving_Json.t = + let (tuple1_json : tuple1 Deriving_Json.t) = Deriving_Json.make tuple1_to_json tuple1_of_json let _ = tuple1_json end[@@ocaml.doc "@inline"][@@merlin.hide ];; @@ -170,7 +170,6 @@ type variant1 = [%%expect {| - type variant1 = | A | B @@ -179,7 +178,7 @@ type variant1 = include struct let _ = fun (_ : variant1) -> () - let rec variant1_of_json : Deriving_Json_lexer.lexbuf -> variant1 = + let rec (variant1_of_json : Deriving_Json_lexer.lexbuf -> variant1) = fun buf -> match Deriving_Json_lexer.read_case buf with | `NCst 0 -> @@ -191,7 +190,7 @@ include | `Cst 0 -> A | _ -> Deriving_Json_lexer.tag_error ~typename:"" buf let _ = variant1_of_json - let rec variant1_to_json : Buffer.t -> variant1 -> unit = + let rec (variant1_to_json : Buffer.t -> variant1 -> unit) = fun buf -> function | D a -> @@ -202,7 +201,7 @@ include | B -> Deriving_Json.Json_int.write buf 1 | A -> Deriving_Json.Json_int.write buf 0 let _ = variant1_to_json - let variant1_json : variant1 Deriving_Json.t = + let (variant1_json : variant1 Deriving_Json.t) = Deriving_Json.make variant1_to_json variant1_of_json let _ = variant1_json end[@@ocaml.doc "@inline"][@@merlin.hide ];; @@ -219,14 +218,13 @@ type variant2 = [%%expect {| - type variant2 = | D of string | E of variant1 [@@deriving json] include struct let _ = fun (_ : variant2) -> () - let rec variant2_of_json : Deriving_Json_lexer.lexbuf -> variant2 = + let rec (variant2_of_json : Deriving_Json_lexer.lexbuf -> variant2) = fun buf -> match Deriving_Json_lexer.read_case buf with | `NCst 1 -> @@ -239,7 +237,7 @@ include Deriving_Json_lexer.read_rbracket buf; D a)) | _ -> Deriving_Json_lexer.tag_error ~typename:"" buf let _ = variant2_of_json - let rec variant2_to_json : Buffer.t -> variant2 -> unit = + let rec (variant2_to_json : Buffer.t -> variant2 -> unit) = fun buf -> function | E a -> @@ -252,7 +250,7 @@ include Deriving_Json.Json_string.write buf a); Buffer.add_string buf "]") let _ = variant2_to_json - let variant2_json : variant2 Deriving_Json.t = + let (variant2_json : variant2 Deriving_Json.t) = Deriving_Json.make variant2_to_json variant2_of_json let _ = variant2_json end[@@ocaml.doc "@inline"][@@merlin.hide ];; @@ -277,7 +275,7 @@ type record1 = { include struct let _ = fun (_ : record1) -> () - let rec record1_of_json : Deriving_Json_lexer.lexbuf -> record1 = + let rec (record1_of_json : Deriving_Json_lexer.lexbuf -> record1) = fun buf -> Deriving_Json_lexer.read_lbracket buf; ignore (Deriving_Json_lexer.read_tag_2 0 254 buf); @@ -290,7 +288,7 @@ include Deriving_Json.read_option (fun buf -> record1_of_json buf) buf in Deriving_Json_lexer.read_rbracket buf; { f = a; g = b; h = c }))) let _ = record1_of_json - let rec record1_to_json : Buffer.t -> record1 -> unit = + let rec (record1_to_json : Buffer.t -> record1 -> unit) = fun buf { f; g; h } -> Buffer.add_string buf "[0"; (((Buffer.add_string buf ","; variant1_to_json buf f); @@ -301,7 +299,7 @@ include h); Buffer.add_string buf "]" let _ = record1_to_json - let record1_json : record1 Deriving_Json.t = + let (record1_json : record1 Deriving_Json.t) = Deriving_Json.make record1_to_json record1_of_json let _ = record1_json end[@@ocaml.doc "@inline"][@@merlin.hide ];; @@ -322,11 +320,12 @@ type poly1 = [ `A | `B of string ][@@deriving json] include struct let _ = fun (_ : poly1) -> () - let rec poly1_recognize : [ `NCst of int | `Cst of int ] -> bool = + let rec (poly1_recognize : [ `NCst of int | `Cst of int ] -> bool) = function | `Cst 65 -> true | `NCst 66 -> true | _ -> false let _ = poly1_recognize - let rec poly1_of_json_with_tag : - Deriving_Json_lexer.lexbuf -> [ `NCst of int | `Cst of int ] -> poly1 + let rec (poly1_of_json_with_tag : + Deriving_Json_lexer.lexbuf -> + [ `NCst of int | `Cst of int ] -> poly1) = fun buf -> function @@ -336,12 +335,12 @@ include (let v = Deriving_Json.Json_string.read buf in Deriving_Json_lexer.read_rbracket buf; `B v)) | _ -> Deriving_Json_lexer.tag_error ~typename:"" buf - and poly1_of_json : Deriving_Json_lexer.lexbuf -> poly1 = + and (poly1_of_json : Deriving_Json_lexer.lexbuf -> poly1) = fun buf -> poly1_of_json_with_tag buf (Deriving_Json_lexer.read_vcase buf) let _ = poly1_of_json_with_tag and _ = poly1_of_json - let rec poly1_to_json : Buffer.t -> [> poly1] -> unit = + let rec (poly1_to_json : Buffer.t -> [> poly1] -> unit) = fun buf a -> match a with | `A -> Deriving_Json.Json_int.write buf 65 @@ -353,7 +352,7 @@ include Deriving_Json.Json_string.write buf b); Buffer.add_string buf "]") let _ = poly1_to_json - let poly1_json : poly1 Deriving_Json.t = + let (poly1_json : poly1 Deriving_Json.t) = Deriving_Json.make poly1_to_json poly1_of_json let _ = poly1_json end[@@ocaml.doc "@inline"][@@merlin.hide ];; @@ -378,14 +377,15 @@ type poly2 = [ | poly1 | `C of int ][@@deriving json] include struct let _ = fun (_ : poly2) -> () - let rec poly2_recognize : [ `NCst of int | `Cst of int ] -> bool = + let rec (poly2_recognize : [ `NCst of int | `Cst of int ] -> bool) = function | x when poly1_recognize x -> true | `NCst 67 -> true | _ -> false let _ = poly2_recognize - let rec poly2_of_json_with_tag : - Deriving_Json_lexer.lexbuf -> [ `NCst of int | `Cst of int ] -> poly2 + let rec (poly2_of_json_with_tag : + Deriving_Json_lexer.lexbuf -> + [ `NCst of int | `Cst of int ] -> poly2) = fun buf -> function @@ -396,12 +396,12 @@ include (let v = Deriving_Json.Json_int.read buf in Deriving_Json_lexer.read_rbracket buf; `C v)) | _ -> Deriving_Json_lexer.tag_error ~typename:"" buf - and poly2_of_json : Deriving_Json_lexer.lexbuf -> poly2 = + and (poly2_of_json : Deriving_Json_lexer.lexbuf -> poly2) = fun buf -> poly2_of_json_with_tag buf (Deriving_Json_lexer.read_vcase buf) let _ = poly2_of_json_with_tag and _ = poly2_of_json - let rec poly2_to_json : Buffer.t -> [> poly2] -> unit = + let rec (poly2_to_json : Buffer.t -> [> poly2] -> unit) = fun buf a -> match a with | #poly1 as a -> poly1_to_json buf a @@ -413,7 +413,7 @@ include Deriving_Json.Json_int.write buf b); Buffer.add_string buf "]") let _ = poly2_to_json - let poly2_json : poly2 Deriving_Json.t = + let (poly2_json : poly2 Deriving_Json.t) = Deriving_Json.make poly2_to_json poly2_of_json let _ = poly2_json end[@@ocaml.doc "@inline"][@@merlin.hide ];; @@ -436,7 +436,6 @@ type inline_record = [%%expect {| - type inline_record = | I of { name: string ; @@ -446,8 +445,9 @@ type inline_record = include struct let _ = fun (_ : inline_record) -> () - let rec inline_record_of_json : - Deriving_Json_lexer.lexbuf -> inline_record = + let rec (inline_record_of_json : + Deriving_Json_lexer.lexbuf -> inline_record) + = fun buf -> match Deriving_Json_lexer.read_case buf with | `NCst 1 -> @@ -462,7 +462,7 @@ include Deriving_Json_lexer.read_rbracket buf; I { name = a; age = b }))) | _ -> Deriving_Json_lexer.tag_error ~typename:"" buf let _ = inline_record_of_json - let rec inline_record_to_json : Buffer.t -> inline_record -> unit = + let rec (inline_record_to_json : Buffer.t -> inline_record -> unit) = fun buf -> function | J { empty } -> @@ -478,7 +478,7 @@ include Deriving_Json.Json_int.write buf age); Buffer.add_string buf "]") let _ = inline_record_to_json - let inline_record_json : inline_record Deriving_Json.t = + let (inline_record_json : inline_record Deriving_Json.t) = Deriving_Json.make inline_record_to_json inline_record_of_json let _ = inline_record_json end[@@ocaml.doc "@inline"][@@merlin.hide ];; @@ -497,17 +497,18 @@ type 'a t = 'a array[@@deriving json] include struct let _ = fun (_ : 'a t) -> () - let rec of_json : - (Deriving_Json_lexer.lexbuf -> 'a) -> - Deriving_Json_lexer.lexbuf -> 'a t + let rec (of_json : + (Deriving_Json_lexer.lexbuf -> 'a) -> + Deriving_Json_lexer.lexbuf -> 'a t) = fun poly_a buf -> Deriving_Json.read_array (fun buf -> poly_a buf) buf let _ = of_json - let rec to_json : (Buffer.t -> 'a -> unit) -> Buffer.t -> 'a t -> unit = + let rec (to_json : (Buffer.t -> 'a -> unit) -> Buffer.t -> 'a t -> unit) + = fun poly_a buf a -> Deriving_Json.write_array (fun buf a -> poly_a buf a) buf a let _ = to_json - let json : 'a Deriving_Json.t -> 'a t Deriving_Json.t = + let (json : 'a Deriving_Json.t -> 'a t Deriving_Json.t) = fun poly_a -> Deriving_Json.make (to_json (Deriving_Json.write poly_a)) (of_json (Deriving_Json.read poly_a)) @@ -528,10 +529,10 @@ type ('a, 'b) t = ('a array * 'b)[@@deriving json] include struct let _ = fun (_ : ('a, 'b) t) -> () - let rec of_json : - (Deriving_Json_lexer.lexbuf -> 'a) -> - (Deriving_Json_lexer.lexbuf -> 'b) -> - Deriving_Json_lexer.lexbuf -> ('a, 'b) t + let rec (of_json : + (Deriving_Json_lexer.lexbuf -> 'a) -> + (Deriving_Json_lexer.lexbuf -> 'b) -> + Deriving_Json_lexer.lexbuf -> ('a, 'b) t) = fun poly_a poly_b buf -> Deriving_Json_lexer.read_lbracket buf; @@ -541,9 +542,9 @@ include Deriving_Json_lexer.read_comma buf; (let b = poly_b buf in Deriving_Json_lexer.read_rbracket buf; (a, b))) let _ = of_json - let rec to_json : - (Buffer.t -> 'a -> unit) -> - (Buffer.t -> 'b -> unit) -> Buffer.t -> ('a, 'b) t -> unit + let rec (to_json : + (Buffer.t -> 'a -> unit) -> + (Buffer.t -> 'b -> unit) -> Buffer.t -> ('a, 'b) t -> unit) = fun poly_a poly_b buf a -> let (a, b) = a in @@ -554,8 +555,9 @@ include poly_b buf b); Buffer.add_string buf "]" let _ = to_json - let json : - 'a Deriving_Json.t -> 'b Deriving_Json.t -> ('a, 'b) t Deriving_Json.t + let (json : + 'a Deriving_Json.t -> + 'b Deriving_Json.t -> ('a, 'b) t Deriving_Json.t) = fun poly_a poly_b -> Deriving_Json.make @@ -580,27 +582,26 @@ val json : type t = A | B [@@deriving json] [%%expect {| - type t = | A | B [@@deriving json] include struct let _ = fun (_ : t) -> () - let rec of_json : Deriving_Json_lexer.lexbuf -> t = + let rec (of_json : Deriving_Json_lexer.lexbuf -> t) = fun buf -> match Deriving_Json_lexer.read_case buf with | `Cst 1 -> B | `Cst 0 -> A | _ -> Deriving_Json_lexer.tag_error ~typename:"" buf let _ = of_json - let rec to_json : Buffer.t -> t -> unit = + let rec (to_json : Buffer.t -> t -> unit) = fun buf -> function | B -> Deriving_Json.Json_int.write buf 1 | A -> Deriving_Json.Json_int.write buf 0 let _ = to_json - let json : t Deriving_Json.t = Deriving_Json.make to_json of_json + let (json : t Deriving_Json.t) = Deriving_Json.make to_json of_json let _ = json end[@@ocaml.doc "@inline"][@@merlin.hide ];; type t = A | B @@ -661,13 +662,13 @@ type id' = int[@@deriving json] include struct let _ = fun (_ : id') -> () - let rec id'_of_json : Deriving_Json_lexer.lexbuf -> id' = + let rec (id'_of_json : Deriving_Json_lexer.lexbuf -> id') = fun buf -> Deriving_Json.Json_int.read buf let _ = id'_of_json - let rec id'_to_json : Buffer.t -> id' -> unit = + let rec (id'_to_json : Buffer.t -> id' -> unit) = fun buf a -> Deriving_Json.Json_int.write buf a let _ = id'_to_json - let id'_json : id' Deriving_Json.t = + let (id'_json : id' Deriving_Json.t) = Deriving_Json.make id'_to_json id'_of_json let _ = id'_json end[@@ocaml.doc "@inline"][@@merlin.hide ];; @@ -690,14 +691,15 @@ type poly3 = include struct let _ = fun (_ : poly3) -> () - let rec poly3_recognize : [ `NCst of int | `Cst of int ] -> bool = + let rec (poly3_recognize : [ `NCst of int | `Cst of int ] -> bool) = function | x when poly1_recognize x -> true | `NCst 67 -> true | _ -> false let _ = poly3_recognize - let rec poly3_of_json_with_tag : - Deriving_Json_lexer.lexbuf -> [ `NCst of int | `Cst of int ] -> poly3 + let rec (poly3_of_json_with_tag : + Deriving_Json_lexer.lexbuf -> + [ `NCst of int | `Cst of int ] -> poly3) = fun buf -> function @@ -728,12 +730,12 @@ include (Deriving_Json_lexer.read_vcase buf) in Deriving_Json_lexer.read_rbracket buf; `C v)) | _ -> Deriving_Json_lexer.tag_error ~typename:"" buf - and poly3_of_json : Deriving_Json_lexer.lexbuf -> poly3 = + and (poly3_of_json : Deriving_Json_lexer.lexbuf -> poly3) = fun buf -> poly3_of_json_with_tag buf (Deriving_Json_lexer.read_vcase buf) let _ = poly3_of_json_with_tag and _ = poly3_of_json - let rec poly3_to_json : Buffer.t -> [> poly3] -> unit = + let rec (poly3_to_json : Buffer.t -> [> poly3] -> unit) = fun buf a -> match a with | #poly1 as a -> poly1_to_json buf a @@ -769,7 +771,7 @@ include Buffer.add_string buf "]"))); Buffer.add_string buf "]") let _ = poly3_to_json - let poly3_json : poly3 Deriving_Json.t = + let (poly3_json : poly3 Deriving_Json.t) = Deriving_Json.make poly3_to_json poly3_of_json let _ = poly3_json end[@@ocaml.doc "@inline"][@@merlin.hide ];; From 348b573b5cb003954e8915b9a2b34e055f10fd36 Mon Sep 17 00:00:00 2001 From: Hugo Heuzard Date: Fri, 13 Jun 2025 09:23:50 +0200 Subject: [PATCH 3/6] update ppx_js --- ppx/ppx_js/lib_internal/ppx_js_internal.ml | 19 +- ppx/ppx_js/tests/gen.mlt | 260 +++++++++------------ 2 files changed, 124 insertions(+), 155 deletions(-) diff --git a/ppx/ppx_js/lib_internal/ppx_js_internal.ml b/ppx/ppx_js/lib_internal/ppx_js_internal.ml index 3200d27134..deadf746fc 100644 --- a/ppx/ppx_js/lib_internal/ppx_js_internal.ml +++ b/ppx/ppx_js/lib_internal/ppx_js_internal.ml @@ -282,7 +282,20 @@ let invoker ?(extra_types = []) uplift downlift body arguments = let local_types = make_str res :: List.map (extra_types @ arguments) ~f:(fun x -> make_str (Arg.name x)) in - let result = List.fold_right local_types ~init:invoker ~f:Exp.newtype in + let result = + match invoker.pexp_desc with + | ((Pexp_function (params, c, b)) [@if ast_version >= 502]) -> + { invoker with + pexp_desc = + Pexp_function + ( List.map local_types ~f:(fun t -> + { pparam_desc = Pparam_newtype t; pparam_loc = Location.none }) + @ params + , c + , b ) + } + | _ -> List.fold_right local_types ~init:invoker ~f:Exp.newtype + in default_loc := default_loc'; result @@ -703,8 +716,8 @@ let literal_object self_id (fields : field_desc list) = body in match e.pexp_desc with - | Pexp_function (params, None, b) -> - { e with pexp_desc = Pexp_function (params, Some (Pconstraint ty), b) } + | Pexp_function ([ param ], None, b) -> + { e with pexp_desc = Pexp_function ([ param ], Some (Pconstraint ty), b) } | _ -> assert false) | ((_, Some ty) [@if ast_version < 502]) -> Exp.fun_ diff --git a/ppx/ppx_js/tests/gen.mlt b/ppx/ppx_js/tests/gen.mlt index 83f3c9edf9..a2136c1612 100644 --- a/ppx/ppx_js/tests/gen.mlt +++ b/ppx/ppx_js/tests/gen.mlt @@ -104,20 +104,16 @@ let o () = [%%expect {| let o () = - (fun (type res) -> - fun (type t0) -> - fun (type t1) -> - fun (type t2) -> - fun (t2 : res Js_of_ocaml.Js.t -> t0 -> t1 -> t2) - (_ : - res Js_of_ocaml.Js.t -> - (res Js_of_ocaml.Js.t -> t0 -> t1 -> t2 Js_of_ocaml.Js.meth) - -> res) - : res Js_of_ocaml.Js.t-> - Js_of_ocaml.Js.Unsafe.obj - [|("m1", - (Js_of_ocaml.Js.Unsafe.inject - (Js_of_ocaml.Js.wrap_meth_callback t2)))|]) + (fun (type res) (type t0) (type t1) (type t2) + (t2 : res Js_of_ocaml.Js.t -> t0 -> t1 -> t2) + (_ : + res Js_of_ocaml.Js.t -> + (res Js_of_ocaml.Js.t -> t0 -> t1 -> t2 Js_of_ocaml.Js.meth) -> res) + : res Js_of_ocaml.Js.t-> + Js_of_ocaml.Js.Unsafe.obj + [|("m1", + (Js_of_ocaml.Js.Unsafe.inject + (Js_of_ocaml.Js.wrap_meth_callback t2)))|]) (fun _ a b -> a + b) ((fun self m1 -> object method m1 = m1 self end) [@merlin.hide ]);; val o : @@ -133,20 +129,16 @@ let o () = [%%expect {| let o () = - (fun (type res) -> - fun (type t3) -> - fun (type t4) -> - fun (type t5) -> - fun (t5 : res Js_of_ocaml.Js.t -> t3 -> t4 -> t5) - (_ : - res Js_of_ocaml.Js.t -> - (res Js_of_ocaml.Js.t -> t3 -> t4 -> t5 Js_of_ocaml.Js.meth) - -> res) - : res Js_of_ocaml.Js.t-> - Js_of_ocaml.Js.Unsafe.obj - [|("m1", - (Js_of_ocaml.Js.Unsafe.inject - (Js_of_ocaml.Js.wrap_meth_callback t5)))|]) + (fun (type res) (type t3) (type t4) (type t5) + (t5 : res Js_of_ocaml.Js.t -> t3 -> t4 -> t5) + (_ : + res Js_of_ocaml.Js.t -> + (res Js_of_ocaml.Js.t -> t3 -> t4 -> t5 Js_of_ocaml.Js.meth) -> res) + : res Js_of_ocaml.Js.t-> + Js_of_ocaml.Js.Unsafe.obj + [|("m1", + (Js_of_ocaml.Js.Unsafe.inject + (Js_of_ocaml.Js.wrap_meth_callback t5)))|]) (fun _ a -> fun b -> a + b) ((fun self m1 -> object method m1 = m1 self end)[@merlin.hide ]);; val o : @@ -162,20 +154,16 @@ let o () = [%%expect {| let o () = - (fun (type res) -> - fun (type t6) -> - fun (type t7) -> - fun (type t8) -> - fun (t8 : res Js_of_ocaml.Js.t -> t6 -> t7 -> t8) - (_ : - res Js_of_ocaml.Js.t -> - (res Js_of_ocaml.Js.t -> t6 -> t7 -> t8 Js_of_ocaml.Js.meth) - -> res) - : res Js_of_ocaml.Js.t-> - Js_of_ocaml.Js.Unsafe.obj - [|("m1", - (Js_of_ocaml.Js.Unsafe.inject - (Js_of_ocaml.Js.wrap_meth_callback t8)))|]) + (fun (type res) (type t6) (type t7) (type t8) + (t8 : res Js_of_ocaml.Js.t -> t6 -> t7 -> t8) + (_ : + res Js_of_ocaml.Js.t -> + (res Js_of_ocaml.Js.t -> t6 -> t7 -> t8 Js_of_ocaml.Js.meth) -> res) + : res Js_of_ocaml.Js.t-> + Js_of_ocaml.Js.Unsafe.obj + [|("m1", + (Js_of_ocaml.Js.Unsafe.inject + (Js_of_ocaml.Js.wrap_meth_callback t8)))|]) (fun _ a b -> a + b) ((fun self m1 -> object method m1 = m1 self end) [@merlin.hide ]);; val o : @@ -191,21 +179,17 @@ let o () = [%%expect {| let o () = - (fun (type res) -> - fun (type t9) -> - fun (type t10) -> - fun (type t11) -> - fun (t11 : res Js_of_ocaml.Js.t -> t9 -> t10 -> t11) - (_ : - res Js_of_ocaml.Js.t -> - (res Js_of_ocaml.Js.t -> - t9 -> t10 -> t11 Js_of_ocaml.Js.meth) - -> res) - : res Js_of_ocaml.Js.t-> - Js_of_ocaml.Js.Unsafe.obj - [|("m1", - (Js_of_ocaml.Js.Unsafe.inject - (Js_of_ocaml.Js.wrap_meth_callback t11)))|]) + (fun (type res) (type t9) (type t10) (type t11) + (t11 : res Js_of_ocaml.Js.t -> t9 -> t10 -> t11) + (_ : + res Js_of_ocaml.Js.t -> + (res Js_of_ocaml.Js.t -> t9 -> t10 -> t11 Js_of_ocaml.Js.meth) -> + res) + : res Js_of_ocaml.Js.t-> + Js_of_ocaml.Js.Unsafe.obj + [|("m1", + (Js_of_ocaml.Js.Unsafe.inject + (Js_of_ocaml.Js.wrap_meth_callback t11)))|]) (fun _ a -> fun b -> a + b) ((fun self m1 -> object method m1 = m1 self end)[@merlin.hide ]);; val o : @@ -223,21 +207,17 @@ let o () = [%%expect {| let o () = - (fun (type res) -> - fun (type t12) -> - fun (type t13) -> - fun (type t14) -> - fun (t14 : res Js_of_ocaml.Js.t -> t12 -> t13 -> t14) - (_ : - res Js_of_ocaml.Js.t -> - (res Js_of_ocaml.Js.t -> - t12 -> t13 -> t14 Js_of_ocaml.Js.meth) - -> res) - : res Js_of_ocaml.Js.t-> - Js_of_ocaml.Js.Unsafe.obj - [|("m1", - (Js_of_ocaml.Js.Unsafe.inject - (Js_of_ocaml.Js.wrap_meth_callback t14)))|]) + (fun (type res) (type t12) (type t13) (type t14) + (t14 : res Js_of_ocaml.Js.t -> t12 -> t13 -> t14) + (_ : + res Js_of_ocaml.Js.t -> + (res Js_of_ocaml.Js.t -> t12 -> t13 -> t14 Js_of_ocaml.Js.meth) -> + res) + : res Js_of_ocaml.Js.t-> + Js_of_ocaml.Js.Unsafe.obj + [|("m1", + (Js_of_ocaml.Js.Unsafe.inject + (Js_of_ocaml.Js.wrap_meth_callback t14)))|]) (fun _ a -> function | b -> a + b) ((fun self m1 -> object method m1 = m1 self end)[@merlin.hide ]);; val o : @@ -256,21 +236,17 @@ let o () = [%%expect {| let o () = - (fun (type res) -> - fun (type t15) -> - fun (type t16) -> - fun (type t17) -> - fun (t17 : res Js_of_ocaml.Js.t -> t15 -> t16 -> t17) - (_ : - res Js_of_ocaml.Js.t -> - (res Js_of_ocaml.Js.t -> - t15 -> t16 -> t17 Js_of_ocaml.Js.meth) - -> res) - : res Js_of_ocaml.Js.t-> - Js_of_ocaml.Js.Unsafe.obj - [|("m1", - (Js_of_ocaml.Js.Unsafe.inject - (Js_of_ocaml.Js.wrap_meth_callback t17)))|]) + (fun (type res) (type t15) (type t16) (type t17) + (t17 : res Js_of_ocaml.Js.t -> t15 -> t16 -> t17) + (_ : + res Js_of_ocaml.Js.t -> + (res Js_of_ocaml.Js.t -> t15 -> t16 -> t17 Js_of_ocaml.Js.meth) -> + res) + : res Js_of_ocaml.Js.t-> + Js_of_ocaml.Js.Unsafe.obj + [|("m1", + (Js_of_ocaml.Js.Unsafe.inject + (Js_of_ocaml.Js.wrap_meth_callback t17)))|]) (fun _ a -> function | 0 -> a | b -> a + b) ((fun self m1 -> object method m1 = m1 self end)[@merlin.hide ]);; val o : @@ -289,21 +265,17 @@ let o () = [%%expect {| let o () = - (fun (type res) -> - fun (type t18) -> - fun (type t19) -> - fun (type t20) -> - fun (t20 : res Js_of_ocaml.Js.t -> t18 -> t19 -> t20) - (_ : - res Js_of_ocaml.Js.t -> - (res Js_of_ocaml.Js.t -> - t18 -> t19 -> t20 Js_of_ocaml.Js.meth) - -> res) - : res Js_of_ocaml.Js.t-> - Js_of_ocaml.Js.Unsafe.obj - [|("m1", - (Js_of_ocaml.Js.Unsafe.inject - (Js_of_ocaml.Js.wrap_meth_callback t20)))|]) + (fun (type res) (type t18) (type t19) (type t20) + (t20 : res Js_of_ocaml.Js.t -> t18 -> t19 -> t20) + (_ : + res Js_of_ocaml.Js.t -> + (res Js_of_ocaml.Js.t -> t18 -> t19 -> t20 Js_of_ocaml.Js.meth) -> + res) + : res Js_of_ocaml.Js.t-> + Js_of_ocaml.Js.Unsafe.obj + [|("m1", + (Js_of_ocaml.Js.Unsafe.inject + (Js_of_ocaml.Js.wrap_meth_callback t20)))|]) (fun _ (type b) a -> function | 0 -> a | b -> a + b) ((fun self m1 -> object method m1 = m1 self end)[@merlin.hide ]);; val o : @@ -322,21 +294,17 @@ let o () = [%%expect {| let o () = - (fun (type res) -> - fun (type t21) -> - fun (type t22) -> - fun (type t23) -> - fun (t23 : res Js_of_ocaml.Js.t -> t21 -> t22 -> t23) - (_ : - res Js_of_ocaml.Js.t -> - (res Js_of_ocaml.Js.t -> - t21 -> t22 -> t23 Js_of_ocaml.Js.meth) - -> res) - : res Js_of_ocaml.Js.t-> - Js_of_ocaml.Js.Unsafe.obj - [|("m1", - (Js_of_ocaml.Js.Unsafe.inject - (Js_of_ocaml.Js.wrap_meth_callback t23)))|]) + (fun (type res) (type t21) (type t22) (type t23) + (t23 : res Js_of_ocaml.Js.t -> t21 -> t22 -> t23) + (_ : + res Js_of_ocaml.Js.t -> + (res Js_of_ocaml.Js.t -> t21 -> t22 -> t23 Js_of_ocaml.Js.meth) -> + res) + : res Js_of_ocaml.Js.t-> + Js_of_ocaml.Js.Unsafe.obj + [|("m1", + (Js_of_ocaml.Js.Unsafe.inject + (Js_of_ocaml.Js.wrap_meth_callback t23)))|]) (fun _ a (type b) -> function | 0 -> a | b -> a + b) ((fun self m1 -> object method m1 = m1 self end)[@merlin.hide ]);; val o : @@ -369,7 +337,7 @@ Error: Polymorphic method not supported. let o () = - object%js + object%js method m1 : 'a -> unit = fun (type a) (a : a) -> ignore a method m2 : int -> unit = fun (type a) (a : a) -> ignore a method m3 : 'b -> unit = fun (a : 'b) -> ignore a @@ -377,40 +345,28 @@ let o () = [%%expect {| let o () = - (fun (type res) -> - fun (type t26) -> - fun (type t27) -> - fun (type t28) -> - fun (type t29) -> - fun (type t30) -> - fun (type t31) -> - fun (t29 : res Js_of_ocaml.Js.t -> t26 -> t29) - (t30 : res Js_of_ocaml.Js.t -> t27 -> t30) - (t31 : res Js_of_ocaml.Js.t -> t28 -> t31) - (_ : - res Js_of_ocaml.Js.t -> - (res Js_of_ocaml.Js.t -> - t26 -> t29 Js_of_ocaml.Js.meth) - -> - (res Js_of_ocaml.Js.t -> - t27 -> t30 Js_of_ocaml.Js.meth) - -> - (res Js_of_ocaml.Js.t -> - t28 -> t31 Js_of_ocaml.Js.meth) - -> res) - : res Js_of_ocaml.Js.t-> - Js_of_ocaml.Js.Unsafe.obj - [|("m1", - (Js_of_ocaml.Js.Unsafe.inject - (Js_of_ocaml.Js.wrap_meth_callback t29))); - ("m2", - (Js_of_ocaml.Js.Unsafe.inject - (Js_of_ocaml.Js.wrap_meth_callback t30))); - ("m3", - (Js_of_ocaml.Js.Unsafe.inject - (Js_of_ocaml.Js.wrap_meth_callback t31)))|]) - (fun _ : 'a -> unit-> fun (type a) -> fun (a : a) -> ignore a) - (fun _ : int -> unit-> fun (type a) -> fun (a : a) -> ignore a) + (fun (type res) (type t26) (type t27) (type t28) (type t29) (type t30) + (type t31) (t29 : res Js_of_ocaml.Js.t -> t26 -> t29) + (t30 : res Js_of_ocaml.Js.t -> t27 -> t30) + (t31 : res Js_of_ocaml.Js.t -> t28 -> t31) + (_ : + res Js_of_ocaml.Js.t -> + (res Js_of_ocaml.Js.t -> t26 -> t29 Js_of_ocaml.Js.meth) -> + (res Js_of_ocaml.Js.t -> t27 -> t30 Js_of_ocaml.Js.meth) -> + (res Js_of_ocaml.Js.t -> t28 -> t31 Js_of_ocaml.Js.meth) -> res) + : res Js_of_ocaml.Js.t-> + Js_of_ocaml.Js.Unsafe.obj + [|("m1", + (Js_of_ocaml.Js.Unsafe.inject + (Js_of_ocaml.Js.wrap_meth_callback t29)));("m2", + (Js_of_ocaml.Js.Unsafe.inject + (Js_of_ocaml.Js.wrap_meth_callback + t30))); + ("m3", + (Js_of_ocaml.Js.Unsafe.inject + (Js_of_ocaml.Js.wrap_meth_callback t31)))|]) + (fun _ : 'a -> unit-> fun (type a) (a : a) -> ignore a) + (fun _ : int -> unit-> fun (type a) (a : a) -> ignore a) (fun _ : 'b -> unit-> fun (a : 'b) -> ignore a) ((fun self m1 m2 m3 -> object method m1 = m1 self method m2 = m2 self method m3 = m3 self From 800ef01bf6646d169aa18a79df4b6e7d4903c04a Mon Sep 17 00:00:00 2001 From: Hugo Heuzard Date: Fri, 13 Jun 2025 09:47:31 +0200 Subject: [PATCH 4/6] bump constraint on ppxlib --- dune-project | 13 ++++--------- js_of_ocaml-compiler.opam | 2 +- js_of_ocaml-lwt.opam | 1 - js_of_ocaml-ppx.opam | 3 +-- js_of_ocaml-ppx_deriving_json.opam | 2 +- js_of_ocaml-toplevel.opam | 1 - js_of_ocaml-tyxml.opam | 1 - js_of_ocaml.opam | 1 - ppx/ppx_deriving_json/tests/dune | 2 +- wasm_of_ocaml-compiler.opam | 2 +- 10 files changed, 9 insertions(+), 19 deletions(-) diff --git a/dune-project b/dune-project index 25d94fbcc2..2e25e585a4 100644 --- a/dune-project +++ b/dune-project @@ -21,7 +21,7 @@ (ocaml (and (>= 4.13) (< 5.4))) (num :with-test) (ppx_expect (and (>= v0.16.1) :with-test)) - (ppxlib (>= 0.15)) + (ppxlib (>= 0.35)) (re :with-test) (cmdliner (>= 1.1.0)) (sedlex (>= 3.3)) @@ -49,7 +49,6 @@ (lwt (>= 2.4.4)) (num :with-test) (ppx_expect (and (>= v0.14.2) :with-test)) - (ppxlib (and (>= 0.36) :with-test)) (re (and (>= 1.9.0) :with-test))) (depopts graphics @@ -64,7 +63,7 @@ (depends (ocaml (>= 4.13)) (js_of_ocaml (= :version)) - (ppxlib (>= 0.15)) + (ppxlib (>= 0.35)) (num :with-test) (ppx_expect (and (>= v0.14.2) :with-test)) (re (and (>= 1.9.0) :with-test)) @@ -78,8 +77,7 @@ (depends (ocaml (>= 4.13)) (js_of_ocaml (= :version)) - (ppxlib (>= 0.15)) - (ppxlib (and (>= 0.36) :with-test)) + (ppxlib (>= 0.35)) (num :with-test) (ppx_expect (and (>= v0.14.2) :with-test)) (re (and (>= 1.9.0) :with-test)) @@ -98,7 +96,6 @@ (graphics :with-test) (num :with-test) (ppx_expect (and (>= v0.14.2) :with-test)) - (ppxlib (>= 0.15)) (re (and (>= 1.9.0) :with-test)) )) @@ -116,7 +113,6 @@ (tyxml (>= 4.6)) (num :with-test) (ppx_expect (and (>= v0.14.2) :with-test)) - (ppxlib (and (>= 0.36) :with-test)) (re (and (>= 1.9.0) :with-test)) )) @@ -128,7 +124,6 @@ (depends (ocaml (>= 4.13)) (js_of_ocaml-compiler (= :version)) - (ppxlib (>= 0.15)) (num :with-test) (ppx_expect (and (>= v0.14.2) :with-test)) (re (and (>= 1.9.0) :with-test)) @@ -144,7 +139,7 @@ (js_of_ocaml (= :version)) (num :with-test) (ppx_expect (and (>= v0.14.2) :with-test)) - (ppxlib (>= 0.15)) + (ppxlib (>= 0.35)) (re :with-test) (cmdliner (>= 1.1.0)) (opam-format :with-test) diff --git a/js_of_ocaml-compiler.opam b/js_of_ocaml-compiler.opam index 3b8e26ff9f..a2e97940c1 100644 --- a/js_of_ocaml-compiler.opam +++ b/js_of_ocaml-compiler.opam @@ -16,7 +16,7 @@ depends: [ "ocaml" {>= "4.13" & < "5.4"} "num" {with-test} "ppx_expect" {>= "v0.16.1" & with-test} - "ppxlib" {>= "0.15"} + "ppxlib" {>= "0.35"} "re" {with-test} "cmdliner" {>= "1.1.0"} "sedlex" {>= "3.3"} diff --git a/js_of_ocaml-lwt.opam b/js_of_ocaml-lwt.opam index a1c063b988..f651c115ec 100644 --- a/js_of_ocaml-lwt.opam +++ b/js_of_ocaml-lwt.opam @@ -19,7 +19,6 @@ depends: [ "lwt" {>= "2.4.4"} "num" {with-test} "ppx_expect" {>= "v0.14.2" & with-test} - "ppxlib" {>= "0.36" & with-test} "re" {>= "1.9.0" & with-test} "odoc" {with-doc} ] diff --git a/js_of_ocaml-ppx.opam b/js_of_ocaml-ppx.opam index 2340dbc902..65872d8ecf 100644 --- a/js_of_ocaml-ppx.opam +++ b/js_of_ocaml-ppx.opam @@ -15,8 +15,7 @@ depends: [ "dune" {>= "3.19"} "ocaml" {>= "4.13"} "js_of_ocaml" {= version} - "ppxlib" {>= "0.15"} - "ppxlib" {>= "0.36" & with-test} + "ppxlib" {>= "0.35"} "num" {with-test} "ppx_expect" {>= "v0.14.2" & with-test} "re" {>= "1.9.0" & with-test} diff --git a/js_of_ocaml-ppx_deriving_json.opam b/js_of_ocaml-ppx_deriving_json.opam index c5f0d244ae..65872d8ecf 100644 --- a/js_of_ocaml-ppx_deriving_json.opam +++ b/js_of_ocaml-ppx_deriving_json.opam @@ -15,7 +15,7 @@ depends: [ "dune" {>= "3.19"} "ocaml" {>= "4.13"} "js_of_ocaml" {= version} - "ppxlib" {>= "0.15"} + "ppxlib" {>= "0.35"} "num" {with-test} "ppx_expect" {>= "v0.14.2" & with-test} "re" {>= "1.9.0" & with-test} diff --git a/js_of_ocaml-toplevel.opam b/js_of_ocaml-toplevel.opam index 91a041b718..da5645a9b0 100644 --- a/js_of_ocaml-toplevel.opam +++ b/js_of_ocaml-toplevel.opam @@ -19,7 +19,6 @@ depends: [ "graphics" {with-test} "num" {with-test} "ppx_expect" {>= "v0.14.2" & with-test} - "ppxlib" {>= "0.15"} "re" {>= "1.9.0" & with-test} "odoc" {with-doc} ] diff --git a/js_of_ocaml-tyxml.opam b/js_of_ocaml-tyxml.opam index 739ea596b0..1228c707d4 100644 --- a/js_of_ocaml-tyxml.opam +++ b/js_of_ocaml-tyxml.opam @@ -21,7 +21,6 @@ depends: [ "tyxml" {>= "4.6"} "num" {with-test} "ppx_expect" {>= "v0.14.2" & with-test} - "ppxlib" {>= "0.36" & with-test} "re" {>= "1.9.0" & with-test} "odoc" {with-doc} ] diff --git a/js_of_ocaml.opam b/js_of_ocaml.opam index 4a18f278cc..0bbcbacf8b 100644 --- a/js_of_ocaml.opam +++ b/js_of_ocaml.opam @@ -15,7 +15,6 @@ depends: [ "dune" {>= "3.19"} "ocaml" {>= "4.13"} "js_of_ocaml-compiler" {= version} - "ppxlib" {>= "0.15"} "num" {with-test} "ppx_expect" {>= "v0.14.2" & with-test} "re" {>= "1.9.0" & with-test} diff --git a/ppx/ppx_deriving_json/tests/dune b/ppx/ppx_deriving_json/tests/dune index 5e2a598458..5aa3cbdf7c 100644 --- a/ppx/ppx_deriving_json/tests/dune +++ b/ppx/ppx_deriving_json/tests/dune @@ -35,7 +35,7 @@ (rule (alias runtest) (enabled_if - (>= %{ocaml_version} 5.2)) + (>= %{ocaml_version} 5.3)) ;; (package js_of_ocaml-ppx) (action (diff gen.mlt gen.mlt.corrected))) diff --git a/wasm_of_ocaml-compiler.opam b/wasm_of_ocaml-compiler.opam index a1f30f2254..1a2af784a3 100644 --- a/wasm_of_ocaml-compiler.opam +++ b/wasm_of_ocaml-compiler.opam @@ -17,7 +17,7 @@ depends: [ "js_of_ocaml" {= version} "num" {with-test} "ppx_expect" {>= "v0.14.2" & with-test} - "ppxlib" {>= "0.15"} + "ppxlib" {>= "0.35"} "re" {with-test} "cmdliner" {>= "1.1.0"} "opam-format" {with-test} From 0359fc7f426c82dc814534236b6f96f9d7154aca Mon Sep 17 00:00:00 2001 From: Hugo Heuzard Date: Fri, 13 Jun 2025 11:03:05 +0200 Subject: [PATCH 5/6] fix --- .github/workflows/build-wasm_of_ocaml.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-wasm_of_ocaml.yml b/.github/workflows/build-wasm_of_ocaml.yml index bffb5bf824..8e4aa25170 100644 --- a/.github/workflows/build-wasm_of_ocaml.yml +++ b/.github/workflows/build-wasm_of_ocaml.yml @@ -106,6 +106,7 @@ jobs: run: | opam repo add js janestreet/opam-repository opam install opam-format + opam pin add ppxlib -n 0.35.0 opam exec -- dune exec --root wasm_of_ocaml tools/ci_setup.exe - name: Pin Jane Street packages From 5d63fa170e3475e4e976cfcb74635e7f87decdd4 Mon Sep 17 00:00:00 2001 From: Hugo Heuzard Date: Fri, 13 Jun 2025 11:39:06 +0200 Subject: [PATCH 6/6] opam lint --- dune-project | 2 ++ js_of_ocaml-toplevel.opam | 1 + js_of_ocaml.opam | 1 + 3 files changed, 4 insertions(+) diff --git a/dune-project b/dune-project index 2e25e585a4..b5f4cdaa09 100644 --- a/dune-project +++ b/dune-project @@ -96,6 +96,7 @@ (graphics :with-test) (num :with-test) (ppx_expect (and (>= v0.14.2) :with-test)) + (ppxlib (>= 0.35)) (re (and (>= 1.9.0) :with-test)) )) @@ -126,6 +127,7 @@ (js_of_ocaml-compiler (= :version)) (num :with-test) (ppx_expect (and (>= v0.14.2) :with-test)) + (ppxlib (>= 0.35)) (re (and (>= 1.9.0) :with-test)) )) diff --git a/js_of_ocaml-toplevel.opam b/js_of_ocaml-toplevel.opam index da5645a9b0..6244f14f77 100644 --- a/js_of_ocaml-toplevel.opam +++ b/js_of_ocaml-toplevel.opam @@ -19,6 +19,7 @@ depends: [ "graphics" {with-test} "num" {with-test} "ppx_expect" {>= "v0.14.2" & with-test} + "ppxlib" {>= "0.35"} "re" {>= "1.9.0" & with-test} "odoc" {with-doc} ] diff --git a/js_of_ocaml.opam b/js_of_ocaml.opam index 0bbcbacf8b..6a04b51e3f 100644 --- a/js_of_ocaml.opam +++ b/js_of_ocaml.opam @@ -17,6 +17,7 @@ depends: [ "js_of_ocaml-compiler" {= version} "num" {with-test} "ppx_expect" {>= "v0.14.2" & with-test} + "ppxlib" {>= "0.35"} "re" {>= "1.9.0" & with-test} "odoc" {with-doc} ]