Summary:
public
When no classpath was specified, Infer were considering it to be None instead of the current directory. The consequence is that we were replacing the current directory with the annotation processor for suppress warnings, leading to cases where `javac` was compiling fine but `infer -- javac` was failing with classes not found compilation issues. This diff fixes by always having at least "." in the classpath.
Reviewed By: sblackshear
Differential Revision: D2853035
fb-gh-sync-id: e69db7c
Summary:
public
I previously forgot to keep this feature when deleting BuckAnalyze.
Reviewed By: sblackshear
Differential Revision: D2850869
fb-gh-sync-id: d23f1ca
Summary:
public
The script `BuckAnalyze` has been deprecated for a while already. Time to remove it.
Reviewed By: sblackshear
Differential Revision: D2844414
fb-gh-sync-id: b5e1195
Summary:
public
The code to configure to configure the logging was duplicated, but was not not doing exactly the same thing. This diff makes all the code to call the same configuration function.
Reviewed By: sblackshear
Differential Revision: D2844361
fb-gh-sync-id: 9887cad
Summary:
This will stop Infer from creating an `infer-out` directory when just running `infer`.
(I run `infer` without any arguments somewhat often to look at documenting.)
One downside to this is that there will be no logs when running Infer without any commands - is this bad?
Closes https://github.com/facebook/infer/pull/240
Reviewed By: cristianoc
Differential Revision: D2829752
Pulled By: jeremydubreil
fb-gh-sync-id: 6827ef9
Summary:
public
In the case of Buck, the integration works by using the out directory of javac in order to store the analysis artifacts in the jar file. Making buck call:
infer -o infer_out -- javac -d classes_out ...
instead of every javac command is having no effect and is the same as Buck running:
infer -- javac -d classes_out ...
Reviewed By: sblackshear
Differential Revision: D2822642
fb-gh-sync-id: b13e067
Summary:
public
In the case of Java, the name of the method is enough to lookup the summary of the callees and run the symbolic execution. This revision separates the case of method call in Java and in C, C++ and Objective C. Most of the code for executing method calls was Clang specific and this is an intermediate step to be able to run the capture and analysis on demand.
Reviewed By: sblackshear
Differential Revision: D2809171
fb-gh-sync-id: da62dce
Summary:
public
`json.dump` does not have the same number of arguments in 2.7.3 and 2.7.9. Fix
this by naming the optional parameters explicitly.
Reviewed By: akotulski
Differential Revision: D2760579
fb-gh-sync-id: 7ebc69e
Summary: public
Since we are only running the analysis on the Buck targets that are of type java_library or android_library, it may happen that the filtering gives an empty list of targets.
This diff does two things:
1) it filters out the empty strings `''` that can be returned when parsing the `buck query` command, and
2) skip the analysis when the list of targets to analyze is empty.
It also fixes the debug output for the list of targets to analyze, which was previously always printing the list of targets passed in the command line argument, which led for this issue to be unoticed even though it may have been there for a while already.
Reviewed By: sblackshear
Differential Revision: D2704949
fb-gh-sync-id: 83c62d8
Summary: public
With this change it will be possible to instruct Buck to not analyze certain files whose names match
with the regex passed in input.
So for example if you want to skip the analysis of files containing `skip_me` on their names, then
the command:
infer --use-flavors --blacklist-regex ".*skip_me.*" -- buck build <target-name>
will do it, because the `.*skip_me.*` regex will match the desired rule.
Reviewed By: jvillard
Differential Revision: D2702872
fb-gh-sync-id: 498b17b
Summary: public
When merging json reports from different buck targets, the same bug may be
reported several times.
Clean up some bug sorting functions while I'm at it.
Reviewed By: martinoluca
Differential Revision: D2690665
fb-gh-sync-id: 4a12072
Summary: public
-Wno-error flag doesn't turn off errors which were turned on using -Werror=$WARN_TYPE.
In order to turn these off we'd have to add -Wno-error=$WARN_TYPE for each warning type.
So instead, turn off all warnings so they can't get elevated to error
Reviewed By: jvillard
Differential Revision: D2690810
fb-gh-sync-id: 7d6611f
Summary: public
Refactor reporting of errors to enhance readability and reuse.
Reviewed By: jeremydubreil
Differential Revision: D2679676
fb-gh-sync-id: f4c1cba
Summary: public
With this change, it will be possible to pass to InferAnalyze a list of folders to be
searched for spec files, through a file containing those paths, separated by the newline
character.
For example, if there's a `PathList.txt` file containing
/path/to/specs/folder1
/path/to/specs/folder2
/path/to/specs/folder3
Then invoking `infer --specs-dir-list-file PathList.txt [--other_args, ...] -- <build_cmd>`
will instruct the analyzer to lookup to those three folders whenever it searches for specs.
It's important to note that since the analyzer runs in parallel from different locations, it's necessary to pass **absolute** paths, or the analyzer will fail with an error.
Reviewed By: jvillard
Differential Revision: D2668700
fb-gh-sync-id: b407a57
Summary: public
This function is useful to understand how infer prints reports, it's worth
cleaning it up a notch.
Reviewed By: jeremydubreil
Differential Revision: D2646878
fb-gh-sync-id: 2ecd894
Summary: public so that we don't get thousands of memory leaks in debug mode.
We will still get them if we pass ml_bucket internal.
Reviewed By: jvillard
Differential Revision: D2648200
fb-gh-sync-id: 8dce66f
Summary: public
This is the first of a series of patches that reorganise the inferlib package
into a bunch of smaller modules.
Reviewed By: martinoluca
Differential Revision: D2641917
fb-gh-sync-id: 19788b5
Summary: public
but keep the copy-pastability by wrapping the list into a small standalone
script that can be copy-pasted on the command line.
Reviewed By: jeremydubreil
Differential Revision: D2636536
fb-gh-sync-id: 7c689e2
Summary: public
These were only present in a few files. Could be added back on all files if
someone uses them.
Reviewed By: martinoluca
Differential Revision: D2646803
fb-gh-sync-id: edd6c43
Summary: public
This also fixes an issue with utf-8 in source code, as the csv report filters
out non-ascii characters.
Reviewed By: akotulski
Differential Revision: D2641727
fb-gh-sync-id: 3ca6dc6
Summary: public
This should avoid confusion between the toplevel "infer" python script and
inferlib/infer.py.
Reviewed By: jeremydubreil
Differential Revision: D2637087
fb-gh-sync-id: 82ce2a4
Summary: public
Print "Capturing..." message, and some info in case it fails, eg:
$ cd examples/android_hello/
$ infer -- ./gradlew build
Running and capturing gradle compilation...
[... stuff ...]
$ infer -- ./gradlew build
Running and capturing gradle compilation...
Nothing to compile. Try running `./gradlew clean` first.
Reviewed By: jeremydubreil
Differential Revision: D2637024
fb-gh-sync-id: 0e8867d
Summary: public
When analysing projects we would not always display the numbers of procs and
files analysed. This fixes it, and also prints the stats before the reports for
readability. This way we also don't need to print "Analysis done" anymore.
Before:
$ infer -- gcc -c hello.c
Starting analysis (Infer version git-436690cf022a16313dda8447121a5934529e6e5c)
Analysis done
hello.c:5: error: NULL_DEREFERENCE
pointer s last assigned on line 4 could be null and is dereferenced at line 5, column 3
3. void test() {
4. int *s = NULL;
5. > *s = 42;
6. }
After:
$ infer -- gcc -c hello.c
Starting analysis (Infer version git-5b7ff3ac10d58e7ffd17c44574ab330ed07cb188)
Computing dependencies... 100%
Analyzing 1 cluster. 100%
Analyzed 1 procedure in 1 file
Found 1 issue
hello.c:5: error: NULL_DEREFERENCE
pointer s last assigned on line 4 could be null and is dereferenced at line 5, column 3
3. void test() {
4. int *s = NULL;
5. > *s = 42;
6. }
Also looked at the results on buck and gradle
Reviewed By: cristianoc
Differential Revision: D2636991
fb-gh-sync-id: 32b9a7c