From ed0c5509050f294f08ce2c298b97ad2aaf770ec6 Mon Sep 17 00:00:00 2001 From: Jeremy Dubreil Date: Wed, 9 May 2018 23:25:08 -0700 Subject: [PATCH] [infer][genrule] add an option to make the genrule integration compatible with the Buck cache Summary: When passing `--genrule-mode` option, Infer will remove the logs and the other kind of data that are not compatible with the Buck distributed cache. Reviewed By: mbouaziz Differential Revision: D7943346 fbshipit-source-id: 4e7ca4d --- DEFS | 1 + infer/src/base/Config.ml | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/DEFS b/DEFS index 7e3650fd7..bebab3220 100644 --- a/DEFS +++ b/DEFS @@ -40,6 +40,7 @@ def create_infer_genrule( srcs=srcs, cmd = ' '.join([ os.getenv('INFER_BIN', 'infer'), + '--genrule-mode', '--project-root', os.getenv('PROJECT_ROOT', os.environ['PWD']), '--eradicate-only', '--results-dir', '$OUT', diff --git a/infer/src/base/Config.ml b/infer/src/base/Config.ml index bd6077afd..dc09755f4 100644 --- a/infer/src/base/Config.ml +++ b/infer/src/base/Config.ml @@ -1346,6 +1346,11 @@ and generated_classes = "Specify where to load the generated class files" +and genrule_mode = + CLOpt.mk_bool ~default:false ~long:"genrule-mode" + "Enable the genrule compatibility mode used for the Buck integration" + + and headers = CLOpt.mk_bool ~deprecated:["headers"; "hd"] ~deprecated_no:["no_headers"; "nhd"] ~long:"headers" ~in_help:InferCommand.[(Capture, manual_clang)] @@ -2428,7 +2433,7 @@ and buck = !buck and buck_build_args = !buck_build_args -and buck_cache_mode = !buck && not !debug +and buck_cache_mode = (!buck || !genrule_mode) && not !debug and buck_compilation_database = match !buck_compilation_database with