Added --debug-action
This commit is contained in:
parent
adf423a595
commit
581c63f6ca
12
bin/main.ml
12
bin/main.ml
|
@ -11,6 +11,7 @@ let (>>=) = Future.(>>=)
|
|||
type common =
|
||||
{ concurrency : int
|
||||
; debug_rules : bool
|
||||
; debug_actions : bool
|
||||
; debug_dep_path : bool
|
||||
; debug_findlib : bool
|
||||
; dev_mode : bool
|
||||
|
@ -25,6 +26,7 @@ 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;
|
||||
|
@ -111,6 +113,7 @@ let common =
|
|||
concurrency
|
||||
only_packages
|
||||
debug_rules
|
||||
debug_actions
|
||||
debug_dep_path
|
||||
debug_findlib
|
||||
dev_mode
|
||||
|
@ -124,6 +127,7 @@ let common =
|
|||
in
|
||||
{ concurrency
|
||||
; debug_rules
|
||||
; debug_actions
|
||||
; debug_dep_path
|
||||
; debug_findlib
|
||||
; dev_mode
|
||||
|
@ -160,6 +164,13 @@ let common =
|
|||
~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
|
||||
|
@ -199,6 +210,7 @@ let common =
|
|||
$ concurrency
|
||||
$ only_packages
|
||||
$ drules
|
||||
$ dactions
|
||||
$ ddep_path
|
||||
$ dfindlib
|
||||
$ dev
|
||||
|
|
|
@ -168,13 +168,14 @@ let setup_env_for_ocaml_colors = lazy(
|
|||
)
|
||||
|
||||
let styles_of_tag = function
|
||||
| "loc" -> [Bold]
|
||||
| "error" -> [Bold; Foreground Red]
|
||||
| "loc" -> [Bold]
|
||||
| "error" -> [Bold; Foreground Red]
|
||||
| "warning" -> [Bold; Foreground Magenta]
|
||||
| "kwd" -> [Bold; Foreground Blue]
|
||||
| "id" -> [Bold; Foreground Yellow]
|
||||
| "prompt" -> [Bold; Foreground Green]
|
||||
| _ -> []
|
||||
| "kwd" -> [Bold; Foreground Blue]
|
||||
| "id" -> [Bold; Foreground Yellow]
|
||||
| "prompt" -> [Bold; Foreground Green]
|
||||
| "debug" -> [Underlined; Foreground Bright_cyan]
|
||||
| _ -> []
|
||||
|
||||
let setup_err_formatter_colors () =
|
||||
let open Format in
|
||||
|
|
|
@ -254,6 +254,9 @@ let compile_rule t ~all_targets_by_dir ?(allow_override=false) pre_rule =
|
|||
>>= fun () ->
|
||||
Build_exec.exec t build () ~targeting
|
||||
>>= fun action ->
|
||||
if !Clflags.debug_actions then
|
||||
Format.eprintf "@{<debug>Action@}: %s@."
|
||||
(Sexp.to_string (Action.sexp_of_t action));
|
||||
Action.exec action
|
||||
) in
|
||||
let rule =
|
||||
|
|
|
@ -2,6 +2,7 @@ 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 debug_run = ref true
|
||||
let debug_findlib = ref false
|
||||
let warnings = ref "-40"
|
||||
|
|
|
@ -12,6 +12,9 @@ val g : bool ref
|
|||
(** Print rules *)
|
||||
val debug_rules : bool ref
|
||||
|
||||
(** Print actions *)
|
||||
val debug_actions : bool ref
|
||||
|
||||
(** Print executed commands *)
|
||||
val debug_run : bool ref
|
||||
|
||||
|
|
Loading…
Reference in New Issue