Live data from Hacker News

Ask HN: Anyone using Bazel at startups? or migrated to/away from Bazel?

news.ycombinator.com

11–20 of 38 posts

Re: Ask HN: Anyone using Bazel at startups? or migrated to/away from Bazel?

#11
post #2

I have tried twice in the past 5 years or so to convert different projects (mostly Java) to Bazel but failed miserably every single time. I do not have notes handy so I don’t remember exactly what happened but my impressions after a week or two invested trying to get it running were a) that our projects had too many unsupported things (dependencies, flows) that would require a huge effort to adapt; and b) that it wou…

> Man, not having to build the same code that hasn’t changed over and over locally and in pipelines sounds so appealing.

Can't you use something like Maven build cache ( https://maven.apache.org/extensions/maven-build-cache-extens... ) for that?

Re: Ask HN: Anyone using Bazel at startups? or migrated to/away from Bazel?

#12
I worked at a startup using bazel, and had a strongly negative experience, for the following reasons:

1. Bazel requires non obvious, continued maintenance. Bazel is a theoretically hermetic build system with universal caching and near constant build times. The sticking point is that it only has those properties if someone sets it up correctly and maintains its infrastructure. At our company, no one set this up, and as a result build times ballooned and local development became a mess of bash and docker. And even if someone had set this up, who would maintain it? We would have had to expand the infra team, and even a couple of people extra can be a lot for a startup.

2. Bazel also has support for every language, which is theoretically true. In practice, this support is often incomplete, out of date, poorly documented, badly supported, or some unfortunate combination, because the (language)+bazel communities that support the docs, tooling, etc are often orders of magnitude smaller than teams that work with (language). So teams that use bazel are forced to choose between two bad options: integrate things the bazel way and rely on the relatively small (language)+bazel open source communities and tools of questionable quality, or use the much much larger (language) open source communities and hack the tooling in. We did the former, and it was hell, because we a) didn't have feature complete community tooling and b) upgrading the bazel version required every team at our company that was using bazel to stop working and simultaneously check trial bazel versions for breakages.

3. Bazel makes hiring and onboarding harder. In order to fix the above problems, you need people that know bazel. Hiring someone that knows, say, python is hard enough. But python and bazel? The hiring pipeline immediately gets reduced, which means you either have to spend more time searching for qualified candidates or more time onboarding candidates who don't quite fit all your criteria.

All in all, I would recommend against bazel unless you: 1. Have or can hire a preexisting community of knowledgeable bazel developers who will make up a sizeable portion of the company. 2. Have full executive support for multiple years while the infrastructure is being created, and executive support for maintenance teams thereafter 3. Actual, company-wide problems with builds that justify the former two criteria.

Re: Ask HN: Anyone using Bazel at startups? or migrated to/away from Bazel?

#13
Also ex-Google engineer and founded a bunch of startups in my time away.

I tried Bazel when it was first released as open-source but migrated away from it pretty quickly. It was just too complex for what it brought to the table. In a startup you should only be doing things that directly validate your business hypothesis, and futzing around with your build system is not really one of them.

I found it much more productive to use the native package managers and build systems that go with your language, eg. npm for Node, pip for Python, Gradle for Java or Kotlin.

Re: Ask HN: Anyone using Bazel at startups? or migrated to/away from Bazel?

#14
Bazel is as much an HR Department (licenses, supply chain source of truth, entry point for sec teams to add stuff to, auto generate jiras for out of date deps etc) as it is a build system. If you mean an actual startup (and not startup as in airbnb), then use the native build systems until a standardized system like bazel is needed.

Re: Ask HN: Anyone using Bazel at startups? or migrated to/away from Bazel?

#17
Also an ex-Googler. At a tiny startup of 4 engineers atm.

Briefly looked into Bazel, but settled on pantsbuild since Google seems to have just thrown all the language support over the wall to the community.

Being able to trivially setup CI on Github has been very helpful and important to me.

Being able to easily add targets and package things that require multiple microservices has been nice.

People say you can use the native tooling, but what even is the native tooling for python? It doesn't have a standardized packaging tool unless you count docker. pants' support for pex was important for me until we eventually adopted containers.

Folks can (and did) get the native packaging wrong, particularly when they were not super familiar with the language they needed to pick up on the fly.

Having to deal with an abstraction layer over the tooling has introduced some of its own headaches (eg for docker), but mostly for advanced features.

In the end, I'm pretty happy, I see it as an investment in CI, and the CI has caught a bunch of real bugs people pushed.

I think starting early here has been good, since the lift to get onto it has been small.

Re: Ask HN: Anyone using Bazel at startups? or migrated to/away from Bazel?

#19
I worked for a company of ex-Googlers that used Bazel with Python/Django a few years ago.

- It copies your files into a temporary directory to run them and that directory is named an obnoxiously long hash digest, so it effectively takes a giant shit in all your stack traces. When you're looking at an error message, half of your field of vision is taken up by line noise of the same random hash over and over again and since it runs your Python the first few frames are just helpfully telling you "this code was run through bazel". I even wrote a script that scanned my clipboard for Python stack traces, parsed them and removed this noise to make it easier on my brain to search for the actual line with the error.

- Every import you write you have to write in two files or three if you have to export it. It's double the typing work and finding the target is a pain because there's no jump to definition of the Bazel target so it's even more typing to find it.

- I wanted to use pytest and it was much more work, I don't think I ever got it working. Normally there's no setup you just run "pytest" and it discovers all the tests and runs them.

- Your code doesn't start running as quickly.

- You have to type way more characters to start your code. I had aliases for every endpoint.

- There was something with tests where if the error log was too long it would just say "there was an error, please find it in this randomly-named file" and when you're debugging a test whose error log is too long it's going to be too long every time you re-run it too. So running and seeing the error is now a two step operation, double the work.

Maybe some things have changed or I misremembered something, but overall it was the part of our tech stack I really hated. I just wrote software, I didn't do any ops or any sort of deployment or touched live systems at all really, so I honestly have no clue what it actually did for us it was just pure downside for me. I would never use it.

Re: Ask HN: Anyone using Bazel at startups? or migrated to/away from Bazel?

#20
It just really depends on what the startup is doing.

If it’s a bunch of Python with a C++ extension (or mostly JVM or whatever), heavy build stuff is probably overkill.

If you’re in a polyglot environment with mountains of vendored native code targeting multiple cross-compilation targets and need the flags tuned just so?

Then Pants, Bazel, and buck2 all have pros and cons.

Post reply on HN