Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: use the same repr for executable names #11067

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/dune_rules/artifacts_db.ml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ let available_exes ~dir (exes : Executables.t) =
in
Lib.DB.resolve_user_written_deps
libs
(`Exe (Nonempty_list.to_list exes.names))
(`Exe exes.names)
exes.buildable.libraries
~pps
~dune_version
Expand Down
2 changes: 1 addition & 1 deletion src/dune_rules/cinaps.ml
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ let gen_rules sctx t ~dir ~scope =
let compile_info =
Lib.DB.resolve_user_written_deps
(Scope.libs scope)
(`Exe (Nonempty_list.to_list names))
(`Exe names)
(Lib_dep.Direct (loc, Lib_name.of_string "cinaps.runtime") :: t.libraries)
~pps:(Preprocess.Per_module.pps t.preprocess)
~dune_version
Expand Down
2 changes: 1 addition & 1 deletion src/dune_rules/exe_rules.ml
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ let compile_info ~scope (exes : Executables.t) =
let merlin_ident = Merlin_ident.for_exes ~names:(Nonempty_list.map ~f:snd exes.names) in
Lib.DB.resolve_user_written_deps
(Scope.libs scope)
(`Exe (Nonempty_list.to_list exes.names))
(`Exe exes.names)
exes.buildable.libraries
~pps
~dune_version
Expand Down
2 changes: 1 addition & 1 deletion src/dune_rules/install_rules.ml
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ end = struct
Lib.DB.resolve_user_written_deps
(Scope.libs scope)
~forbidden_libraries:[]
(`Exe (Nonempty_list.to_list exes.names))
(`Exe exes.names)
exes.buildable.libraries
~pps
~dune_version
Expand Down
8 changes: 4 additions & 4 deletions src/dune_rules/lib.ml
Original file line number Diff line number Diff line change
Expand Up @@ -2091,13 +2091,13 @@ module DB = struct
~human_readable_description:(fun () ->
match targets with
| `Melange_emit name -> Pp.textf "melange target %s" name
| `Exe [ (loc, name) ] ->
| `Exe Nonempty_list.[ (loc, name) ] ->
Pp.textf "executable %s in %s" name (Loc.to_file_colon_line loc)
| `Exe names ->
let loc, _ = List.hd names in
| `Exe (Nonempty_list.((loc, _) :: _) as names) ->
Pp.textf
"executables %s in %s"
(String.enumerate_and (List.map ~f:snd names))
(String.enumerate_and
(Nonempty_list.map ~f:snd names |> Nonempty_list.to_list))
(Loc.to_file_colon_line loc)))
in
let pps =
Expand Down
2 changes: 1 addition & 1 deletion src/dune_rules/lib.mli
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ module DB : sig
This function is for executables or melange.emit stanzas. *)
val resolve_user_written_deps
: t
-> [ `Exe of (Loc.t * string) list | `Melange_emit of string ]
-> [ `Exe of (Loc.t * string) Nonempty_list.t | `Melange_emit of string ]
-> allow_overlaps:bool
-> forbidden_libraries:(Loc.t * Lib_name.t) list
-> Lib_dep.t list
Expand Down
2 changes: 1 addition & 1 deletion src/dune_rules/mdx.ml
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ let mdx_prog_gen t ~sctx ~dir ~scope ~mdx_prog =
let merlin_ident = Merlin_ident.for_exes ~names:(Nonempty_list.map ~f:snd names) in
Lib.DB.resolve_user_written_deps
(Scope.libs scope)
(`Exe (Nonempty_list.to_list names))
(`Exe names)
~allow_overlaps:false
~forbidden_libraries:[]
(lib "mdx.test" :: lib "mdx.top" :: t.libraries)
Expand Down
2 changes: 1 addition & 1 deletion src/dune_rules/toplevel.ml
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ module Stanza = struct
let merlin_ident = Merlin_ident.for_exes ~names:(Nonempty_list.map ~f:snd names) in
Lib.DB.resolve_user_written_deps
(Scope.libs scope)
(`Exe (Nonempty_list.to_list names))
(`Exe names)
~forbidden_libraries:[]
(Lib_dep.Direct (source.loc, compiler_libs)
:: List.map toplevel.libraries ~f:(fun d -> Lib_dep.Direct d))
Expand Down
2 changes: 1 addition & 1 deletion src/dune_rules/utop.ml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ let add_stanza db ~dir (acc, pps) stanza =
in
Lib.DB.resolve_user_written_deps
db
(`Exe (Nonempty_list.to_list exes.names))
(`Exe exes.names)
exes.buildable.libraries
~pps
~dune_version
Expand Down
Loading