From 2ff05385dc8a4db287617067ecc13188bdb99f23 Mon Sep 17 00:00:00 2001 From: Jules Villard Date: Wed, 15 Nov 2017 12:42:42 -0800 Subject: [PATCH] [driver] do not run the analysis in Buck flavors sub-processes Summary: `infer capture -a checkers ...` would accidentally trigger the analysis phase. This crashes the Buck flavors integration when used with `--reactive` because .start never gets created in the infer-out-* subfolders of buck-out. Reviewed By: dulmarod Differential Revision: D6336072 fbshipit-source-id: af0ab5e --- infer/src/backend/InferAnalyze.ml | 1 - infer/src/integration/Driver.ml | 13 ++++++------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/infer/src/backend/InferAnalyze.ml b/infer/src/backend/InferAnalyze.ml index bcb9f3096..2784b8179 100644 --- a/infer/src/backend/InferAnalyze.ml +++ b/infer/src/backend/InferAnalyze.ml @@ -189,4 +189,3 @@ let register_perf_stats_report () = let stats_base = Config.perf_stats_prefix ^ Filename.basename cluster ^ ".json" in let stats_file = Filename.concat stats_dir stats_base in PerfStats.register_report_at_exit stats_file - diff --git a/infer/src/integration/Driver.ml b/infer/src/integration/Driver.ml index b9b828776..86ea7d06e 100644 --- a/infer/src/integration/Driver.ml +++ b/infer/src/integration/Driver.ml @@ -382,19 +382,19 @@ let report ?(suppress_console= false) () = let analyze_and_report ?suppress_console_report ~changed_files mode = let should_analyze, should_report = - match (mode, Config.analyzer) with - | PythonCapture (BBuck, _), _ when not Config.flavors -> + match (Config.command, mode, Config.analyzer) with + | _, PythonCapture (BBuck, _), _ when not Config.flavors -> (* In Buck mode when compilation db is not used, analysis is invoked from capture if buck flavors are not used *) (false, false) | _ when Config.infer_is_clang || Config.infer_is_javac -> (* Called from another integration to do capture only. *) (false, false) - | _, (CaptureOnly | CompileOnly) -> + | _, _, Linters -> + (false, true) + | (Capture | Compile), _, _ | _, _, (CaptureOnly | CompileOnly) -> (false, false) - | _, (BiAbduction | Checkers | Crashcontext) -> + | _, _, (BiAbduction | Checkers | Crashcontext) -> (true, true) - | _, Linters -> - (false, true) in let should_merge = match mode with @@ -579,4 +579,3 @@ let read_config_changed_files () = | Error error -> L.external_error "Error reading the changed files index '%s': %s@." index error ; None -