Skip to content

Commit

Permalink
refactor: remove a bunch of dead code from rules API (#11466)
Browse files Browse the repository at this point in the history
Signed-off-by: Rudi Grinberg <me@rgrinberg.com>
  • Loading branch information
rgrinberg authored Feb 10, 2025
1 parent 9f321e4 commit 574477e
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 41 deletions.
5 changes: 0 additions & 5 deletions src/dune_rules/module.ml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ module File = struct

let dialect t = t.dialect
let path t = t.path
let original_path t = t.original_path

let version_installed t ~src_root ~install_dir =
let path =
Expand Down Expand Up @@ -446,9 +445,5 @@ module Name_map = struct
Module_name.Map.to_list_map t ~f:(fun _ x -> Dune_lang.List (encode ~src_dir x))
;;

let of_list_exn modules =
List.rev_map modules ~f:(fun m -> name m, m) |> Module_name.Map.of_list_exn
;;

let add t module_ = Module_name.Map.set t (name module_) module_
end
2 changes: 0 additions & 2 deletions src/dune_rules/module.mli
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ module File : sig

val dialect : t -> Dialect.t
val path : t -> Path.t
val original_path : t -> Path.t
val make : Dialect.t -> Path.t -> t
end

Expand Down Expand Up @@ -75,7 +74,6 @@ module Name_map : sig
val decode : src_dir:Path.t -> t Dune_lang.Decoder.t
val encode : t -> src_dir:Path.t -> Dune_lang.t list
val to_dyn : t -> Dyn.t
val of_list_exn : module_ list -> t
val add : t -> module_ -> t
end

Expand Down
16 changes: 0 additions & 16 deletions src/dune_rules/modules.ml
Original file line number Diff line number Diff line change
Expand Up @@ -438,8 +438,6 @@ module Group = struct
;;
end

let group_interfaces (t : t) m = parents t m |> List.map ~f:lib_interface

let make_alias_for t m ~parents =
match Module.kind m with
| Alias _ | Wrapped_compat -> []
Expand Down Expand Up @@ -719,7 +717,6 @@ module Wrapped = struct

let find t name = Group.find t.group name
let find_dep t ~of_ name = Group.find_dep t.group ~of_ name
let group_interfaces (t : t) m = Group.group_interfaces t.group m
let alias_for t m = Group.alias_for t.group m
end

Expand Down Expand Up @@ -1277,19 +1274,6 @@ module With_vlib = struct
| Impl { impl; vlib = _; _ } -> alias_for impl m)
;;

let group_interfaces =
let group_interfaces t m =
match t.modules with
| Wrapped w -> Wrapped.group_interfaces w m
| Singleton w -> [ w ]
| _ -> []
in
fun t m ->
match t with
| Modules t -> group_interfaces t m
| Impl { impl; vlib; _ } -> group_interfaces impl m @ group_interfaces vlib m
;;

let local_open t m =
alias_for t m
|> List.map ~f:(fun m ->
Expand Down
1 change: 0 additions & 1 deletion src/dune_rules/modules.mli
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ module With_vlib : sig

val version_installed : t -> src_root:Path.t -> install_dir:Path.t -> t
val alias_for : t -> Module.t -> Module.t list
val group_interfaces : t -> Module.t -> Module.t list
val local_open : t -> Module.t -> Module_name.t list
val is_stdlib_alias : t -> Module.t -> bool
val exit_module : t -> Module.t option
Expand Down
17 changes: 0 additions & 17 deletions src/dune_rules/odoc.mli
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,11 @@ module Paths : sig
val toplevel_index : Context.t -> Path.Build.t
end

val find_project_by_key : Dune_project.File_key.t -> Dune_project.t Memo.t

module Scope_key : sig
val of_string : Context_name.t -> string -> (Lib_name.t * Lib.DB.t) Memo.t
val to_string : Lib_name.t -> Dune_project.t -> string
end

val lib_unique_name : Lib.t -> string
val odoc_program : Super_context.t -> Path.Build.t -> Action.Prog.t Action_builder.t

val check_mlds_no_dupes
: pkg:Dune_lang.Package_name.t
-> mlds:Path.Build.t list
-> Path.Build.t String.Map.t

val libs_of_pkg : Context_name.t -> pkg:Package.Name.t -> Lib.Local.t list Memo.t

val entry_modules
: Super_context.t
-> pkg:Dune_lang.Package_name.t
-> Module.t list Lib.Local.Map.t Memo.t

val run_odoc
: Super_context.t
-> dir:Path.t
Expand Down

0 comments on commit 574477e

Please sign in to comment.