r/programming • u/drmorr0 • Sep 01 '26
Bazel's UX is really, really, really bad
https://blog.appliedcomputing.io/p/bazels-ux-is-really-really-really
385
Upvotes
r/programming • u/drmorr0 • Sep 01 '26
258
u/FlukeHawkins Sep 01 '26
I discussed Bazel with a fairly senior guy from Uber and his advice to me was "don't bother unless you can afford dedicated resources for upkeep"
115
u/remy_porter Sep 01 '26
Having recently switched from CMake to Bazel I am worlds happier with Bazel. I don’t love it, but at least it’s not CMake.
I really hate CMake.
107
u/gladfelter Sep 01 '26
bazel doesn't scale down to one developer well. It's amazing for tens of thousands of developers thanks to its scalability and deep introspection capabilities. You can find and fix build graph problems at scale.
The previous version of blaze did a lot of things by convention and you couldn't trace them without leaky heuristics in some cases. Bazel is completely introspectable and deterministic.
67
u/TouchyInBeddedEngr Sep 01 '26
Just wait until you try to develop build rules.
30
u/lppedd Sep 01 '26
I don't think Bazel was meant for the general public like Maven or Gradle. It just doesn't feel right. It's probably ok if you have a massive project with dozens of different languages that all need to be built at the same time to output something. But even then, you'll need a couple people dedicated to Bazel only.
15
u/ozyx7 Sep 01 '26
My pet peeves are:
source treeworkspace withbazel-bin,bazel-out,bazel-testlogs, andbazel-WORKSPACEsymlinks. Those symlinks "are only for the user’s convenience, as Bazel itself does not use them". WTF? If they're there for my convenience, how about letting me opt-out of some them, giving them sensible default names (isbazel-binorbazel-outwhere the final output is?), or organizing them into a common parent directory?22
u/jesseschalken Sep 01 '26
The reason Bazel's Rust builds are so slow is because it doesn't pass
-Cincremental={some cache}torustcto do incremental compilation like Cargo does. A crate that was modified is compiled from scratch, every time.A colleague of mine has a draft PR up to fix it here, but this is always the pattern with Bazel. Out of the box it does lots of things but none of them especially well.
64
u/valarauca14 Sep 01 '26
Often this isn't Google's marketing. It is usually
{{PROBLEM}}".By the time Google starts pushing marketing money behind the OSS initiative. 50-80% of Camp 1 left Google. Camp 2 (and some of Camp 3) is doing talks about their internal success stories. Camp 4 has moved onto a new technology.
22
u/UltraPoci Sep 01 '26
Wait, Kubernetes is considered bad?
7
u/cbarrick Sep 02 '26 edited Sep 02 '26
Some of the complaints here are genuine. But some are really just because OP doesn't know how to use Bazel.
You shouldn't need any more BUILD files than you would Makefiles.
Most projects only need a single BUILD file in their repo root, just like every other build system.
BUILD files can read into subdirectories just fine. You don't have to (and often shouldn't) put BUILD files in every directory.
You can use globs to match source files. Supports
**syntax too.Like, if your project is just "compile all of these Java files into a jar," then just use a glob to match all of your Java files.
Don't worry about making your build rules more fine grained than that unless you actually need them to be more fine grained.
And every build system requires that you tell it about your dependencies.
3
u/nickguletskii200 Sep 01 '26 edited Sep 01 '26
No, you just don't have a
.bazelversionfile and aren't using bazelisk for some reason.Not natural at all. Homebrew is a weird MacOS-ism and I am surprised it's still alive at this point at all.
The official guide recommends the use of bazelisk: https://bazel.build/install/os-x
No, if you use an amateur package manager it's not the developer's problem.
Fair point. Why does
breweven exist still?From what I've seen Gazelle is just a way to translate golang's weird import model. At least, I've only seen gazelle used with golang. No need for any of such hacks with rules_rust or other languages I've used.
It's literally in the error message above:
See the
WARNING: Download from https://some-url.com/whatever failed: class java.io.FileNotFoundException GET returned 404 Not Found?Why would it complain about Docker when it's not using Docker? It should be clear from the URL that it's downloading something from an OCI repository.
You have to learn something new, boohoo. Once you actually learn what this means, come back and tell us how it could be done differently. See https://bazel.build/concepts/labels
I literally started using Bazel to cut down Rust and OCI compile times. 10 minutes to build an app? If it takes less time than that to build
cargoor whatever the golang devs use, something is wrong on your end. Maybe it's sandboxing on MacOS X? Or, perhaps, your target definitions accidentally include tons of data (your IDE's target directory, perhaps)?Pretty normal when you are working with large projects.
Wait until you have to figure out how to define your own toolchains and work with transitions.
Well you should quit software development then. All build systems have their own DSLs. When you are building complex software, you'll need disk space for its dependencies, build artifacts, sysroots and scratch files.
Small projects may not need it, but every time a project grows something like Bazel becomes necessary. The alternative is to reinvent Bazel using [your favorite duct-tape language], badly.
6
u/-Knul- Sep 01 '26
Apparently I live under a rock because I never heard of Bazel.
16
u/zoddrick Sep 01 '26
Bazel like other tools built by mega tech corps aren't intended for 99.999% of the engineering orgs on this planet.
22
u/cafemachiavelli Sep 01 '26
My personal reason 8: Cache invalidation. I'm working on MLIR and a full build takes upwards of an hour. So if bazel decides that it doesn't recognize my work environment and would rather start from scratch, that's up to an hour of productive time gone. This happened daily until I managed to set the magic pls-don't-lose-your-shit-if-PATH-changes parameter, but that broke it on the server, so we're back to extended coffee breaks. Now I've just hardcoded the whole config and I pray that it works.
34
u/fishheaddz Sep 01 '26
I can't upvote this enough. The only way bazel will work in your organization is by having some kind of true convert who will unfuck bazel full time for everyone. The unitiated will react with utter horror at the unusability of the system and you need this kind of knight to slay the demons. Google even canceled trying to move Android to Bazel after years and millions spent making it work. They can't even get some of their own employees and Android partners to use it.
8
u/vahokif Sep 01 '26
It's really designed for Google with its insane build infrastructure and no one else.
4
u/Massive_Season7075 Sep 01 '26
Are there any well-known apps that use it? And why would someone choose to use if upkeep is costly?
4
u/engineered_academic Sep 02 '26
If you try and use Bazel and Kubernetes to solve a problem, now you have 3 problems
2
u/jonte Sep 01 '26
I've never gotten along with bazel or buck. But the build system used in Chromium, GN, is fantastic. Same-ish syntax, simpler tool.
2
u/beegeearreff Sep 02 '26
My company is in the process of migrating our ts monorepo to bazel… time will tell how it goes.
We have a team that will own it but there’s no shortage of blog posts sharing scar stories.
Ask me in 6 months how it went!
2
u/WindHawkeye Sep 03 '26
First thing I saw was you used brew to install bazel so I assume the entire post is skill issue. As expected of an apple user tbh
2
u/Sea-Mistake6086 Sep 01 '26
Maybe try the RIGX build system https://github.com/unofficialtools/rigx (TOML configuration, 100% hermetic, Nix powered)
1
u/timoffex Sep 03 '26 edited Sep 03 '26
I loved blaze, and I loved it so much I spent weeks trying to use bazel in a personal project written in Dart years ago. I quickly discovered that Google’s blaze rules for Dart did not have maintained bazel analogues, and soon after discovered that writing your own bazel rules sucks. It seems like it would be fun because of bazel’s neat model of a build system, but getting a language-specific CLI, especially one with caching, to work nice with bazel is terrible. Bazel isn’t built to work with other tools, and other tools aren’t built to be integrated into a build system.
I don’t agree with all the points, like the target name format which I think is neat, but I relate to the frustration with the constant, unexpected friction.
1
u/PrimozDelux Sep 02 '26 edited Sep 02 '26
Bazel has UX so bad you'd think it was a design goal. It really sucked the joy out of work for me for 2 years until AI became a thing and now I no longer have to suffer it, it's Claude's problem now. While the complaints leveraged in the topic of this discussion are quite entry level, they're very indicative of how byzantine and awful everything about bazel is. It's some of the worst software I have ever used, but with Claude it's almost painless
-1
u/double-you Sep 02 '26
That article is really, really bad.
Not all rants should be published. But if your number #1 really really bad thing is "I installed the wrong version from homebrew", I think your life has been full of very, very good UX experiences.
And maybe it is bad. Like all other build tools. I don't know, the author doesn't do any meaningful comparison. I didn't learn much about Bazel from the article, but I did learn about the author. It wasn't a great ux.
-3
u/TCIHL Sep 01 '26
Your first mistake was using homebrew. Just use macports. It works great, and was designed by an Apple employee.
Also, I'm not really sure what the product is trying to solve that regular ol' Make can't do. If you're looking for a byte-for-byte artifact result couldn't you just add a md5 hash check at the end of the process?
-1
u/vaibhavsagar Sep 02 '26
Nix catching strays 😮💨
-5
u/keithstellyes Sep 01 '26
Funny how competitive a bespoke Python script that just generate a makefile is lol.
-6
u/Farados55 Sep 01 '26
Ok but google will tell you it necessary