[oops] do not report in analysis sub-processes

Summary:
Introduce a new option `--no-report` (conversely `--report`) to stop reporting
after the analysis. This is useful to call sub-`infer-analyze` processes with
as they shouldn't compute "result.json" or report bugs to stderr. This bug
would only manifest itself when per-procedure parallelism disabled, which
explains why it was noticed only on Java.

Reviewed By: jberdine

Differential Revision: D5182110

fbshipit-source-id: a892470
master
Jules Villard 8 years ago committed by Facebook Github Bot
parent 6f0911c157
commit a121e4bb01

@ -24,7 +24,7 @@ let pp_prolog fmt clusters =
let compilation_dbs_cmd = let compilation_dbs_cmd =
List.map ~f:infer_flag_of_compilation_db !Config.clang_compilation_dbs List.map ~f:infer_flag_of_compilation_db !Config.clang_compilation_dbs
|> String.concat ~sep:" " |> escape in |> String.concat ~sep:" " |> escape in
F.fprintf fmt "INFERANALYZE = '%s' --results-dir '%s' %s@\n@\n" F.fprintf fmt "INFERANALYZE = '%s' --no-report --results-dir '%s' %s@\n@\n"
(Config.bin_dir ^/ CommandDoc.exe_name_of_command CLOpt.Analyze) (Config.bin_dir ^/ CommandDoc.exe_name_of_command CLOpt.Analyze)
(escape Config.results_dir) (escape Config.results_dir)
compilation_dbs_cmd; compilation_dbs_cmd;

@ -387,7 +387,7 @@ let analyze driver_mode =
L.stderr "There was nothing to analyze.@\n@." ; L.stderr "There was nothing to analyze.@\n@." ;
) else if should_analyze then ) else if should_analyze then
execute_analyze (); execute_analyze ();
if should_report then report () if should_report && Config.report then report ()
(** as the Config.fail_on_bug flag mandates, exit with error when an issue is reported *) (** as the Config.fail_on_bug flag mandates, exit with error when an issue is reported *)
let fail_on_issue_epilogue () = let fail_on_issue_epilogue () =

@ -1302,6 +1302,11 @@ and reactive_capture =
CLOpt.mk_bool ~long:"reactive-capture" CLOpt.mk_bool ~long:"reactive-capture"
"Compile source files only when required by analyzer (clang only)" "Compile source files only when required by analyzer (clang only)"
and report =
CLOpt.mk_bool ~long:"report" ~default:true
~in_help:CLOpt.[Analyze, manual_generic; Run, manual_generic]
"Run the reporting phase once the analysis has completed"
and report_current = and report_current =
CLOpt.mk_path_opt ~long:"report-current" ~in_help:CLOpt.[ReportDiff, manual_generic] CLOpt.mk_path_opt ~long:"report-current" ~in_help:CLOpt.[ReportDiff, manual_generic]
"report of the latest revision" "report of the latest revision"
@ -1878,6 +1883,7 @@ and quiet = !quiet
and reactive_mode = !reactive and reactive_mode = !reactive
and reactive_capture = !reactive_capture and reactive_capture = !reactive_capture
and repeated_calls = !repeated_calls and repeated_calls = !repeated_calls
and report = !report
and report_current = !report_current and report_current = !report_current
and report_custom_error = !report_custom_error and report_custom_error = !report_custom_error
and report_formatter = !report_formatter and report_formatter = !report_formatter

@ -129,6 +129,7 @@ val per_procedure_parallelism : bool
val perf_stats_prefix : string val perf_stats_prefix : string
val proc_stats_filename : string val proc_stats_filename : string
val property_attributes : string val property_attributes : string
val report : bool
val report_condition_always_true_in_clang : bool val report_condition_always_true_in_clang : bool
val report_custom_error : bool val report_custom_error : bool
val report_nullable_inconsistency : bool val report_nullable_inconsistency : bool

Loading…
Cancel
Save