Skip to content

Commit

Permalink
Fix packaging
Browse files Browse the repository at this point in the history
Signed-off-by: Nathan Rebours <[email protected]>
  • Loading branch information
NathanReb committed Dec 19, 2024
1 parent 218347c commit b9b38f8
Show file tree
Hide file tree
Showing 49 changed files with 58 additions and 38 deletions.
2 changes: 0 additions & 2 deletions bench/bench.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions dune-project
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(lang dune 2.9)
(lang dune 3.8)
(name ppxlib)
(using cinaps 1.0)
(implicit_transitive_deps false)
Expand Down Expand Up @@ -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
Expand Down
4 changes: 1 addition & 3 deletions ppxlib-bench.opam
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"
5 changes: 2 additions & 3 deletions ppxlib-tools.opam
Original file line number Diff line number Diff line change
Expand Up @@ -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: [
Expand All @@ -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"
4 changes: 1 addition & 3 deletions ppxlib.opam
Original file line number Diff line number Diff line change
Expand Up @@ -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"}
Expand All @@ -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"
2 changes: 1 addition & 1 deletion src/ast_builder.mli
Original file line number Diff line number Diff line change
Expand Up @@ -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]. *)
16 changes: 0 additions & 16 deletions src/deriving.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -306,90 +304,77 @@ 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);
}

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);
}

let str_type_ext =
{
kind = Str;
name = "type extension";
get = (fun t -> t.str_type_ext);
get_set = (fun t -> t.str_type_ext);
}

let str_exception =
{
kind = Str;
name = "exception";
get = (fun t -> t.str_exception);
get_set = (fun t -> t.str_exception);
}

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);
}

let sig_type_decl =
{
kind = Sig;
name = "signature type";
get = (fun t -> t.sig_type_decl);
get_set = (fun t -> t.sig_type_decl);
}

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);
}

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);
}

let sig_exception =
{
kind = Sig;
name = "signature exception";
get = (fun t -> t.sig_exception);
get_set = (fun t -> t.sig_exception);
}

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);
Expand Down Expand Up @@ -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));
Expand Down
2 changes: 1 addition & 1 deletion src/driver.mli
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/pp_ast.mli
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
3 changes: 3 additions & 0 deletions test/501_migrations/dune
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
(modules compare_on))

(cram
(package ppxlib)
(enabled_if
(and
(>= %{ocaml_version} "5.1.0~alpha2")
Expand All @@ -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")
Expand Down
1 change: 1 addition & 0 deletions test/502_pexpfun/dune
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
(libraries ppxlib))

(cram
(package ppxlib)
(enabled_if
(>= %{ocaml_version} "5.2"))
(deps driver.exe))
1 change: 1 addition & 0 deletions test/base/dune
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
(rule
(package ppxlib)
(alias runtest)
(enabled_if
(>= %{ocaml_version} "4.09.0"))
Expand Down
1 change: 1 addition & 0 deletions test/code_path/dune
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
(rule
(package ppxlib)
(alias runtest)
(enabled_if
(>= %{ocaml_version} "4.10.0"))
Expand Down
1 change: 1 addition & 0 deletions test/deriving/dune
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
(rule
(package ppxlib)
(alias runtest)
(enabled_if
(>= %{ocaml_version} "4.10.0"))
Expand Down
1 change: 1 addition & 0 deletions test/deriving/inline/example/dune
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
(pps ppx_foo_deriver)))

(alias
(package ppxlib)
(name runtest)
(deps ppx_deriving_example.cma))
1 change: 1 addition & 0 deletions test/deriving/inline/foo-deriver/dune
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
(library
(package ppxlib)
(kind ppx_deriver)
(name ppx_foo_deriver)
(libraries ppxlib))
1 change: 1 addition & 0 deletions test/deriving_warning/dune
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@
(pps ppxlib.metaquot)))

(cram
(package ppxlib)
(deps driver.exe))
1 change: 1 addition & 0 deletions test/driver/attributes/dune
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
(rule
(package ppxlib)
(alias runtest)
(enabled_if
(>= %{ocaml_version} "4.08.0"))
Expand Down
1 change: 1 addition & 0 deletions test/driver/error_embedding/dune
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
(libraries ppxlib))

(cram
(package ppxlib)
(deps raiser.exe pp.exe))
10 changes: 5 additions & 5 deletions test/driver/exception_handling/deriver.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions test/driver/exception_handling/dune
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
(libraries ppxlib))

(cram
(package ppxlib)
(deps
extender.exe
whole_file_exception.exe
Expand Down
1 change: 1 addition & 0 deletions test/driver/flag_cookie/dune
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@
(pps ppxlib.metaquot)))

(cram
(package ppxlib)
(deps print_cookie_driver.exe))
1 change: 1 addition & 0 deletions test/driver/instrument/dune
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
(rule
(package ppxlib)
(alias runtest)
(enabled_if
(>= %{ocaml_version} "4.08.0"))
Expand Down
1 change: 1 addition & 0 deletions test/driver/keywords-option/dune
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
(libraries ppxlib))

(cram
(package ppxlib)
(enabled_if
(>= %{ocaml_version} "5.3"))
(deps driver.exe))
1 change: 1 addition & 0 deletions test/driver/non-compressible-suffix/dune
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
(rule
(package ppxlib)
(alias runtest)
(enabled_if
(>= %{ocaml_version} "4.08.0"))
Expand Down
1 change: 1 addition & 0 deletions test/driver/ocaml-ppx-context-load-path-migration/dune
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
compiler-libs.common))

(cram
(package ppxlib)
(enabled_if
(>= %{ocaml_version} "5.2"))
(deps driver.exe))
1 change: 1 addition & 0 deletions test/driver/parse_error_locations/dune
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
(libraries ppxlib))

(cram
(package ppxlib)
(deps identity_standalone.exe))
1 change: 1 addition & 0 deletions test/driver/run_as_ppx_rewriter/dune
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@
(pps ppxlib.metaquot)))

(cram
(package ppxlib)
(deps print_greetings.exe))
Loading

0 comments on commit b9b38f8

Please sign in to comment.