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