Make targets_dir argument of SC.Action.run non-optional
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
This commit is contained in:
parent
c0a6438fcc
commit
3effc2fbdf
|
@ -197,6 +197,7 @@ module Gen(P : Install_rules.Params) = struct
|
|||
~bindings:(Pform.Map.of_bindings rule.deps)
|
||||
~dep_kind:Required
|
||||
~targets
|
||||
~targets_dir:dir
|
||||
~scope)
|
||||
|
||||
let copy_files_rules (def: Copy_files.t) ~src_dir ~dir ~scope =
|
||||
|
@ -955,6 +956,7 @@ module Gen(P : Install_rules.Params) = struct
|
|||
~dep_kind:Required
|
||||
~bindings:(Pform.Map.of_bindings alias_conf.deps)
|
||||
~targets:Alias
|
||||
~targets_dir:dir
|
||||
~scope)
|
||||
|
||||
let tests_rules (t : Tests.t) ~dir ~scope ~all_modules ~modules_partitioner
|
||||
|
|
|
@ -220,7 +220,11 @@ include Sub_system.Register_end_point(
|
|||
Option.map backend.info.generate_runner ~f:(fun (loc, action) ->
|
||||
SC.Action.run sctx action ~loc
|
||||
~bindings
|
||||
~dir ~dep_kind:Required ~targets:Alias ~scope)))
|
||||
~dir
|
||||
~dep_kind:Required
|
||||
~targets:Alias
|
||||
~targets_dir:dir
|
||||
~scope)))
|
||||
>>^ (fun actions ->
|
||||
Action.with_stdout_to target
|
||||
(Action.progn actions))
|
||||
|
|
|
@ -470,6 +470,7 @@ let lint_module sctx ~dir ~dep_kind ~lint ~lib_name ~scope ~dir_kind =
|
|||
~dep_kind
|
||||
~bindings
|
||||
~targets:(Static [])
|
||||
~targets_dir:dir
|
||||
~scope)))
|
||||
| Pps { loc; pps; flags } ->
|
||||
let args : _ Arg_spec.t =
|
||||
|
|
|
@ -773,7 +773,7 @@ module Action = struct
|
|||
["var", String_with_vars.Var.sexp_of_t pform]))
|
||||
|
||||
let run sctx ~loc ~bindings ~dir ~dep_kind
|
||||
~targets:targets_written_by_user ~scope ?(targets_dir=dir) t
|
||||
~targets:targets_written_by_user ~targets_dir ~scope t
|
||||
: (Path.t Bindings.t, Action.t) Build.t =
|
||||
let bindings = Pform.Map.superpose sctx.pforms bindings in
|
||||
let map_exe = map_exe sctx in
|
||||
|
@ -798,23 +798,6 @@ module Action = struct
|
|||
let { Action.Infer.Outcome. deps; targets } =
|
||||
Action.Infer.partial t ~all_targets:false
|
||||
in
|
||||
(* CR-someday jdimino: should this be an error or not?
|
||||
|
||||
It's likely that what we get here is what the user thinks
|
||||
of as temporary files, even though they might conflict with
|
||||
actual targets. We need to tell dune about such things,
|
||||
so that it can report better errors.
|
||||
|
||||
{[
|
||||
let missing = Path.Set.diff targets targets_written_by_user in
|
||||
if not (Path.Set.is_empty missing) then
|
||||
Loc.warn (Loc.in_file (Utils.jbuild_name_in ~dir))
|
||||
"Missing targets in user action:\n%s"
|
||||
(List.map (Path.Set.elements missing) ~f:(fun target ->
|
||||
sprintf "- %s" (Utils.describe_target target))
|
||||
|> String.concat ~sep:"\n");
|
||||
]}
|
||||
*)
|
||||
{ deps; targets = Path.Set.union targets targets_written_by_user }
|
||||
| Alias ->
|
||||
let { Action.Infer.Outcome. deps; targets = _ } =
|
||||
|
|
|
@ -243,8 +243,8 @@ module Action : sig
|
|||
-> dir:Path.t
|
||||
-> dep_kind:Build.lib_dep_kind
|
||||
-> targets:targets
|
||||
-> targets_dir:Path.t
|
||||
-> scope:Scope.t
|
||||
-> ?targets_dir:Path.t (* default: dir *)
|
||||
-> Action.Unexpanded.t
|
||||
-> (Path.t Bindings.t, Action.t) Build.t
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue