Open nordlow opened 7 years ago
We are also definitely interested in this. This would allow us to run static analysis in parallel with the compiler and break the build if there are violations.
cc @msridhar @hzsweers
Can this be implemented via wrapper scripts around the compiler, such that compiler invocations can also fork off a linter check? You can also wrap ar and ld to collect these lint outputs. In this manner you can create build+lint without any special build system support. The only issue is that caching of these analysis would not be well supported.
@yiding That would disable in memory compilation which would remove a lot of benefits :(
What is "in-memory compilation"?
In-memory compilation is referring to Jsr199Javac
, which invokes the compiler in-process with Buck. It's a ton faster than exec'ing javac
for each rule (e.g. for Buck itself literally 100% faster), because it eliminates invocation and VM startup overhead, allows the compiler (and in some cases annotation processor) classes to be loaded just once, enables some cross-build caching of JAR directories, lets the HotSpot JIT get the compiler code nice and speedy, allows us to build the output JARs in memory, enables dependency file support, and probably some other things I'm forgetting. The list keeps getting longer since most of our Java-specific performance efforts are focused on this mode.
One alternative that can be done now is to create extra build rules with the dependencies hooked up in such a way that the checking rules will always run any time the compilation rule does. However, that way has other challenges, in that it can slow down the initial processing of the BUCK
files, put additional stress on cache servers (and require more cache fetches), and make the graph generally harder to understand.
Any updates on this?
Does Buck support some way of calling extra linters/checkers in parallell with the compilation step similar to what Bazel provides here. I'm thinking mainly of calls to
And what about using the result of the checkers outputs as inputs into successive build steps to collect metric reports on test coverage etc?