Skip to content

Commit ed0c550

Browse files
jeremydubreilfacebook-github-bot
authored andcommitted
[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
1 parent 8162cf8 commit ed0c550

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

DEFS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ def create_infer_genrule(
4040
srcs=srcs,
4141
cmd = ' '.join([
4242
os.getenv('INFER_BIN', 'infer'),
43+
'--genrule-mode',
4344
'--project-root', os.getenv('PROJECT_ROOT', os.environ['PWD']),
4445
'--eradicate-only',
4546
'--results-dir', '$OUT',

infer/src/base/Config.ml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1346,6 +1346,11 @@ and generated_classes =
13461346
"Specify where to load the generated class files"
13471347

13481348

1349+
and genrule_mode =
1350+
CLOpt.mk_bool ~default:false ~long:"genrule-mode"
1351+
"Enable the genrule compatibility mode used for the Buck integration"
1352+
1353+
13491354
and headers =
13501355
CLOpt.mk_bool ~deprecated:["headers"; "hd"] ~deprecated_no:["no_headers"; "nhd"] ~long:"headers"
13511356
~in_help:InferCommand.[(Capture, manual_clang)]
@@ -2428,7 +2433,7 @@ and buck = !buck
24282433

24292434
and buck_build_args = !buck_build_args
24302435

2431-
and buck_cache_mode = !buck && not !debug
2436+
and buck_cache_mode = (!buck || !genrule_mode) && not !debug
24322437

24332438
and buck_compilation_database =
24342439
match !buck_compilation_database with

0 commit comments

Comments
 (0)