Build systems should be easy to build. Bazel is not by a far shot due to java being a mess in this area (ironic given it being advertised as a cross platform language).
These issues are not important for everyone perhaps. (Heck the entire Kubernetes ecosystem pulls random binaries from docker hub without any cryptographic signatures.) but it's still a shame; especially for a build system.
The part where this starts to suck is when their tools become pseudo-standards and everyone has to live with their decisions.
1. A corporation spends significant resources developing a project.
2. Then they release to allow the public to use it at zero cost. Often they even invest in supporting that external use.
3. The project provides enough value to so many users (who chose it of their own volition) that it becomes nearly a standard.
And this is somehow a bad thing?
Regarding your specific interpretation:
1. The product was developed for internal use AFAIK, then released externally.
2. Google is getting something out of this: a PR boost, better engineer retention and the engineers feel good about themselves.
3. All these projects not only don't become standards, but they just add to the pile of things one has to learn because there are still too many people that are fawning over anything published by FAANG.
Most Google projects are like this, including Android which is the main reason why vendors struggle with os updates.
Android is not a Google's internal product, unlike Bazel.
There exist LTS kernel versions for a reason, you know.
Currently doing this for BSD using OpenJDK 11.
Irrespective of Bazel, that's an lot of software than can't run on NixOS ARM, including build-related stuff:
* Elasticsearch, Cassandra
* Eclipse, IntelliJ, Netbeans
* Jenkins
* Java toolchain, Android toolchain
> (ironic given it being advertised as a cross platform language
Indeed that is one of Java's hallmark features. Servers, desktops, phones, toasters.
---
FWIW it's not unheard of to require compiling on one platform for another. This is how most of the embedded world works.
Other idea, distributions like Debian, seems to build OpenJDK as well, so maybe that would be a way to get the initial package (through an existing distro) https://buildd.debian.org/status/logs.php?pkg=openjdk-11 - see the armel/armhf/arm64 architectures (arm64 equals aarch64).
That might get you bootstrapped to the point where you can use that to re-compile the community edition of Java.
The command line client as well as some low level file utilities.
But Bazel is distributed as a standalone package in several packaging systems; no need to install Java yourself.
Though I doubt many people know this; there's virtually no reason you would be exposed to its language implementation choices.
EDIT: Actually I believe Bazel is changing its .deb package to not be standalone, in order to comply with Debian requirements.
Um, doesn't it still have a client that starts up a persistent server and you then have to wait for that server to start up (which, being Java, takes forever) and then deal with those server processes hanging around?
That sounds like being exposed to its language implementation choices.
As opposed to, say, having fast start-up times and not using a server design like basically every other build too.
But my information might be out of date. That's what always soured me on it previously, though.
It starts a server for (1) concurrency control (2) management of worker processes some languages use (3) caching the build graph (recall that Bazel works with very large code bases).
These reasons are independent of implementation in C++, Go, Rust, Java AOT, etc.
(And yes it doesn't have to use a persistent process to solve these problems. That is the solution it chooses.)
> not using a server design like basically every other build too
Buck, Pants, sbt, Gradle
How much did the fact that Java is very slow starting up influence the decision to use a persistent process instead of some other solution?
Noop build with Waf (build system written in Python) takes 0.13s on my system. Waf reports that the build actually takes 0.04s, so I guess 0.09s is Python's start-up time (and some other overhead).
"time bazel" returns 0.098s
Running a null build took 0.84s, but Bazel does significantly more work, as it's working on a big monorepo, as both a build tool and a package manager.
In short, it is not a problem. But I've had npm take many many seconds for simple operations. "npm list" takes 2.9 seconds.
Python can be slow, depending on the tool. Waf sounds like it is simple and fast, but there are lots of other examples of slow python frameworks out there.
For me it returns 1.6s on first run, .9s on second (bazel 0.29.1).
$ time (echo 'quit()' | python)
real 0m0.025s
user 0m0.000s
sys 0m0.031s
$ time (echo 'quit()' | python3)
real 0m0.036s
user 0m0.031s
sys 0m0.016s
(both are after it was already cached)That is probably mostly Waf startup time. Python itself starts way faster than that (on the order of 10-20ms on my machine).
time python -c '' # 0.024s
time python -c 'import argparse' # 0.036s
time python -c 'import argparse, json' # 0.040s
time python -c 'import argparse, json, httplib' # 0.065sEspecially if you can't or don't want to use memory mapping because it's hard to do well.
But more importantly, I think that the server can monitor file changes ahead of time with things like inotify, saving the time of stat()-ing files when the user wants to perform a build.
I recently wanted to take a look at VSCode and it immediately shat itself over the maximum number of inotify watches being too low (the kernel I'm running restricts this to 8k for non-root users).
I then bumped the limit to the max (512k, I think, or about 7 copies of linux.git)…still no luck. Now imagine you have a Google-scale number of files.
Why do new languages never address this issue?
But most languages and environments don’t let you do that easily.
To be fair, that doesn't require a long-running Bazel process to manage them, but that does become a natural choice.
I do know that Go wasn't an option :)
(Because it didn't exist)
$ time java -version
openjdk version "11.0.1" 2018-10-16
OpenJDK Runtime Environment 18.9 (build 11.0.1+13)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.1+13, mixed mode)
real 0m0.159s
user 0m0.116s
sys 0m0.052s
This is how long it takes for a program like git to do actual work. Once you start running an actual program like Maven, it blows up to 500ms for `mvn -version`: $ time mvn -version > /dev/null
real 0m0.570s
user 0m0.431s
sys 0m0.145s
Bazel takes 150ms to do nothing: $ time bazel --version > /dev/null
real 0m0.144s
user 0m0.028s
sys 0m0.063s
As a baseline, make takes under 30ms to do nothing: $ time make -version > /dev/null
real 0m0.025s
user 0m0.002s
sys 0m0.016sWaf written in Python:
$ time ./waf --version >/dev/null
real 0m0,068s
user 0m0,056s
sys 0m0,012s
Ninja written in C++: $ time ninja --version >/dev/null
real 0m0,001s
user 0m0,001s
sys 0m0,000s PS C:\Workdir> Measure-Command { java -version }
openjdk version "13" 2019-09-17
OpenJDK Runtime Environment (build 13+33)
OpenJDK 64-Bit Server VM (build 13+33, mixed mode, sharing)
Days : 0
Hours : 0
Minutes : 0
Seconds : 0
Milliseconds : 97
Ticks : 975572
TotalDays : 1.12913425925926E-06
TotalHours : 2.70992222222222E-05
TotalMinutes : 0.00162595333333333
TotalSeconds : 0.0975572
TotalMilliseconds : 97.5572
About 60 ms more than make.Hurray Make still wins, now what are we going to do with those 60ms... /s
For tooling it matters. Some scripts will have backticks and $() and each use of these could be up to a second and be acceptable? Not really. And if you want to run a command like `go fmt` every time you save a file in $EDITOR then you want it to be fast. Maybe when we use the Language Server Protocol everywhere, it will be a different world. But a lot of editors shell out for these features still - and you would never dream of shelling out to e.g. `mvn dependency:tree` because it's too slow.
https://github.com/graalvm/graalvm-demos/tree/master/java-ko...
But in large code bases, make can take several seconds to do nothing, depending on the number of `$(shell find)`.
Whereas Bazel's time remains constant. Could it have been constantly 30ms instead of 150ms?
Sure. But that's nowhere near to being a problem for the usual code bases Bazel operates on.
real 0m0.074s user 0m0.063s sys 0m0.025s
I think the server is kept around for a number of reasons that have nothing to do with Java startup time. Probably the biggest one is file-watching, using inotify, FSEvents, etc.
https://stackoverflow.com/questions/57982028/how-does-bazel-...
edit: remote->distributed
Java can be compiled into native binaries using GraalVM. Not to mention you dont actually have to install Java as it comes in bundled.
Bazel-like in many ways; written in Go.
The default install of my dev machine (Ubuntu) installed two different versions of python and perl5, neither of which I use. Other languages have been installed indirectly because I installed one tool or another. As long as the language itself doesn't get in the way (e.g. the tool is picky about the language version and requires extra work to install it) why should I care ?
Plus, even if one does not use them, shipping a minimal runtime is hardly any different from having libc or libc++ dynamically linked.
Yet, people always seem to point to regulations to justify all kinds of snake oil salesmen garbage, even if obviously unfit to fulfill the stated objective.