Summary: We had our own mechanism for saving `./configure` flags, which does not work if flags contain whitespace. It turns out that `./config.stats --config` is a thing though.
Reviewed By: mbouaziz
Differential Revision: D4642422
fbshipit-source-id: ae075ca
Summary:
This replaces the previous integration written in Python, which consisted in 1)
run the mvn command and parse its output to locate "directories containing
source files", 2) run on files named "*.java" in these directories. This meant
we had to run javac twice on each source file, and more importantly this
mechanism of finding source files was very fragile. In fact, I could not make
it work on several mvn projects I tried.
The new integration is based on parsing "pom.xml" to add an "infer-capture"
profile which instructs mvn to run `/path/to/infer` instead of `javac`. We also
add this profile to each maven submodule.
Users can specify an "infer-capture" profile themselves if the default one
doesn't work; in that case we don't inject our own "infer-capture" profile.
Reviewed By: jeremydubreil
Differential Revision: D4409613
fbshipit-source-id: d664274
Summary:
Version 0.29.1_1 of pkg-config has been known to cause compiling infer to fail.
Warn users at ./configure time.
Reviewed By: jberdine
Differential Revision: D4422774
fbshipit-source-id: bce5733
Summary:
This will make it easier to bisect on top of this commit, as values in
Makefile.autoconf.in are not expected to change across commits, but
Makefile.config may fluctuate.
This should also make it easier to rebase stacks of diffs without having
to rerun `./autogen.sh && ./configure`.
Reviewed By: jberdine
Differential Revision: D4410077
fbshipit-source-id: 1119fb6
Summary:
This removes support for developing infer using Eclipse. If you use Eclipse,
consider using Atom/Emacs/vim instead, which have good OCaml/Reason support.
This allows us to get rid of a couple quirks:
- do not generated ocaml annots (this is very slow)
- move OCaml _build directory to infer/src/ where it makes more sense
Reviewed By: jberdine
Differential Revision: D4319480
fbshipit-source-id: 6f063fc
Summary: Only run the buck (and ant) tests if the tools can be found at ./configure-time.
Reviewed By: jberdine
Differential Revision: D4167586
fbshipit-source-id: e77b736
Summary:
Our patch to Javalib has been accepted, so we can parse programs with invokedynamic!
invokedynamic still crashes Sawja, but I have worked around this by replacing all invokedynamic's with invokestatic's before passing them to Sawja.
This means we can handle everything about invokedynamic except calling the correct function (I call a dummy function with the correct signature for now).
We can try to actually call the right method in the future.
Reviewed By: jvillard
Differential Revision: D4160384
fbshipit-source-id: a8ef4e1
Summary: Introduce `--enable-ocamlopt-custom-cc` configure flag (disabled by default). Normally it doesn't have to be set. However, when cross-compiling infer itself for another platform it may have to be set.
Reviewed By: jberdine
Differential Revision: D3995032
fbshipit-source-id: ce2fd72
Summary: This gives a better error message when `rebuild` is missing.
Reviewed By: jberdine
Differential Revision: D3528761
fbshipit-source-id: b5be810
Summary:
Came across when trying to compile infer on fresh VM.
Infer depends on reason now. Reason requires ocaml 4.02.3
Reviewed By: jberdine
Differential Revision: D3371378
fbshipit-source-id: 598c602
Summary:
Hardcoding `variable@` in Makefiles is Bad™ because it prevents the users from
overwriting them easily with `make variable="my custom value"`. The right way
to do it is thus:
```
variable = variable@
# then use $(variable) everywhere
```
This diff puts all the `variable = variable@` lines in Makefile.config.in, and
changes every occurrence of a `variable@` to `$(variable)` everywhere else.
I mostly automated generating this diff. Here are the steps I did:
- find out which `variable@`s we use:
find . -name 'Makefile*' -exec grep -e '@[^@ []\+@' -o -h \{\} \+ | sort | uniq > config_variables
- write this `replace.sh` script to replace every `variable@` with `$(variable)`:
```
#!/bin/sh
config_vars_file=$1
shift
for line in $(cat $config_vars_file); do
var=$(echo $line | tr -d @)
sed -i -e "s/$line/\$($var)/g" $@ > /dev/null
done
```
- run the script as such:
find . -name 'Makefile.*in' \( -not -wholename './Makefile.config.in' \) -exec ./replace.sh config_variables \{\} \+
- put all the `VARIABLE = VARIABLE@` lines in Makefile.config.in
- move all `Makefile.in` to `Makefile`, since they don't need to be generated by `./configure` anymore:
```
for i in $(find . -name 'Makefile.*in' \( -not -wholename './Makefile.config.in' \)); do \
rm $(dirname $i)/$(basename $i .in) && git mv $i $(dirname $i)/$(basename $i .in) ; \
done
```
- delete all Makefile except Makefile.config from configure.ac
- manually inspect and remove remaining instances of `VAR = $(VAR)` in makefiles, looking at the output of `git grep '^\(\w\+\) = $(\1)'`
Reviewed By: jberdine
Differential Revision: D3358379
fbshipit-source-id: 5d37f02
Summary: This is basically not used and removing it makes the Makefiles slightly less convoluted.
Reviewed By: jberdine
Differential Revision: D3322376
fbshipit-source-id: 2d7c1f8
Summary:
Build everything at once all the time. This removes the need for multiple
directories, which were a hassle to begin with.
This removes the `java`, `clang`, and `llvm` targets in various Makefiles as
well.
Reviewed By: jberdine
Differential Revision: D3317230
fbshipit-source-id: 8e86140
Summary:public
Use getconf to compute NCPU as it is uniform across platforms.
Use result in several places to avoid fork bombs. I routinely see
errors about fork running out of memory when building e.g. the clang
plugin.
Reviewed By: jvillard
Differential Revision: D3148970
fb-gh-sync-id: 6d071c9
fbshipit-source-id: 6d071c9
Summary:public
All frontends and the backend should be built by `make test`
irrespective of configure flags.
This diff also re-enables parallel building for the compilation of
infer done by the `test` target. The ocaml unit tests, tracebugs
tests, and everything run by buck are still sequential. Enabling
parallel builds roughly halves the time spent building infer.
This diff computes the number of cpus (NCPU) at configure time.
Reviewed By: jvillard
Differential Revision: D3121658
fb-gh-sync-id: a667cf8
fbshipit-source-id: a667cf8
Summary:public
This create `make install` and `make uninstall` targets that can be used to
install Infer on a system. All the files needed are installed under
"/usr/local/lib/infer" (by default, but can be configured with ./configure
flags as usual), pretty much like their git infer/ counterparts. Moreover,
"infer" and "inferTraceBugs" are installed in /usr/local/bin (similarly
configurable).
As a bonus, `opam install infer` and `opam remove infer` now work. To use
these, it's better to pin the git repo with "-k git":
cd ~/infer/ # where the repo is
opam pin add -k git --yes infer .
The reason is that otherwise, and only if the repo is not clean, opam will
convert symlinks into regular files, which is not good (compilation will fail).
Reviewed By: jberdine
Differential Revision: D3109337
fb-gh-sync-id: 96c9fd1
fbshipit-source-id: 96c9fd1
Summary:public
Instead of using the GitHub APIs to figure out the latest infer version to
download, hardcode it in the file. This way, Docker doesn't cache the version
number.
Differential Revision: D3109567
fb-gh-sync-id: 679018e
fbshipit-source-id: 679018e
Summary:public
Now use -safe-string and the Bytes module and bytes type.
Reviewed By: jvillard
Differential Revision: D2949369
fb-gh-sync-id: 58aa688
shipit-source-id: 58aa688
Summary:public
It seems that ocamlbuild from 4.02 does not pass -open Module to ocamlc when given an open(Module) tag.
Reviewed By: sblackshear
Differential Revision: D2947787
fb-gh-sync-id: 1544002
shipit-source-id: 1544002
Summary:
public
This bumps the version number of Infer. Still needs to tag a subsequent commit in GitHub to bless the release.
Reviewed By: dulmarod
Differential Revision: D2759856
fb-gh-sync-id: b1fe50d