diff --git a/bench/bench.ml b/bench/bench.ml index e80d3a004..95833cc82 100644 --- a/bench/bench.ml +++ b/bench/bench.ml @@ -102,8 +102,6 @@ module Output = struct ("results", `List (List.map Result.to_json results)); ] end - - type t = { benchmarks : Benchmark.t list } end module Stats = struct diff --git a/dune-project b/dune-project index b8de328de..db8c3d625 100644 --- a/dune-project +++ b/dune-project @@ -1,4 +1,4 @@ -(lang dune 2.9) +(lang dune 3.8) (name ppxlib) (using cinaps 1.0) (implicit_transitive_deps false) @@ -53,10 +53,12 @@ format.") (depends (ocaml (>= 4.08.0)) (ppxlib (= :version)) - (cmdliner (>= 1.3.0)))) + (cmdliner (>= 1.3.0)) + (cinaps (and :with-test (>= v0.12.1))))) (package (name ppxlib-bench) + (allow_empty) (synopsis "Run ppxlib benchmarks") (description "Third-party code in benchmarks depends on later versions of the ocaml than ppxlib itself. Also the benchmark runner has dependencies that ppxlib doesn't diff --git a/ppxlib-bench.opam b/ppxlib-bench.opam index 8942dc767..0cf695b5b 100644 --- a/ppxlib-bench.opam +++ b/ppxlib-bench.opam @@ -12,7 +12,7 @@ homepage: "https://github.com/ocaml-ppx/ppxlib" doc: "https://ocaml-ppx.github.io/ppxlib/" bug-reports: "https://github.com/ocaml-ppx/ppxlib/issues" depends: [ - "dune" {>= "2.9"} + "dune" {>= "3.8"} "ocaml" {>= "4.04.1"} "ppxlib" {= version} "base" @@ -28,11 +28,9 @@ build: [ name "-j" jobs - "--promote-install-files=false" "@install" "@runtest" {with-test} "@doc" {with-doc} ] - ["dune" "install" "-p" name "--create-install-files" name] ] dev-repo: "git+https://github.com/ocaml-ppx/ppxlib.git" diff --git a/ppxlib-tools.opam b/ppxlib-tools.opam index e261a9047..3eb3ef02d 100644 --- a/ppxlib-tools.opam +++ b/ppxlib-tools.opam @@ -13,10 +13,11 @@ homepage: "https://github.com/ocaml-ppx/ppxlib" doc: "https://ocaml-ppx.github.io/ppxlib/" bug-reports: "https://github.com/ocaml-ppx/ppxlib/issues" depends: [ - "dune" {>= "2.9"} + "dune" {>= "3.8"} "ocaml" {>= "4.08.0"} "ppxlib" {= version} "cmdliner" {>= "1.3.0"} + "cinaps" {with-test & >= "v0.12.1"} "odoc" {with-doc} ] build: [ @@ -28,11 +29,9 @@ build: [ name "-j" jobs - "--promote-install-files=false" "@install" "@runtest" {with-test} "@doc" {with-doc} ] - ["dune" "install" "-p" name "--create-install-files" name] ] dev-repo: "git+https://github.com/ocaml-ppx/ppxlib.git" diff --git a/ppxlib.opam b/ppxlib.opam index 2bc6a2af0..aeba506c4 100644 --- a/ppxlib.opam +++ b/ppxlib.opam @@ -20,7 +20,7 @@ homepage: "https://github.com/ocaml-ppx/ppxlib" doc: "https://ocaml-ppx.github.io/ppxlib/" bug-reports: "https://github.com/ocaml-ppx/ppxlib/issues" depends: [ - "dune" {>= "2.9"} + "dune" {>= "3.8"} "ocaml" {>= "4.04.1" & < "5.4.0"} "ocaml-compiler-libs" {>= "v0.11.0"} "ppx_derivers" {>= "1.0"} @@ -47,11 +47,9 @@ build: [ name "-j" jobs - "--promote-install-files=false" "@install" "@runtest" {with-test} "@doc" {with-doc} ] - ["dune" "install" "-p" name "--create-install-files" name] ] dev-repo: "git+https://github.com/ocaml-ppx/ppxlib.git" diff --git a/src/ast_builder.mli b/src/ast_builder.mli index 4df5368d6..dbf525989 100644 --- a/src/ast_builder.mli +++ b/src/ast_builder.mli @@ -96,7 +96,7 @@ module type S = sig end (** Build Ast helpers with the location argument factorized. *) -module Make (Loc : Loc) : S +module Make (_ : Loc) : S val make : Location.t -> (module S) (** Functional version of [Make]. *) diff --git a/src/deriving.ml b/src/deriving.ml index b1dfc1f9f..716008953 100644 --- a/src/deriving.ml +++ b/src/deriving.ml @@ -285,8 +285,6 @@ module Deriver = struct sig_exception : (signature, type_exception) Generator.t option; sig_module_type_decl : (signature, module_type_declaration) Generator.t option; - extension : - (loc:Location.t -> path:string -> core_type -> expression) option; } end @@ -306,18 +304,14 @@ module Deriver = struct end module Field = struct - type kind = Str | Sig - type ('a, 'b) t = { name : string; - kind : kind; get : Actual_deriver.t -> ('a, 'b) Generator.t option; get_set : Alias.t -> string list; } let str_type_decl = { - kind = Str; name = "type"; get = (fun t -> t.str_type_decl); get_set = (fun t -> t.str_type_decl); @@ -325,7 +319,6 @@ module Deriver = struct let str_class_type_decl = { - kind = Str; name = "class type declaration"; get = (fun t -> t.str_class_type_decl); get_set = (fun t -> t.str_class_type_decl); @@ -333,7 +326,6 @@ module Deriver = struct let str_type_ext = { - kind = Str; name = "type extension"; get = (fun t -> t.str_type_ext); get_set = (fun t -> t.str_type_ext); @@ -341,7 +333,6 @@ module Deriver = struct let str_exception = { - kind = Str; name = "exception"; get = (fun t -> t.str_exception); get_set = (fun t -> t.str_exception); @@ -349,7 +340,6 @@ module Deriver = struct let str_module_type_decl = { - kind = Str; name = "module type"; get = (fun t -> t.str_module_type_decl); get_set = (fun t -> t.str_module_type_decl); @@ -357,7 +347,6 @@ module Deriver = struct let sig_type_decl = { - kind = Sig; name = "signature type"; get = (fun t -> t.sig_type_decl); get_set = (fun t -> t.sig_type_decl); @@ -365,7 +354,6 @@ module Deriver = struct let sig_class_type_decl = { - kind = Sig; name = "signature class type"; get = (fun t -> t.sig_class_type_decl); get_set = (fun t -> t.sig_class_type_decl); @@ -373,7 +361,6 @@ module Deriver = struct let sig_type_ext = { - kind = Sig; name = "signature type extension"; get = (fun t -> t.sig_type_ext); get_set = (fun t -> t.sig_type_ext); @@ -381,7 +368,6 @@ module Deriver = struct let sig_exception = { - kind = Sig; name = "signature exception"; get = (fun t -> t.sig_exception); get_set = (fun t -> t.sig_exception); @@ -389,7 +375,6 @@ module Deriver = struct let sig_module_type_decl = { - kind = Sig; name = "signature module type"; get = (fun t -> t.sig_module_type_decl); get_set = (fun t -> t.sig_module_type_decl); @@ -531,7 +516,6 @@ module Deriver = struct sig_type_ext; sig_exception; sig_module_type_decl; - extension; } in Ppx_derivers.register name (T (Actual_deriver actual_deriver)); diff --git a/src/driver.mli b/src/driver.mli index 4a058afe2..a9944cf88 100644 --- a/src/driver.mli +++ b/src/driver.mli @@ -218,7 +218,7 @@ end In the future we could also use this to directly compute the dependencies and pass them here, to avoid calling ocamldep separately. *) module Create_file_property - (Name : sig + (_ : sig val name : string end) (T : Sexpable.S) : sig diff --git a/src/pp_ast.mli b/src/pp_ast.mli index 3f6ffcbf5..1dd4777b5 100644 --- a/src/pp_ast.mli +++ b/src/pp_ast.mli @@ -83,7 +83,7 @@ end module type Configured = S with type 'a printer = 'a configured module type Configurable = S with type 'a printer = 'a configurable -module Make (Conf : Conf) : Configured +module Make (_ : Conf) : Configured val make : Config.t -> (module Configured) diff --git a/test/501_migrations/dune b/test/501_migrations/dune index 886d2881a..661ca75c1 100644 --- a/test/501_migrations/dune +++ b/test/501_migrations/dune @@ -14,6 +14,7 @@ (modules compare_on)) (cram + (package ppxlib) (enabled_if (and (>= %{ocaml_version} "5.1.0~alpha2") @@ -22,12 +23,14 @@ (deps identity_driver.exe compare_on.exe)) (cram + (package ppxlib) (enabled_if (= %{ocaml_version} "5.0.0")) (applies_to reverse_migrations) (deps reverse_migrations.exe compare_on.exe)) (cram + (package ppxlib) (enabled_if (and (>= %{ocaml_version} "5.0.0") diff --git a/test/502_pexpfun/dune b/test/502_pexpfun/dune index 2987ccb2c..9c041f528 100644 --- a/test/502_pexpfun/dune +++ b/test/502_pexpfun/dune @@ -5,6 +5,7 @@ (libraries ppxlib)) (cram + (package ppxlib) (enabled_if (>= %{ocaml_version} "5.2")) (deps driver.exe)) diff --git a/test/base/dune b/test/base/dune index 37beb0365..4f38a1387 100644 --- a/test/base/dune +++ b/test/base/dune @@ -1,4 +1,5 @@ (rule + (package ppxlib) (alias runtest) (enabled_if (>= %{ocaml_version} "4.09.0")) diff --git a/test/code_path/dune b/test/code_path/dune index 06179b3fc..938d643da 100644 --- a/test/code_path/dune +++ b/test/code_path/dune @@ -1,4 +1,5 @@ (rule + (package ppxlib) (alias runtest) (enabled_if (>= %{ocaml_version} "4.10.0")) diff --git a/test/deriving/dune b/test/deriving/dune index 06179b3fc..938d643da 100644 --- a/test/deriving/dune +++ b/test/deriving/dune @@ -1,4 +1,5 @@ (rule + (package ppxlib) (alias runtest) (enabled_if (>= %{ocaml_version} "4.10.0")) diff --git a/test/deriving/inline/example/dune b/test/deriving/inline/example/dune index 9dba55624..c26dd8d4c 100644 --- a/test/deriving/inline/example/dune +++ b/test/deriving/inline/example/dune @@ -4,5 +4,6 @@ (pps ppx_foo_deriver))) (alias + (package ppxlib) (name runtest) (deps ppx_deriving_example.cma)) diff --git a/test/deriving/inline/foo-deriver/dune b/test/deriving/inline/foo-deriver/dune index c6608ced2..bd3daa8e2 100644 --- a/test/deriving/inline/foo-deriver/dune +++ b/test/deriving/inline/foo-deriver/dune @@ -1,4 +1,5 @@ (library + (package ppxlib) (kind ppx_deriver) (name ppx_foo_deriver) (libraries ppxlib)) diff --git a/test/deriving_warning/dune b/test/deriving_warning/dune index 2fdc6aab0..ca61565e4 100644 --- a/test/deriving_warning/dune +++ b/test/deriving_warning/dune @@ -5,4 +5,5 @@ (pps ppxlib.metaquot))) (cram + (package ppxlib) (deps driver.exe)) diff --git a/test/driver/attributes/dune b/test/driver/attributes/dune index 40eea9e16..c96309764 100644 --- a/test/driver/attributes/dune +++ b/test/driver/attributes/dune @@ -1,4 +1,5 @@ (rule + (package ppxlib) (alias runtest) (enabled_if (>= %{ocaml_version} "4.08.0")) diff --git a/test/driver/error_embedding/dune b/test/driver/error_embedding/dune index 7a778e54d..f35cabe39 100644 --- a/test/driver/error_embedding/dune +++ b/test/driver/error_embedding/dune @@ -3,4 +3,5 @@ (libraries ppxlib)) (cram + (package ppxlib) (deps raiser.exe pp.exe)) diff --git a/test/driver/exception_handling/deriver.ml b/test/driver/exception_handling/deriver.ml index e6fb6ccf3..8df2712d2 100644 --- a/test/driver/exception_handling/deriver.ml +++ b/test/driver/exception_handling/deriver.ml @@ -36,23 +36,23 @@ let impl_generator_raised_exception = let impl_generator_raised_exception2 = Deriving.Generator.V2.make_noarg generate_impl_raised_exception2 -let my_deriver_extension_node = +let _ = Deriving.add "deriver_extension_node" ~str_type_decl:impl_generator_extension_node -let my_deriver_located_error = +let _ = Deriving.add "deriver_located_error" ~str_type_decl:impl_generator_located_error -let my_deriver_located_error2 = +let _ = Deriving.add "deriver_located_error2" ~str_type_decl:impl_generator_located_error2 -let my_deriver_raised_exception = +let _ = Deriving.add "deriver_raised_exception" ~str_type_decl:impl_generator_raised_exception -let my_deriver_raised_exception2 = +let _ = Deriving.add "deriver_raised_exception2" ~str_type_decl:impl_generator_raised_exception2 diff --git a/test/driver/exception_handling/dune b/test/driver/exception_handling/dune index 787595803..7b215a78e 100644 --- a/test/driver/exception_handling/dune +++ b/test/driver/exception_handling/dune @@ -11,6 +11,7 @@ (libraries ppxlib)) (cram + (package ppxlib) (deps extender.exe whole_file_exception.exe diff --git a/test/driver/flag_cookie/dune b/test/driver/flag_cookie/dune index 639e49ccc..9a2eb6c84 100644 --- a/test/driver/flag_cookie/dune +++ b/test/driver/flag_cookie/dune @@ -5,4 +5,5 @@ (pps ppxlib.metaquot))) (cram + (package ppxlib) (deps print_cookie_driver.exe)) diff --git a/test/driver/instrument/dune b/test/driver/instrument/dune index 40eea9e16..c96309764 100644 --- a/test/driver/instrument/dune +++ b/test/driver/instrument/dune @@ -1,4 +1,5 @@ (rule + (package ppxlib) (alias runtest) (enabled_if (>= %{ocaml_version} "4.08.0")) diff --git a/test/driver/keywords-option/dune b/test/driver/keywords-option/dune index d0360a7f9..2d4735c4b 100644 --- a/test/driver/keywords-option/dune +++ b/test/driver/keywords-option/dune @@ -5,6 +5,7 @@ (libraries ppxlib)) (cram + (package ppxlib) (enabled_if (>= %{ocaml_version} "5.3")) (deps driver.exe)) diff --git a/test/driver/non-compressible-suffix/dune b/test/driver/non-compressible-suffix/dune index 40eea9e16..c96309764 100644 --- a/test/driver/non-compressible-suffix/dune +++ b/test/driver/non-compressible-suffix/dune @@ -1,4 +1,5 @@ (rule + (package ppxlib) (alias runtest) (enabled_if (>= %{ocaml_version} "4.08.0")) diff --git a/test/driver/ocaml-ppx-context-load-path-migration/dune b/test/driver/ocaml-ppx-context-load-path-migration/dune index bed007080..f5f79118d 100644 --- a/test/driver/ocaml-ppx-context-load-path-migration/dune +++ b/test/driver/ocaml-ppx-context-load-path-migration/dune @@ -10,6 +10,7 @@ compiler-libs.common)) (cram + (package ppxlib) (enabled_if (>= %{ocaml_version} "5.2")) (deps driver.exe)) diff --git a/test/driver/parse_error_locations/dune b/test/driver/parse_error_locations/dune index fd125f56c..fde42554d 100644 --- a/test/driver/parse_error_locations/dune +++ b/test/driver/parse_error_locations/dune @@ -3,4 +3,5 @@ (libraries ppxlib)) (cram + (package ppxlib) (deps identity_standalone.exe)) diff --git a/test/driver/run_as_ppx_rewriter/dune b/test/driver/run_as_ppx_rewriter/dune index 41c402f83..4d1eb5c27 100644 --- a/test/driver/run_as_ppx_rewriter/dune +++ b/test/driver/run_as_ppx_rewriter/dune @@ -5,4 +5,5 @@ (pps ppxlib.metaquot))) (cram + (package ppxlib) (deps print_greetings.exe)) diff --git a/test/driver/run_as_ppx_rewriter_preserve_version/dune b/test/driver/run_as_ppx_rewriter_preserve_version/dune index 9b74d4f75..213b351a5 100644 --- a/test/driver/run_as_ppx_rewriter_preserve_version/dune +++ b/test/driver/run_as_ppx_rewriter_preserve_version/dune @@ -9,6 +9,7 @@ (modules print_magic_number)) (cram + (package ppxlib) (enabled_if (or (= %{system} linux) diff --git a/test/driver/skip-hash-bang/dune b/test/driver/skip-hash-bang/dune index d87330d3d..6705f609f 100644 --- a/test/driver/skip-hash-bang/dune +++ b/test/driver/skip-hash-bang/dune @@ -5,6 +5,7 @@ (libraries ppxlib)) (tests + (package ppxlib) (names test test2) (modules test test2) (preprocess diff --git a/test/driver/source-quotation-in-errors/dune b/test/driver/source-quotation-in-errors/dune index ca48351b2..d2ded83df 100644 --- a/test/driver/source-quotation-in-errors/dune +++ b/test/driver/source-quotation-in-errors/dune @@ -9,6 +9,7 @@ (libraries ppxlib)) (cram + (package ppxlib) (enabled_if (>= %{ocaml_version} "4.08.0")) (deps raising_driver.exe identity_driver.exe)) diff --git a/test/driver/standalone-supports-old-binary-ast/dune b/test/driver/standalone-supports-old-binary-ast/dune index 9b74d4f75..213b351a5 100644 --- a/test/driver/standalone-supports-old-binary-ast/dune +++ b/test/driver/standalone-supports-old-binary-ast/dune @@ -9,6 +9,7 @@ (modules print_magic_number)) (cram + (package ppxlib) (enabled_if (or (= %{system} linux) diff --git a/test/driver/standalone_run_as_ppx/dune b/test/driver/standalone_run_as_ppx/dune index d54bea7b3..5d0e697ca 100644 --- a/test/driver/standalone_run_as_ppx/dune +++ b/test/driver/standalone_run_as_ppx/dune @@ -3,4 +3,5 @@ (libraries ppxlib)) (cram + (package ppxlib) (deps print_stuff.exe)) diff --git a/test/driver/stdin_input/dune b/test/driver/stdin_input/dune index 7a5a05278..58f5478ba 100644 --- a/test/driver/stdin_input/dune +++ b/test/driver/stdin_input/dune @@ -3,4 +3,5 @@ (libraries ppxlib)) (cram + (package ppxlib) (deps identity_driver.exe)) diff --git a/test/driver/transformations/dune b/test/driver/transformations/dune index 3bf3b2ac1..33b4339a7 100644 --- a/test/driver/transformations/dune +++ b/test/driver/transformations/dune @@ -1,6 +1,7 @@ ; The error-reporting format changed in 4.12; thus the expect-tests need to be duplicated (rule + (package ppxlib) (alias runtest) (enabled_if (and @@ -20,6 +21,7 @@ ; file to test_412.ml (rule + (package ppxlib) (alias runtest) (enabled_if (>= %{ocaml_version} "4.12.0")) diff --git a/test/error_embedding/deriver.ml b/test/error_embedding/deriver.ml index bc6f140ec..818b4946e 100644 --- a/test/error_embedding/deriver.ml +++ b/test/error_embedding/deriver.ml @@ -25,7 +25,7 @@ let impl_generator_dependent = Deriving.Generator.V2.make_noarg ~deps:[ deriver_for_a_string ] derive_a_string -let dependent_deriver = +let _dependent_deriver = Deriving.add "a_dependent_string" ~str_type_decl:impl_generator_dependent let () = Driver.standalone () diff --git a/test/error_embedding/dune b/test/error_embedding/dune index 4f81662f7..fbaabe32d 100644 --- a/test/error_embedding/dune +++ b/test/error_embedding/dune @@ -3,4 +3,5 @@ (libraries ppxlib)) (cram + (package ppxlib) (deps extender.exe deriver.exe)) diff --git a/test/expand-header-and-footer/dune b/test/expand-header-and-footer/dune index 37beb0365..4f38a1387 100644 --- a/test/expand-header-and-footer/dune +++ b/test/expand-header-and-footer/dune @@ -1,4 +1,5 @@ (rule + (package ppxlib) (alias runtest) (enabled_if (>= %{ocaml_version} "4.09.0")) diff --git a/test/expansion_context/dune b/test/expansion_context/dune index 6ecf2d6b6..0f7d8eec0 100644 --- a/test/expansion_context/dune +++ b/test/expansion_context/dune @@ -15,4 +15,5 @@ (libraries ppxlib register_print_ctxt)) (cram + (package ppxlib) (deps standalone_print_ctxt.exe map_structure_print_ctxt.exe)) diff --git a/test/expansion_helpers/mangle/dune b/test/expansion_helpers/mangle/dune index 40eea9e16..c96309764 100644 --- a/test/expansion_helpers/mangle/dune +++ b/test/expansion_helpers/mangle/dune @@ -1,4 +1,5 @@ (rule + (package ppxlib) (alias runtest) (enabled_if (>= %{ocaml_version} "4.08.0")) diff --git a/test/expansion_inside_payloads/dune b/test/expansion_inside_payloads/dune index 06179b3fc..938d643da 100644 --- a/test/expansion_inside_payloads/dune +++ b/test/expansion_inside_payloads/dune @@ -1,4 +1,5 @@ (rule + (package ppxlib) (alias runtest) (enabled_if (>= %{ocaml_version} "4.10.0")) diff --git a/test/extensions_and_deriving/dune b/test/extensions_and_deriving/dune index 06179b3fc..938d643da 100644 --- a/test/extensions_and_deriving/dune +++ b/test/extensions_and_deriving/dune @@ -1,4 +1,5 @@ (rule + (package ppxlib) (alias runtest) (enabled_if (>= %{ocaml_version} "4.10.0")) diff --git a/test/location/exception/dune b/test/location/exception/dune index 40eea9e16..c96309764 100644 --- a/test/location/exception/dune +++ b/test/location/exception/dune @@ -1,4 +1,5 @@ (rule + (package ppxlib) (alias runtest) (enabled_if (>= %{ocaml_version} "4.08.0")) diff --git a/test/metaquot/dune b/test/metaquot/dune index 6e6f4e289..22f6133bf 100644 --- a/test/metaquot/dune +++ b/test/metaquot/dune @@ -1,4 +1,5 @@ (rule + (package ppxlib) (alias runtest) (enabled_if (>= %{ocaml_version} "4.14.0")) diff --git a/test/patterns_as_and_drop/dune b/test/patterns_as_and_drop/dune index 06179b3fc..938d643da 100644 --- a/test/patterns_as_and_drop/dune +++ b/test/patterns_as_and_drop/dune @@ -1,4 +1,5 @@ (rule + (package ppxlib) (alias runtest) (enabled_if (>= %{ocaml_version} "4.10.0")) diff --git a/test/ppx_import_support/dune b/test/ppx_import_support/dune index 06179b3fc..938d643da 100644 --- a/test/ppx_import_support/dune +++ b/test/ppx_import_support/dune @@ -1,4 +1,5 @@ (rule + (package ppxlib) (alias runtest) (enabled_if (>= %{ocaml_version} "4.10.0")) diff --git a/test/quoter/dune b/test/quoter/dune index 40eea9e16..c96309764 100644 --- a/test/quoter/dune +++ b/test/quoter/dune @@ -1,4 +1,5 @@ (rule + (package ppxlib) (alias runtest) (enabled_if (>= %{ocaml_version} "4.08.0")) diff --git a/test/traverse/dune b/test/traverse/dune index 40eea9e16..c96309764 100644 --- a/test/traverse/dune +++ b/test/traverse/dune @@ -1,4 +1,5 @@ (rule + (package ppxlib) (alias runtest) (enabled_if (>= %{ocaml_version} "4.08.0")) diff --git a/test/type_is_recursive/dune b/test/type_is_recursive/dune index 06179b3fc..938d643da 100644 --- a/test/type_is_recursive/dune +++ b/test/type_is_recursive/dune @@ -1,4 +1,5 @@ (rule + (package ppxlib) (alias runtest) (enabled_if (>= %{ocaml_version} "4.10.0"))