The command line option --incremental-analysis (and --continue-analysis as well) results in no files being analyzed.
It seems that there isn't any article about the use of the arguments, and the help message is not quite intuitive.
Also, the "incremental" analysis of Infer often refer to -r mode, which is s bit incremental but deletes all specs ahead of analysis.
What is the correct way to use those two arguments for real incremental analysis that only analyzes changed procedures and those that depend on them (NOT those they depend on)? Thanks~
[x] The version of infer from infer --version: v1.1.0-4c6dc7053 (needed to add some traces so having to build from the source).
[x] Your operating system and version: Ubuntu 20.04.4 LTS (GNU/Linux 5.4.0-110-generic x86_64).
[x] Which command you ran:
make clean
inferc run --meowcat-only -- make
touch b.c # or edit some procedure for real, irrelevant but still tested
infer run --incremental-analysis -r --meowcat-only --changed-files-index b.txt -- make
[x] The full output in a paste:
$ make clean
rm -f a.o b.o c.o meow
$ inferc run --meowcat-only -- make
Capturing in make/cc mode...
cc a.c -o a.o -c
cc b.c -o b.o -c
cc c.c -o c.o -c
cc a.o b.o c.o -o meow
Done.
Found 3 source files to analyze in /root/tinfer/_make/infer-out
3/3 100% 6.098ms
$ touch b.c # or edit some procedure for real, irrelevant but still tested
$ infer run --incremental-analysis -r --meowcat-only --changed-files-index b.txt -- make
Incremental analysis: invalidating procedures that have been changed
Incremental analysis: 4 nodes in reverse analysis call graph, 2 of which were invalidated
Capturing in make/cc mode...
Done.
Nothing to compile. Try running make clean first.
There was nothing to analyze.
- [x] If possible, a minimal example to reproduce your problem:
As shown in the mysteries `--meowcat-only`, we've added a dummy checker `meowcat` to print and record traces. Moving them to any existing checkers and change the argument to `--xxx-only` yield the same result. Actually, no checkers have been run at this point.
No else changes were made to the source code.
Here is our test project:
a.c
```c
#include <stdio.h>
#include "a.h"
#include "b.h"
int main() {
printf("%d\n", funcB(0));
return 0;
}
b.c
#include "b.h"
#include "c.h"
int funcB(int a) {
return funcC(a + 2) + funcC(a + 1);
}//
Besides the mentioned commands, many other sequences of commands with different arguments _e.g. with or without -r) were also tested automatically. The behavior --continue-analysis is slightly different, so we could focus on --incremental-analysis for now.
The command line option
--incremental-analysis
(and--continue-analysis
as well) results in no files being analyzed. It seems that there isn't any article about the use of the arguments, and the help message is not quite intuitive. Also, the "incremental" analysis of Infer often refer to-r
mode, which is s bit incremental but deletes all specs ahead of analysis.What is the correct way to use those two arguments for real incremental analysis that only analyzes changed procedures and those that depend on them (NOT those they depend on)? Thanks~
infer --version
: v1.1.0-4c6dc7053 (needed to add some traces so having to build from the source).$ inferc run --meowcat-only -- make Capturing in make/cc mode... cc a.c -o a.o -c cc b.c -o b.o -c cc c.c -o c.o -c cc a.o b.o c.o -o meow Done. Found 3 source files to analyze in /root/tinfer/_make/infer-out 3/3 100% 6.098ms
$ touch b.c # or edit some procedure for real, irrelevant but still tested
$ infer run --incremental-analysis -r --meowcat-only --changed-files-index b.txt -- make Incremental analysis: invalidating procedures that have been changed Incremental analysis: 4 nodes in reverse analysis call graph, 2 of which were invalidated Capturing in make/cc mode... Done. Nothing to compile. Try running
make clean
first. There was nothing to analyze.b.c
c.c
a.h
b.h
c.h
Makefile
Besides the mentioned commands, many other sequences of commands with different arguments _e.g. with or without
-r
) were also tested automatically. The behavior--continue-analysis
is slightly different, so we could focus on--incremental-analysis
for now.