TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

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

27 pointsby grrandalfover 1 year ago
Anyone using bazel at startups? Or is it thought off as too heavyweight?<p>Context: I&#x27;m ex-Google and I think blaze&#x2F;bazel brings enough to the table to be worth the complexity even for startups, but wondering I&#x27;m underestimating the actual complexity.

19 comments

dupedover 1 year ago
At a startup, you&#x27;re going to rewrite you&#x27;re entire product multiple times because you don&#x27;t know what it actually is when you start. Your job is to get shit done as fast as possible to prove out the idea before you run out of money, and to make a demo that can convince people to give you money to actually build it right with all the lessons learned.<p>Bazel gets in the way of this use case. It will help your small team not break each other&#x27;s builds. But you&#x27;ll burn a salary on someone as the &quot;Bazel person,&quot; they&#x27;re going to write a bash script or make file for everyone else to use anyway, and when you inevitably rewrite everything from scratch the third time all their work is going to be for nothing and they&#x27;ll spend days getting it back.<p>Just write a bash script or python script that does what you need for today, and plan to deal with it later. The only thing startups can afford is tech debt.<p>Another way of thinking about this is that your product is the software and not the software to build the software. Don&#x27;t waste time thinking about the tools.
评论 #38497578 未加载
shpxover 1 year ago
I worked for a company of ex-Googlers that used Bazel with Python&#x2F;Django a few years ago.<p>- 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&#x27;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 &quot;this code was run through bazel&quot;. 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.<p>- Every import you write you have to write in two files or three if you have to export it. It&#x27;s double the typing work and finding the target is a pain because there&#x27;s no jump to definition of the Bazel target so it&#x27;s even more typing to find it.<p>- I wanted to use pytest and it was much more work, I don&#x27;t think I ever got it working. Normally there&#x27;s no setup you just run &quot;pytest&quot; and it discovers all the tests and runs them.<p>- Your code doesn&#x27;t start running as quickly.<p>- You have to type way more characters to start your code. I had aliases for every endpoint.<p>- There was something with tests where if the error log was too long it would just say &quot;there was an error, please find it in this randomly-named file&quot; and when you&#x27;re debugging a test whose error log is too long it&#x27;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.<p>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&#x27;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.
评论 #38500820 未加载
lolmisfortuneover 1 year ago
I worked at a startup using bazel, and had a strongly negative experience, for the following reasons:<p>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.<p>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&#x27;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.<p>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&#x27;t quite fit all your criteria.<p>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.
评论 #38497622 未加载
评论 #38497614 未加载
评论 #38500913 未加载
nostrademonsover 1 year ago
Also ex-Google engineer and founded a bunch of startups in my time away.<p>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.<p>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.
评论 #38500874 未加载
leoqaover 1 year ago
Don’t be the Google hire that makes everything complicated. Be prepared to be told no, or to bring a better argument.<p>We use Bazel at work and it’s sufficiently complex to write new rules. I’ve seen NX touted as a more approachable equivalent for smaller teams, maybe check it out?
评论 #38495118 未加载
评论 #38530123 未加载
Racing0461over 1 year ago
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.
Eridrusover 1 year ago
Also an ex-Googler. At a tiny startup of 4 engineers atm.<p>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.<p>Being able to trivially setup CI on Github has been very helpful and important to me.<p>Being able to easily add targets and package things that require multiple microservices has been nice.<p>People say you can use the native tooling, but what even is the native tooling for python? It doesn&#x27;t have a standardized packaging tool unless you count docker. pants&#x27; support for pex was important for me until we eventually adopted containers.<p>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.<p>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.<p>In the end, I&#x27;m pretty happy, I see it as an investment in CI, and the CI has caught a bunch of real bugs people pushed.<p>I think starting early here has been good, since the lift to get onto it has been small.
评论 #38500723 未加载
b20000over 1 year ago
I worked on a project where I used a Google framework that used bazel and it was a terrible experience, even though in the end I made it work. My first approach was to integrate the framework somehow into the build process I was used to (Makefiles, cmake etc), but then quickly found out this was going to be nearly impossible due to the way bazel works, so in the end I had to use bazel to build my project and to be able to add the framework as a dependency. I still had to hack into the framework bazel tree here and there. I lost a lot of time learning the quirks of bazel and in the end it contributed absolutely nothing and instead of bazel, cmake could have been used, a solution most people are familiar with. I think Googlers are generally on some kind of quest where they need to prove how smart they are by inventing all kinds of quirky weird new kind of &quot;wheels&quot; instead of using existing wheels to build a car, which causes problems for people who do not work at Google but are somehow forced to use Google&#x27;s solutions. I am wondering if Googlers are aware of the fact that by using&#x2F;inventing these kind of solutions their skill set becomes so specific they can&#x27;t leave Google anymore.
alejoover 1 year ago
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.<p>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 would take way too much effort for our small team to convert the 500+ repos we were building to release our software.<p>I have always dreamed of a time in which I’m able to fin a tool that fills this gap. Man, not having to build the same code that hasn’t changed over and over locally and in pipelines sounds so appealing.
评论 #38495454 未加载
评论 #38494857 未加载
oftenwrongover 1 year ago
This article might provide some insight:<p><a href="https:&#x2F;&#x2F;earthly.dev&#x2F;blog&#x2F;bazel-build&#x2F;" rel="nofollow noreferrer">https:&#x2F;&#x2F;earthly.dev&#x2F;blog&#x2F;bazel-build&#x2F;</a><p>My thoughts, as someone who has done a lot of build engineering, but that has only a small amount of experience with bazel:<p>If you are working with languages that are well supported by existing, maintained bazel rules, maybe. Otherwise, the answer is likely &quot;no&quot;. You do not want to take on the burden of maintaining significant rules, or figuring out how to mate your ecosystem of choice to an opinionated build system that nobody else in your ecosystem uses.<p>If you can manage with something easier to setup, it probably makes sense to do that instead. My general experience in startups is that you have to &quot;pick your battles&quot; constantly. You don&#x27;t have the luxury of infinite time and resources. Work on the build system has a high opportunity cost.<p>Most developers and other people who aren&#x27;t build nerds care about the answer to two questions in regard to builds:<p>1. Is the build fast enough?<p>2. Is the build working?<p>That&#x27;s it. This is frustrating when they don&#x27;t understand the other important aspects of build system quality, but it is also, admittedly, somewhat of a pragmatic perspective.<p>There is much leeway inherent in the speed question. If the build is slow, people can wait. Do they have any other choice? There is plenty of other work to do while they wait.<p>If the build doesn&#x27;t work, you, THE build guy, are going to feel the pressure to get it working again quickly. This often turns to bodging, and eventually to something resembling life support. However, nobody will care how much of a brittle, knotted mess the build code is if it still manages to mostly work.<p>To put it bluntly: A startup company can probably survive with a shit build system. And that might even be the right answer depending on the context.<p>I would personally be perfectly happy to get paid to set up a beautiful, apex example of a build system for a startup, whether it makes business sense or not. My professional integrity just won&#x27;t allow me to recommend that path unless I think it&#x27;s justified.<p>I might recommend to start with a script, or a makefile, or a ninja generator, and see how that works out first. After all, that is how Google did it for a long time before they decided to create Blaze.
twundeover 1 year ago
I&#x27;ve used pants at a small company &lt;10 engineers and worked at a company migrating to Bazel with 200+ engineers. Bazel used to take a dedicated engineer 3-6+ months to bootstrap the full setup (creating the build files, seeing up the Bazel server, updating CI to use Bazel correctly including caching) especially since the docs weren&#x27;t great from what I remember. I suspect that the time could be cut down by now especially if someone experienced with it does the implementation. Given the amount of time necessary for the setup, it typically makes sense for companies with monorepos with 50+ engineers although existing expertise would change the equation.
评论 #38495410 未加载
评论 #38500977 未加载
AlexITCover 1 year ago
A few years ago, I was involved in a team with less than 10 engineers, we decided to switch to bazel in order to improve the build times, specially the CI runtime.<p>On the good side:<p>- bazel forces you to have an acyclic architecture, still, this can feel annoying because every module needs to specify its dependencies.<p>- bazel does concurrent builds pretty well, optimizing the build times.<p>On the bad side:<p>- It took a considerable time to set everything up, we thought to be done but no, there was a weird stuff coming every week and most of the team ended up waiting for the bazel guy to fix it.<p>- IDE support was poor, in theory, we could just use intellij but most of the times it required help from the bazel-guy, in my case, I got frustrated about the needed maintenance and just accepted that an IDE wouldn&#x27;t work. - Given the lack of IDE, it means that we couldn&#x27;t easily execute a specific test from the UI, having to keep notes for the cli.<p>- In theory, you could use a shared cloud cache so that the builds are very effective but we could never set this up. - talking to engineers from other companies, they admitted that the bazel setup was hard and took a considerable amount of resources, they ended up writing many internal tools to get a effective usage.<p>Given that you plan to create a startup, do you plan to hire engineers? then, be prepared to the bazel-guy.<p>Also, as a startup, I bet your code will be small enough that the build times won&#x27;t be very different with normal build tools.<p>I&#x27;d personally not use bazel unless my company offers a dedicated engineer just to maintain this integration, I think its overkill for small companies.
khzw8yyyover 1 year ago
Our CTO is from Google and likes Bazel. It&#x27;s awful to work with and is slowing down development tremendously. The worst part is packaging up third-party dependencies.
benreesmanover 1 year ago
It just really depends on what the startup is doing.<p>If it’s a bunch of Python with a C++ extension (or mostly JVM or whatever), heavy build stuff is probably overkill.<p>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?<p>Then Pants, Bazel, and buck2 all have pros and cons.
otabdeveloper4over 1 year ago
If you actually want to go down this rabbit hole, then use Nix instead. It is an open community project, not a corporate monstorsity.
roland35over 1 year ago
I would stay away honestly! I am ex-Meta and even when I was working at Meta my entire team struggled mightily with Buck despite having access to all our internal resources!<p>When it works you almost forget about all the pain... But then once I took a peek at some of the custom build rules that I was blindly copy pasting and was blown away how complicated it all was. Thousands of lines of build code...
评论 #38501013 未加载
mischief6over 1 year ago
i have a lot of recent experience with yocto&#x2F;bitbake but none with bazel. do they have overlap? could they be used for some of the same things?
aristofunover 1 year ago
I&#x27;ve rarely had worse experience with infra tool in a big company.<p>Can&#x27;t imagine this layer of overengineered complexity can boost a startup, but can easily picture how it slow it down.<p>Your thinking is obviously distorted by some sort of google mentality.<p>Put your foot back to the real world please.<p>The world where you have competition, world where people need to get job done quickly.<p>Not in most technically sofisticated or mathematically cool way to brag about, but quickly and with as little overhead as possible.
dlahodaover 1 year ago
What about buck2?