Remove old stuff about updated files
This dates from the time we were using timestamps for incremental compilation.
This commit is contained in:
parent
b9c4dd2339
commit
143145b19c
|
@ -543,17 +543,6 @@ let fold_one_step t ~init:acc ~f =
|
|||
|
||||
include Make_mapper(Ast)(Ast)
|
||||
|
||||
let updated_files =
|
||||
let rec loop acc t =
|
||||
let acc =
|
||||
match t with
|
||||
| Write_file (fn, _) -> Path.Set.add fn acc
|
||||
| _ -> acc
|
||||
in
|
||||
fold_one_step t ~init:acc ~f:loop
|
||||
in
|
||||
fun t -> loop Path.Set.empty t
|
||||
|
||||
let chdirs =
|
||||
let rec loop acc t =
|
||||
let acc =
|
||||
|
|
|
@ -44,9 +44,6 @@ include Action_intf.Helpers
|
|||
val t : t Sexp.Of_sexp.t
|
||||
val sexp_of_t : t Sexp.To_sexp.t
|
||||
|
||||
(** Return the list of files under an [Update_file] *)
|
||||
val updated_files : t -> Path.Set.t
|
||||
|
||||
(** Return the list of directories the action chdirs to *)
|
||||
val chdirs : t -> Path.Set.t
|
||||
|
||||
|
|
|
@ -672,13 +672,8 @@ let rec compile_rule t ?(copy_source=false) pre_rule =
|
|||
List.exists targets_as_list ~f:Path.is_alias_stamp_file
|
||||
in
|
||||
if deps_or_rule_changed || targets_missing || force then (
|
||||
(* Do not remove files that are just updated, otherwise this would break incremental
|
||||
compilation *)
|
||||
let targets_to_remove =
|
||||
Pset.diff targets (Action.updated_files action)
|
||||
in
|
||||
Pset.iter targets_to_remove ~f:Path.unlink_no_err;
|
||||
pending_targets := Pset.union targets_to_remove !pending_targets;
|
||||
List.iter targets_as_list ~f:Path.unlink_no_err;
|
||||
pending_targets := Pset.union targets !pending_targets;
|
||||
let action =
|
||||
match sandbox_dir with
|
||||
| Some sandbox_dir ->
|
||||
|
@ -703,7 +698,7 @@ let rec compile_rule t ?(copy_source=false) pre_rule =
|
|||
Action.exec ?context ~targets action) >>| fun () ->
|
||||
Option.iter sandbox_dir ~f:Path.rm_rf;
|
||||
(* All went well, these targets are no longer pending *)
|
||||
pending_targets := Pset.diff !pending_targets targets_to_remove;
|
||||
pending_targets := Pset.diff !pending_targets targets;
|
||||
clear_targets_digests_after_rule_execution targets_as_list;
|
||||
match mode with
|
||||
| Standard | Fallback | Not_a_rule_stanza | Ignore_source_files -> ()
|
||||
|
|
Loading…
Reference in New Issue