Open antonqiu opened 5 years ago
Hi @antonqiu , I'm having similar issues in running the reactive/differential workflow.
Did you solve yours?
@micheletufano
Basically, there's a file infer-out/results.db
that marks the staleness of captured files. Capture run with --reactive
would add newly discovered files to the db and mark old files stale. Analyze run with --reactive
would analyze non-stale files.
From my understanding:
infer capture
--reactive
: preserve all captured procedures and source files. Otherwise, infer-out/results.db
is wiped out and rebuilt.
--continue
: prevents previously captured files being marked as stale.
infer analyze
--reactive
: analyze source files marked as fresh
--changed_file_index
: only analyze files specified in the index, regardless of their staleness markers. This essentially overrides --reactive
, in my opinion.
Edit: about your question in another issue. Based on how Infer works through files, I don't think its results are strictly deterministic. I sort of remember they mention it somewhere in the doc.
Hi @antonqiu ,
This actually helped.
For my purpose, I ended up removing the --reactive
options (both for capture
and analyze
) when looping through the commits, and used only the --changed_file_index
for the changed files in the commit.
In that way I have more consistent results. When using the --reactive
option the bugs were sometimes double counted and accumulated (probably due to keeping the results.db
file).
Overall, I do agree with the original goal of this issue that better documentation is needed.
Hi Team,
I was trying to understand the effect of
--reactive
flag ininfer run
,infer capture
andinfer analyze
, but got conflicting information from theGet Started
guide and manual.From man:
However, in Recommended flow for CI,
infer capture --reactive -- make -j 4
Apparently, one can also specify--reactive
withinfer capture
, althoughman infer-capture
doesn't have an entry for it.What is its effect? Does it simply retain the
infer-out
folder and additively collect compiling artifacts?infer analyze --reactive --changed-files-index index.txt
"Reactive mode: the analysis starts from the files captured since the infer command started."I do understand it in the context of
infer run
, but ininfer analyze
, there are no "files captured since the infer command started".What's a more accurate explanation of the effect of
--reactive
ininfer-analyze
?infer analyze --changed-files-index index.txt
"Specify the file containing the list of source files from which reactive analysis should start."But it seems like
--changed-files-index
can be specified without--reactive
.Thanks!