diff --git a/src/gen_rules.ml b/src/gen_rules.ml index 5ca36ef1..63fef91f 100644 --- a/src/gen_rules.ml +++ b/src/gen_rules.ml @@ -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 diff --git a/src/inline_tests.ml b/src/inline_tests.ml index ee9d6b3e..fe528b19 100644 --- a/src/inline_tests.ml +++ b/src/inline_tests.ml @@ -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)) diff --git a/src/preprocessing.ml b/src/preprocessing.ml index 8aeeae95..f3c76eb5 100644 --- a/src/preprocessing.ml +++ b/src/preprocessing.ml @@ -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 = diff --git a/src/super_context.ml b/src/super_context.ml index 2dd6f8ce..c3459b86 100644 --- a/src/super_context.ml +++ b/src/super_context.ml @@ -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 = _ } = diff --git a/src/super_context.mli b/src/super_context.mli index 0b37739e..40bf02d8 100644 --- a/src/super_context.mli +++ b/src/super_context.mli @@ -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