7 ms·
I only wish Bazel had been written in a language that produced native binaries like C++ or Go instead of Java. It seems like a waste for me as a non-Java develo
by RcouF1uZ4gsC 7y ago
I only wish Bazel had been written in a language that produced native binaries like C++ or Go instead of Java. It seems like a waste for me as a non-Java developer to install Java on my dev machine just for Bazel.
- RhodesianHunter 7y agoWhy do you care if a JVM is on your dev machine?
- thejosh 7y ago- One more thing to install - Does this work for 8/11/12/13/14/15/16?
- cromwellian 7y agoIt's a stripped down JVM is bundled with bazel, you don't need to install it.
- weberc2 7y agoMy 2015 MBP is crawling between Safari, Docker, VS Code, and BitDefender (antivirus). Not sure how bulky the JVM is these days. That said, I wish it supported Python.
- harrygeez 7y agoWhy do you even have Bitdefender installed?
- the_mitsuhiko 7y agoA lot of people have it for compliance reasons.
- slrz 7y agoA lot of regulations are actually a lot more reasonable than one might think and refrain from mandating any specific technical measures. 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.
- timc3 7y agoIf you are building software for others to consume it is a good idea to have at least some protection. Even it doesn’t ever pickup MacOS malware/virus - it might stop you from distributing that intended to infect other target OS or software.
- mrath 7y agoI think you don't need to install Java to use Bazel, it comes bundled. They have done some improvements to installer so that the user requires as less additional tools as possible to run Bazel.
- paulddraper 7y agoParts of Bazel are written in C/C++. 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.
- bradfitz 7y ago> there's virtually no reason you would be exposed to its language implementation choices 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.
- paulddraper 7y agoBazel doesn't start a server for Java JIT reasons. 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
- RcouF1uZ4gsC 7y ago> (And yes it doesn't have to use a persistent process to solve these problems. That is the solution it chooses.) 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?
- m0zg 7y agoYou don't need to install Java. It's bundled. In fact I'd recommend that you don't even install Bazel itself. Instead, install this: https://github.com/bazelbuild/bazelisk https://github.com/bazelbuild/bazelisk. This will install either the latest Bazel for you automatically, or you can pin a version of Bazel you want in each repository, to limit and control build system churn.
- neop1x 7y agoIt's funny how Java people always marketed Java as "write once, run everywhere" and they often bundle compatible platform-dependent JRE with platform-specific plugins. ^_^
- ksec 7y ago>I only wish Bazel had been written in a language that produced native binaries like C++ or Go instead of Java. Java can be compiled into native binaries using GraalVM. Not to mention you dont actually have to install Java as it comes in bundled.
- meisterT 7y agonative-image performance without PGO might be worse than with JIT, at least in some experiments that I did. See also https://github.com/oracle/graal/issues/979 https://github.com/oracle/graal/issues/979
- boris 7y agoThere are alternatives that satisfy this (valid, IMO) requirement. For example, there is build2 (https://build2.org https://build2.org ; full disclousure: I am involved with the project) that tries to achieve the same objectives (correct & fast builds, uniform interface accross platforms, being language agnostic, etc) though not necessarily using the same mechanisms (build2, for example, tries to be fairly light-weight). Here is the introduction if anyone is interested: https://build2.org/build2/doc/build2-build-system-manual.xhtml#intro https://build2.org/build2/doc/build2-build-system-manual.xht...
- pjmlp 7y agoThere are native code compilers for Java, one just has to bother to learn about them. Plus, even if one does not use them, shipping a minimal runtime is hardly any different from having libc or libc++ dynamically linked.
- ComputerGuru 7y agoI have the same complaint about meson and python 3. You purposely use a low-level language to write dependency-free code, then your users need to install a bloated runtime just to build the damn thing.
- mrighele 7y agoIs that such a big issue though ? 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 ?
- jhasse 7y agoI bet you're using Python and Perl indirectly, because lots of Ubuntu's tools are written in those languages.
- arianvanp 7y agoWe didn't have Bazel on ARM for NixOS because we can't bootstrap openJDK on ARM. There's no source code for a JVM that compiles on ARM afaik. Though in theory we could package binary blobs from oracle and bootstrap JDK and Bazel from there, it means now our trust path for your critical build tool has a random Oracle blob in its trust path there that is extremely hard to get rid off. 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.
- jacquesm 7y agoIsn't there a way to get the Android toolchain to give you what you need? After all Dalvik is just Java warmed over and has a working VM, and there are plenty of ARM based Android phones. That might get you bootstrapped to the point where you can use that to re-compile the community edition of Java.
- fooker 7y agoYou are conflating the runtime environment with the development framework. Afaik, you can't develop native Android apps on Android.
- blub 7y agoGoogle builds stuff for themselves and then dumps it for extra reputation points on the dev community. The part where this starts to suck is when their tools become pseudo-standards and everyone has to live with their decisions.
- jakobegger 7y agoRight. Like the v8 javascript engine. If you want to build it, you need to download gigabytes of sources and install Googles internal build system tools first...
- zmmmmm 7y agoI always have the opposite reaction. When I see its a native tool I immediately think, "oh great, now to build this I need to know how to understand your weird glib / gcc version weird compile / link / error for some ecosystem I don't understand". Instead when I see Java / JVM and know that almost certainly I will have no problems like that.
- AsyncAwait 7y agoEh, static binaries solve this & Gradle presents plenty of potential problems in my experience.
- mgemard 7y agoYou can use SDKMAN (https://sdkman.io/usage https://sdkman.io/usage). It is like nvm.
- kristiandupont 7y agoI am going to be trying out Bazel next week and I intend to run it in a container. I assume this is possible?
- henryaj 7y agoYou should look at Please: https://please.build https://please.build Bazel-like in many ways; written in Go.
- jgavris 7y agoBazel has been embedding Java for a year or so now. There's no need to concern the host environment with installing the JRE anymore. As a user, the fact that Bazel is written in Java is transparent.
- neop1x 7y agoI guess that's why they use "gn" in newer projects like Fuchsia or Chrome?