5 ms·
How does it compare with Java 9's sjavac (http://stackoverflow.com/a/26424760/750563 http://stackoverflow.com/a/26424760/750563)? EDIT: I fully understand that
by pron 12y ago
How does it compare with Java 9's sjavac (http://stackoverflow.com/a/26424760/750563 http://stackoverflow.com/a/26424760/750563)?
EDIT: I fully understand that this is a build tool for multiple languages. But its raison d'etre is speed. So I'm asking what techniques does Bazel use to accelerate builds and how do they differ from those used by sjavac, which is also designed to accelerate builds of huge projects?
- Sphax 12y agoI don't think they're even related, Bazel is a general build tool, sjavac looks like a smarter Java compiler ?
- pron 12y ago... that exploits parallelism and caching (and a hot VM) to accelerate build of huge projects, and supports build clusters.
- untothebreach 12y agohuge Java projects...why would you compare a general build tool to a language-specific one?
- pron 12y agoWhat difference does that make? I am not saying you could replace this tool with sjavac, but as they both tout speed as their main feature (and justification), I am wondering whether they both employ the same techniques or different ones.
- skj 12y agoInside Google we do that as well, but it's actually distinct from bazel. Bazel is a build language, and I believe they provide a reference implementation. It's not unimaginable (and as I mentioned, it has been done internally) to use caching, incremental, distributed builds. In fact, it was originally designed with those goals in mind.
- hanwenn 12y agoI work on Bazel. Bazel also builds other languages, such as C++ and Objective-C. We do invoke the Java compiler through a wrapper of our own. We think we can make that work as a daemon process to benefit from a hot JVM, but haven't gotten round to that.
- pron 12y agoDo you also use timestamps like sjavac or some other mechanism, like hashing?
- hanwenn 12y agoBazel uses checksums to determine if builds are up-to-date, but shortcuts the checksumming if metadata (timestamp, filesize) have not changed between builds.
- pron 12y agoYour FAQ says this: Bazel configuration files are much more structured than Gradle's, letting Bazel understand exactly what each action does. This allows for more parallelism and better reproducibility. Could you please elaborate on that (i.e. with regards to both parallelism and reproducibility)?
- hanwenn 12y agoI'm not a Gradle expert, so take this with a grain of salt. Gradle a single-threaded execution in some parts (I believe it may be configuration?), because the build-rules are written in a full blown language with access to the filesystem, and internal parts of Gradle. In Bazel, rules have to declare inputs and outputs, and this can be enforced with sandboxing. This allows to predict that two rules do not interfere with each other, so we know we can run them in parallel. Our extension language disallows direct access to the file system, and also forbids access to other sources of non-determinism, such as hash tables and the clock.
- 12y ago