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.

Bazel 2.0

160 pointsby the_alchemistover 5 years ago

12 comments

malkiaover 5 years ago
One issue we hit with our CI, and mix of build systems is this - given a changelist, find out which targets needs to be built, and which one needs to be tested on pre-submit, and which on post-submit.<p>With that, we end up paying so much extra time building everything over and over without need, and then not building things that we ought to.<p>So that&#x27;s one reason to switch, but at the same time lots of people simply do not get it. To them it seems intrusive, new, opinionated, and makes them not happy to use it. I&#x27;ve used it for 2+ years at google, and yes initially - was WTF is this? Then it hit me... And I&#x27;m sure the same is for buck, pants, please.build, gn and other similar systems.<p>At the end of the day, you need way to express &quot;end to end&quot; your build graph, from any single individual source file, shell script, or configuration downto building your executables, deploying them, etc.<p>It&#x27;s an industry tool, that needs to be looked, and if it takes 5 people to support it, then it takes 5 people to support it, but you won&#x27;t be wasting other peeople&#x27;s time on issues like - &quot;Why this build in the CI did not trigger?&quot;, why it takes, and wastes my time (waiting for presubmit), etc.<p>Yes, it does not come for free, but it&#x27;s worth knowing and trying it out at least.<p>If nothing else, here is the takeaway - Try to use a system with static graph, where relationships are known before you start building things. It&#x27;s not always there, e.g. your #include &quot;header.h&quot; file is dynamic, but bazel forces you to express even that, and later it catches it whether you&#x27;ve done it, and breaks unless it&#x27;s fixed.
评论 #21867927 未加载
habitueover 5 years ago
Good heuristic for whether it&#x27;s worth considering moving to bazel for your build system:<p>- Do you have 200+ developers working on a monorepo?<p>- Are you willing to vendor all of your dependencies and maintain their builds yourself?<p>If so, consider it. The productivity you&#x27;re losing to unnecessary rebuilding and re-running unchanged unit tests will probably be paid back if you can contort your development process to the one Bazel expects.<p>If you&#x27;re a small shop, the benefits Bazel is going to provide over, say, Make (or whatever standard build system your primary language uses), are going to be minimal. And the overhead of maintaining Bazel is going to cost you a ton of developer time you may not be able to afford.
评论 #21867100 未加载
评论 #21866347 未加载
评论 #21867028 未加载
bobdobbs666over 5 years ago
I was subjected to bazel on a small project because the manager insisted we use it. The rest of the company used a number of either custom tools or cmake or premske.<p>It is utter hell when you have tons of third party libraries (internal or external to the company) that you don’t have the source to and it is especially painful when trying to integrate bazels behavior against other build systems. Also bazels packaging and use of internal symlink renaming was a constant source of suffering. Bazel pretty much destroys a number of totally valid work linux commands for looking for so files.<p>Bazel might be useful in the case of a monorepo with a massive engineering pool AND a massive cloud infrastructure backing that repo to handle all the artifact sharing, but after having used cmake, premake, waf, random perl and ruby scripts, or just checking vs projects into perforce manually, I’d pick any of those before bazel for most projects. I say that having worked on code bases from a few 10s of thousands to 25+ million LoC with teams small, large, and distributed.<p>Bazel probably has its place but I have yet to find it.
评论 #21868266 未加载
ddevaultover 5 years ago
For anyone thinking about Bazel for their project&#x2F;organization... run as fast as you can in the opposite direction. It&#x27;s easily the most complex and unintuitive build systems in the world, and I&#x27;m saying that as someone who used SCons. At the last job where I used it, I was on a team of 5 whose responsibilities included Bazel upkeep, which required anywhere from 10 to 50% of our time. This was used by a broader engineering team of 50, working on 3-5 &quot;big&quot; projects and a few dozen small ones.
评论 #21864216 未加载
评论 #21864225 未加载
评论 #21864381 未加载
评论 #21864244 未加载
评论 #21865445 未加载
评论 #21866851 未加载
评论 #21865377 未加载
评论 #21864543 未加载
评论 #21865420 未加载
评论 #21864457 未加载
评论 #21864692 未加载
kylecordesover 5 years ago
As with many projects using semantic versioning, the major version bump just signifies there are some breaking changes. Most projects will just switch from 1.x to 2 work noticing.
评论 #21863916 未加载
评论 #21863900 未加载
评论 #21864384 未加载
评论 #21864162 未加载
JadeNBover 5 years ago
I didn&#x27;t know, so, just for anyone else who didn&#x27;t:<p>&gt; Bazel is an open-source build and test tool similar to Make, Maven, and Gradle. It uses a human-readable, high-level build language. Bazel supports projects in multiple languages and builds outputs for multiple platforms. Bazel supports large codebases across multiple repositories, and large numbers of users.
kovekover 5 years ago
I’ll jump here to say that Bazel 1 was awesome, and I’m looking forward to trying out Bazel 2.<p>I was wondering how to make sure Bazel doesn’t rebuild something it has built previously? (Caching)
评论 #21865272 未加载
breatheoftenover 5 years ago
Does bazel use the word “provenance“ at all?<p>Provenance is a word I first saw advertised in a platform called dotscience.io — that I find fundamentally interesting. And it seems quite relevant to hermetic builds.<p>Provenance is about giving any state derived from an arbitrary computation an identity that is derived from the content hash of the inputs needed to re-compute that state ... in dotscience they achieve this by instrumenting io and creating zfs filesystem snapshots when computing new provenance artifacts.<p>I think this concept could be the ultimate building block for a build system — and it could become the job of oses&#x2F;containers&#x2F;runtimes&#x2F;databases to Coordinate to allow this abstraction to be tracked with sufficient efficiency that programmers would feel allowed to freely use the concept of provenance when building ... it seems to me like provenance could provide all the information needed to support a distributed build cache? You wouldn’t actually need a build language at all — just an api in each language to ask for the saving of provenance artifacts. The artifact would hold all the info needed to be able to recompute the artifact with the same state — which is also all the info needed to decide when the artifact is out of date ...?
评论 #21866590 未加载
zmmmmmover 5 years ago
Build systems seem to sit in that category of perenial category of things that keep getting re-invented, and either recapitulate existing problems or create new ones.<p>I don&#x27;t think people will ever fundamentally all agree on:<p><pre><code> - static vs dynamic configuration - custom language vs piggy back on existing - intelligent, deeply integrated &#x2F; understands code it is building vs &quot;language agnostic&quot; but necessarily shallow integration </code></pre> All of these are fundamental tradeoffs that mean every tool will have limitations that about 50% of people don&#x27;t like. And so we will keep re-inventing forever I think.
klysmover 5 years ago
Didn’t this just hit 1.0?
评论 #21865027 未加载
djsumdogover 5 years ago
I hadn&#x27;t heard of this, and see there is a lot of concern over using this project except for specific use cases.<p>I&#x27;m always weary of build tools that try to do multiple languages. On Scala projects I use SBT, and for people who have tried to hack on SBT itself or its plugins, you know it&#x27;s a big mess under there. On other projects I&#x27;ve tried using Gradle with Scala, but I found a lot of times Gradle just wasn&#x27;t setup for a Scala workflow or was missing essential tooling to make it as effective as SBT (although its configuration is considerably more sane). Most of the tooling and plugins around Scala are built around SBT as well (for better or for worse).<p>I try to stick with the major tool for a given language; cargo for Rust, SBT for Scala, the built-in tooling for go, with the exception of Java projects where I&#x27;d gladly take gradle over the hellscape that is Maven.
评论 #21866317 未加载
theodorejbover 5 years ago
I miss the days when JavaScript frameworks could be built with a simple npm install and executing a Grunt&#x2F;Gulp file. Now to build Angular I need Yarn, Java, Bazel, and hundreds of megabytes of additional tooling downloaded by the build script. On a slow connection it takes ages to download everything, and even then the build often fails (on Windows I have yet to get it working successfully).<p>Edit: I&#x27;m referring to building the framework itself (e.g. to contribute a fix). Building an Angular project with the CLI works quite well.
评论 #21865189 未加载