diff --git a/bin/arg.ml b/bin/arg.ml index 800eadfaf097..3cb497bc5dc9 100644 --- a/bin/arg.ml +++ b/bin/arg.ml @@ -122,3 +122,5 @@ let bytes = conv (decode, pp_print_int64) let context_name : Context_name.t conv = conv Context_name.conv + +let lib_name = conv Dune.Lib_name.conv diff --git a/bin/arg.mli b/bin/arg.mli index cfdafc28a947..cee2396a661f 100644 --- a/bin/arg.mli +++ b/bin/arg.mli @@ -36,3 +36,5 @@ val path : Path.t conv val package_name : Package.Name.t conv val profile : Profile.t conv + +val lib_name : Lib_name.t conv diff --git a/bin/common.ml b/bin/common.ml index 820dd5df49b9..7df82b5ad65f 100644 --- a/bin/common.ml +++ b/bin/common.ml @@ -48,7 +48,7 @@ type t = ; stats_trace_file : string option ; always_show_command_line : bool ; promote_install_files : bool - ; instrument_with : string list option + ; instrument_with : Dune.Lib_name.t list option } let workspace_file t = t.workspace_file @@ -638,7 +638,7 @@ let term = in Arg.( value - & opt (some (list string)) None + & opt (some (list lib_name)) None & info [ "instrument-with" ] ~docs ~env:(Arg.env_var ~doc "DUNE_INSTRUMENT_WITH") ~docv:"BACKENDS" ~doc) diff --git a/bin/common.mli b/bin/common.mli index 2a9d7e7b97bc..b5e695c26992 100644 --- a/bin/common.mli +++ b/bin/common.mli @@ -28,7 +28,7 @@ val default_target : t -> Arg.Dep.t val prefix_target : t -> string -> string -val instrument_with : t -> string list option +val instrument_with : t -> Dune.Lib_name.t list option (** [set_common ?log common ~targets ~external_lib_deps_mode] is [set_dirs common] followed by [set_common_other common ~targets]. In diff --git a/src/dune/main.mli b/src/dune/main.mli index 7e41697b83b2..2505603ec994 100644 --- a/src/dune/main.mli +++ b/src/dune/main.mli @@ -22,7 +22,7 @@ val scan_workspace : -> ?x:Context_name.t -> ?capture_outputs:bool -> ?profile:Profile.t - -> ?instrument_with:string list + -> ?instrument_with:Lib_name.t list -> ancestor_vcs:Vcs.t option -> unit -> workspace Fiber.t diff --git a/src/dune/workspace.ml b/src/dune/workspace.ml index b4d4d7329884..99f91a20947e 100644 --- a/src/dune/workspace.ml +++ b/src/dune/workspace.ml @@ -470,7 +470,7 @@ module DB = struct type t = { x : Context_name.t option ; profile : Profile.t option - ; instrument_with : string list option + ; instrument_with : Lib_name.t list option ; path : Path.t option } @@ -479,7 +479,7 @@ module DB = struct record [ ("x", option Context_name.to_dyn x) ; ("profile", option Profile.to_dyn profile) - ; ("instrument_with", option (list string) instrument_with) + ; ("instrument_with", option (list Lib_name.to_dyn) instrument_with) ; ("path", option Path.to_dyn path) ] @@ -497,9 +497,6 @@ let workspace = let { DB.Settings.path; profile; instrument_with; x } = Memo.Run.Fdecl.get DB.Settings.t in - let instrument_with = - Option.map ~f:(List.map ~f:Lib_name.of_string) instrument_with - in match path with | None -> default ?x ?profile ?instrument_with () | Some p -> load ?x ?profile ?instrument_with p diff --git a/src/dune/workspace.mli b/src/dune/workspace.mli index ff988c49e31c..1970aa4e0c11 100644 --- a/src/dune/workspace.mli +++ b/src/dune/workspace.mli @@ -78,7 +78,7 @@ val hash : t -> int val init : ?x:Context_name.t -> ?profile:Profile.t - -> ?instrument_with:string list + -> ?instrument_with:Lib_name.t list -> ?path:Path.t -> unit -> unit