From 42cb733c6ac0f8a9d9927b4d3cd5db3c24f428ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20Dimino?= Date: Fri, 19 May 2017 01:44:42 +0100 Subject: [PATCH] Remove --debug-{actions,rules} They are superseeded by 'jbuilder rules' --- bin/main.ml | 24 ----------------------- src/build_system.ml | 48 +-------------------------------------------- src/clflags.ml | 2 -- src/clflags.mli | 6 ------ src/main.ml | 1 - 5 files changed, 1 insertion(+), 80 deletions(-) diff --git a/bin/main.ml b/bin/main.ml index 48843b29..d3fef6e4 100644 --- a/bin/main.ml +++ b/bin/main.ml @@ -10,8 +10,6 @@ let (>>=) = Future.(>>=) type common = { concurrency : int - ; debug_rules : bool - ; debug_actions : bool ; debug_dep_path : bool ; debug_findlib : bool ; dev_mode : bool @@ -26,8 +24,6 @@ let prefix_target common s = common.target_prefix ^ s let set_common c = Clflags.concurrency := c.concurrency; - Clflags.debug_rules := c.debug_rules; - Clflags.debug_actions := c.debug_actions; Clflags.debug_dep_path := c.debug_dep_path; Clflags.debug_findlib := c.debug_findlib; Clflags.dev_mode := c.dev_mode; @@ -96,8 +92,6 @@ let help_secs = let common = let make concurrency - debug_rules - debug_actions debug_dep_path debug_findlib dev_mode @@ -111,8 +105,6 @@ let common = | None -> find_root () in { concurrency - ; debug_rules - ; debug_actions ; debug_dep_path ; debug_findlib ; dev_mode @@ -143,20 +135,6 @@ let common = contains several packages.|} ) in - let drules = - Arg.(value - & flag - & info ["debug-rules"] ~docs - ~doc:"Print all internal rules." - ) - in - let dactions = - Arg.(value - & flag - & info ["debug-actions"] ~docs - ~doc:"Print out internal actions." - ) - in let ddep_path = Arg.(value & flag @@ -230,8 +208,6 @@ let common = in Term.(const make $ concurrency - $ drules - $ dactions $ ddep_path $ dfindlib $ dev diff --git a/src/build_system.ml b/src/build_system.ml index c42baa5b..d993c16a 100644 --- a/src/build_system.ml +++ b/src/build_system.ml @@ -104,12 +104,6 @@ type limit_timestamp = ; limit : float option } -let sexp_of_limit_timestamp lt = - Sexp.To_sexp.(record - [ "missing_files" , bool lt.missing_files - ; "limit" , option float lt.limit - ]) - let merge_timestamp t fns ~merge = let init = { missing_files = false @@ -368,30 +362,6 @@ let compile_rule t ~all_targets_by_dir ?(allow_override=false) pre_rule = } = Build_interpret.static_deps build ~all_targets_by_dir in - if !Clflags.debug_rules then begin - let f set = - Pset.elements set - |> List.map ~f:Path.to_string - |> String.concat ~sep:", " - in - let deps = Pset.union rule_deps static_deps in - let lib_deps = Build_interpret.lib_deps build in - if Pmap.is_empty lib_deps then - Printf.eprintf "{%s} -> {%s}\n" (f deps) (f targets) - else - let lib_deps = - Pmap.fold lib_deps ~init:String_map.empty ~f:(fun ~key:_ ~data acc -> - Build.merge_lib_deps acc data) - |> String_map.bindings - |> List.map ~f:(fun (name, kind) -> - match (kind : Build.lib_dep_kind) with - | Required -> name - | Optional -> sprintf "%s (optional)" name) - |> String.concat ~sep:", " - in - Printf.eprintf "{%s}, libs:{%s} -> {%s}\n" (f deps) lib_deps (f targets) - end; - let exec = Exec_status.Not_started (fun ~targeting -> make_local_parent_dirs t targets ~map_path:(fun x -> x); Future.both @@ -404,9 +374,6 @@ let compile_rule t ~all_targets_by_dir ?(allow_override=false) pre_rule = (action, dyn_deps)) >>= fun ((), (action, dyn_deps)) -> let all_deps = Pset.union static_deps dyn_deps in - if !Clflags.debug_actions then - Format.eprintf "@{Action@}: %s@." - (Sexp.to_string (Action.sexp_of_t action)); let all_deps_as_list = Pset.elements all_deps in let targets_as_list = Pset.elements targets in let hash = @@ -452,8 +419,6 @@ let compile_rule t ~all_targets_by_dir ?(allow_override=false) pre_rule = { limit = Some targets_min; missing_files = false } -> targets_min < deps_max then ( - if !Clflags.debug_actions then - Format.eprintf "@{Action@}: -> running action@."; (* Do not remove files that are just updated, otherwise this would break incremental compilation *) let targets_to_remove = @@ -486,19 +451,8 @@ let compile_rule t ~all_targets_by_dir ?(allow_override=false) pre_rule = (* All went well, these targets are no longer pending *) pending_targets := Pset.diff !pending_targets targets_to_remove; refresh_targets_timestamps_after_rule_execution t targets_as_list - ) else ( - if !Clflags.debug_actions then - Format.eprintf - "@{Action@}: -> not running action as targets are up-to-date@\n\ - @{Action@}: -> @[%a@]@." - Sexp.pp - (Sexp.To_sexp.(record - [ "rule_changed" , bool rule_changed - ; "targets_min_ts" , sexp_of_limit_timestamp targets_min_ts - ; "deps_max_ts" , sexp_of_limit_timestamp deps_max_ts - ])); + ) else return () - ) ) in let rule = { Internal_rule. diff --git a/src/clflags.ml b/src/clflags.ml index 18b74e8a..011dbb1a 100644 --- a/src/clflags.ml +++ b/src/clflags.ml @@ -1,8 +1,6 @@ let concurrency = ref 4 (*let ocaml_comp_flags = ref ["-g"]*) let g = ref true -let debug_rules = ref false -let debug_actions = ref false let verbose = ref false let debug_findlib = ref false let warnings = ref "-40" diff --git a/src/clflags.mli b/src/clflags.mli index 823fd537..6a43713d 100644 --- a/src/clflags.mli +++ b/src/clflags.mli @@ -9,12 +9,6 @@ val concurrency : int ref (** [-g] *) val g : bool ref -(** Print rules *) -val debug_rules : bool ref - -(** Print actions *) -val debug_actions : bool ref - (** Print executed commands verbosely *) val verbose : bool ref diff --git a/src/main.ml b/src/main.ml index 20ec6979..9cef4904 100644 --- a/src/main.ml +++ b/src/main.ml @@ -186,7 +186,6 @@ let bootstrap () = Arg.parse [ "-j" , Set_int Clflags.concurrency, "JOBS concurrency" ; "--dev" , Set Clflags.dev_mode , " set development mode" - ; "--debug-rules", Set Clflags.debug_rules , " print out rules" ; "--verbose" , Set Clflags.verbose , " print detailed information about commands being run" ; "--subst" , Unit subst , " substitute watermarks in source files" ]