Remove --debug-{actions,rules}
They are superseeded by 'jbuilder rules'
This commit is contained in:
parent
00ddd7f7a2
commit
42cb733c6a
24
bin/main.ml
24
bin/main.ml
|
@ -10,8 +10,6 @@ let (>>=) = Future.(>>=)
|
||||||
|
|
||||||
type common =
|
type common =
|
||||||
{ concurrency : int
|
{ concurrency : int
|
||||||
; debug_rules : bool
|
|
||||||
; debug_actions : bool
|
|
||||||
; debug_dep_path : bool
|
; debug_dep_path : bool
|
||||||
; debug_findlib : bool
|
; debug_findlib : bool
|
||||||
; dev_mode : bool
|
; dev_mode : bool
|
||||||
|
@ -26,8 +24,6 @@ let prefix_target common s = common.target_prefix ^ s
|
||||||
|
|
||||||
let set_common c =
|
let set_common c =
|
||||||
Clflags.concurrency := c.concurrency;
|
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_dep_path := c.debug_dep_path;
|
||||||
Clflags.debug_findlib := c.debug_findlib;
|
Clflags.debug_findlib := c.debug_findlib;
|
||||||
Clflags.dev_mode := c.dev_mode;
|
Clflags.dev_mode := c.dev_mode;
|
||||||
|
@ -96,8 +92,6 @@ let help_secs =
|
||||||
let common =
|
let common =
|
||||||
let make
|
let make
|
||||||
concurrency
|
concurrency
|
||||||
debug_rules
|
|
||||||
debug_actions
|
|
||||||
debug_dep_path
|
debug_dep_path
|
||||||
debug_findlib
|
debug_findlib
|
||||||
dev_mode
|
dev_mode
|
||||||
|
@ -111,8 +105,6 @@ let common =
|
||||||
| None -> find_root ()
|
| None -> find_root ()
|
||||||
in
|
in
|
||||||
{ concurrency
|
{ concurrency
|
||||||
; debug_rules
|
|
||||||
; debug_actions
|
|
||||||
; debug_dep_path
|
; debug_dep_path
|
||||||
; debug_findlib
|
; debug_findlib
|
||||||
; dev_mode
|
; dev_mode
|
||||||
|
@ -143,20 +135,6 @@ let common =
|
||||||
contains several packages.|}
|
contains several packages.|}
|
||||||
)
|
)
|
||||||
in
|
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 =
|
let ddep_path =
|
||||||
Arg.(value
|
Arg.(value
|
||||||
& flag
|
& flag
|
||||||
|
@ -230,8 +208,6 @@ let common =
|
||||||
in
|
in
|
||||||
Term.(const make
|
Term.(const make
|
||||||
$ concurrency
|
$ concurrency
|
||||||
$ drules
|
|
||||||
$ dactions
|
|
||||||
$ ddep_path
|
$ ddep_path
|
||||||
$ dfindlib
|
$ dfindlib
|
||||||
$ dev
|
$ dev
|
||||||
|
|
|
@ -104,12 +104,6 @@ type limit_timestamp =
|
||||||
; limit : float option
|
; 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 merge_timestamp t fns ~merge =
|
||||||
let init =
|
let init =
|
||||||
{ missing_files = false
|
{ 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
|
} = Build_interpret.static_deps build ~all_targets_by_dir
|
||||||
in
|
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 ->
|
let exec = Exec_status.Not_started (fun ~targeting ->
|
||||||
make_local_parent_dirs t targets ~map_path:(fun x -> x);
|
make_local_parent_dirs t targets ~map_path:(fun x -> x);
|
||||||
Future.both
|
Future.both
|
||||||
|
@ -404,9 +374,6 @@ let compile_rule t ~all_targets_by_dir ?(allow_override=false) pre_rule =
|
||||||
(action, dyn_deps))
|
(action, dyn_deps))
|
||||||
>>= fun ((), (action, dyn_deps)) ->
|
>>= fun ((), (action, dyn_deps)) ->
|
||||||
let all_deps = Pset.union static_deps dyn_deps in
|
let all_deps = Pset.union static_deps dyn_deps in
|
||||||
if !Clflags.debug_actions then
|
|
||||||
Format.eprintf "@{<debug>Action@}: %s@."
|
|
||||||
(Sexp.to_string (Action.sexp_of_t action));
|
|
||||||
let all_deps_as_list = Pset.elements all_deps in
|
let all_deps_as_list = Pset.elements all_deps in
|
||||||
let targets_as_list = Pset.elements targets in
|
let targets_as_list = Pset.elements targets in
|
||||||
let hash =
|
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 } ->
|
{ limit = Some targets_min; missing_files = false } ->
|
||||||
targets_min < deps_max
|
targets_min < deps_max
|
||||||
then (
|
then (
|
||||||
if !Clflags.debug_actions then
|
|
||||||
Format.eprintf "@{<debug>Action@}: -> running action@.";
|
|
||||||
(* Do not remove files that are just updated, otherwise this would break incremental
|
(* Do not remove files that are just updated, otherwise this would break incremental
|
||||||
compilation *)
|
compilation *)
|
||||||
let targets_to_remove =
|
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 *)
|
(* 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_to_remove;
|
||||||
refresh_targets_timestamps_after_rule_execution t targets_as_list
|
refresh_targets_timestamps_after_rule_execution t targets_as_list
|
||||||
) else (
|
) else
|
||||||
if !Clflags.debug_actions then
|
|
||||||
Format.eprintf
|
|
||||||
"@{<debug>Action@}: -> not running action as targets are up-to-date@\n\
|
|
||||||
@{<debug>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
|
|
||||||
]));
|
|
||||||
return ()
|
return ()
|
||||||
)
|
|
||||||
) in
|
) in
|
||||||
let rule =
|
let rule =
|
||||||
{ Internal_rule.
|
{ Internal_rule.
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
let concurrency = ref 4
|
let concurrency = ref 4
|
||||||
(*let ocaml_comp_flags = ref ["-g"]*)
|
(*let ocaml_comp_flags = ref ["-g"]*)
|
||||||
let g = ref true
|
let g = ref true
|
||||||
let debug_rules = ref false
|
|
||||||
let debug_actions = ref false
|
|
||||||
let verbose = ref false
|
let verbose = ref false
|
||||||
let debug_findlib = ref false
|
let debug_findlib = ref false
|
||||||
let warnings = ref "-40"
|
let warnings = ref "-40"
|
||||||
|
|
|
@ -9,12 +9,6 @@ val concurrency : int ref
|
||||||
(** [-g] *)
|
(** [-g] *)
|
||||||
val g : bool ref
|
val g : bool ref
|
||||||
|
|
||||||
(** Print rules *)
|
|
||||||
val debug_rules : bool ref
|
|
||||||
|
|
||||||
(** Print actions *)
|
|
||||||
val debug_actions : bool ref
|
|
||||||
|
|
||||||
(** Print executed commands verbosely *)
|
(** Print executed commands verbosely *)
|
||||||
val verbose : bool ref
|
val verbose : bool ref
|
||||||
|
|
||||||
|
|
|
@ -186,7 +186,6 @@ let bootstrap () =
|
||||||
Arg.parse
|
Arg.parse
|
||||||
[ "-j" , Set_int Clflags.concurrency, "JOBS concurrency"
|
[ "-j" , Set_int Clflags.concurrency, "JOBS concurrency"
|
||||||
; "--dev" , Set Clflags.dev_mode , " set development mode"
|
; "--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"
|
; "--verbose" , Set Clflags.verbose , " print detailed information about commands being run"
|
||||||
; "--subst" , Unit subst , " substitute watermarks in source files"
|
; "--subst" , Unit subst , " substitute watermarks in source files"
|
||||||
]
|
]
|
||||||
|
|
Loading…
Reference in New Issue