facebook / facebook/infer

Infer assumes gradle will use system's javac

Aperta
#992 0 commenti 3 reazioni 0 assegnatari Vedi su GitHub
pinned
Lingua principale
OCaml
Stelle
15.7k
Fork
2.1k
Merge medio
19h 36m
PR unite (30g)
13

Descrizione

I am using infer 0.15.0 on Ubuntu 18.

I have a java project that builds using gradle, and which is configured to use the [gradle ErrorProne compiler plugin](https://github.com/tbroyer/gradle-errorprone-plugin). In `build.gradle`, I've configure java compilations to use an ErrorProne-specific java flag, `-XepAllErrorsAsWarnings`, as describe in the link above.

Running infer on my project fails as follow (project name and details elided):

```
> infer capture -- ./gradlew all
...
lots of files compile
...
Usage Error:
*** Failed to execute compilation command: exited with code 2
*** Command: javac '@/infer-out/filelists/gradle_pXRP9K.txt' '@/tmp/args_.tmp.046d5a'
*** Output:
javac: invalid flag: -XepAllErrorsAsWarnings
Usage: javac
use -help for a list of possible options

*** Infer needs a working compilation command to run.

Failed to execute: /opt/infer-linux64-v0.15.0/lib/infer/infer/lib/python/inferlib/../../../bin/infer capture --continue -- javac
```

It seems like infer is incorrectly assuming that `gradle` uses the same `javac` as the one on my `$PATH`, or at least that the same command-line arguments will be accepted by gradle's compiler and vanilla `javac`. That's not true in my case, because gradle is using the ErrorProne java compiler and passing a non-standard argument to it.

This problem looks like a near-duplicate of issue #890. #890 (and several other issues) were originally closed as duplicates of #855, all dealing generally with infer having flaky integration with gradle. However, #855 was later closed with a specific fix that does not address the present issue. So I don't believe this problem is covered by any currently-open issue.

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.