TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Bazel Fawlty

75 点作者 elrodeo大约 7 年前

13 条评论

venantius大约 7 年前
I have worked extensively with Bazel in the context of migrating a very large Java&#x2F;Scala codebase from Gradle to Bazel.<p>My impression is that it is a first-class build system _specifically for Java and C++_. There are specific properties of the compilation and packaging ecosystem around those languages and runtimes that make them uniquely in need of tools like Bazel. This is not true for Go, where build speed and large codebases were a consideration up-front (especially with the new build caching features that shipped in Go 1.10), and are almost completely irrelevant in the context of &quot;interpreted&quot; languages like Python, Ruby or JavaScript.<p>There are plenty of other languages and runtimes that stand to benefit from a tool like Bazel, but just because Bazel is a fantastic tool in some contexts doesn&#x27;t mean it brings that much to the table in others.
评论 #16529930 未加载
评论 #16533786 未加载
评论 #16528812 未加载
elteto大约 7 年前
It seems like Bazel&#x27;s support for Go is still not first class and a lot of the issues mentioned here come from that.<p>But it strikes me as odd that they are figuring all of this out _now_, as opposed to a year ago when they first switched. Why did they switch to bazel in the first place? Did they do a trade study&#x2F;test drive?<p>All of the problems mentioned (more complex build files and workflow, increased build times, lacking support for Go) you can find out right away as soon as you do a test drive. Unlike C++ or Java, it seems like the native go build tooling was always superior to what Bazel could offer, and they knew that. Why switch then?<p>In my experience using Bazel in a large and complex C++ codebase, it has been nothing short of amazing, compared to the CMake horror show that we had... We did have problems with it though, but mostly the lacking documentation in some areas, like building toolchain files, or the fact that support for Windows only got really good a couple of releases ago only. We did identify all of these in the initial migration effort and none of them was by itself a showstopper.
评论 #16529608 未加载
Sir_Cmpwn大约 7 年前
We&#x27;ve been using Bazel at work, where we have a monorepo with lots of different languages at play (Python, Go, Java, Scala, JavaScript, CoffeeScript, TypeScript, Protobuf, just to name the major players) and I like that it makes all of them use a consistent interface for configuring and running builds. It helps that we have a specific team handling most of the Bazel work - and it costs about 10% of all of that team&#x27;s time.<p>That&#x27;s about the only thing I like about it, though. It&#x27;s the most complicated build system I&#x27;ve ever used and I still don&#x27;t fully grok it after 7 months working in this position.
评论 #16531639 未加载
zellyn大约 7 年前
If your entire codebase is Go, you really shouldn&#x27;t be using Bazel&#x2F;Pants&#x2F;Buck&#x2F;Please. Go&#x27;s built-in build system is perfectly adequate for just Go, with light tooling for generated code (eg. protobufs).<p>It&#x27;s when you have multiple languages and want to be able to build&#x2F;test only what has changed that you need a Blaze-alike.<p>With regards to Gazelle: is it intended to be run every build, on every file? Or is it intended to be hooked into your editor, and run on save to update your BUILD files as you go? At Google, I used the latter kind of tool, and it worked just fine. If it missed something, you&#x27;d notice when the CI system failed to build&#x2F;test your change.
评论 #16529666 未加载
EtDybNuvCu大约 7 年前
Have you tried Nix? It&#x27;s like Bazel, but without incremental builds. The boons are pretty great.<p>I&#x27;m extremely disappointed, as a career SRE, to see &quot;hope is not a strategy&quot; trampled in the mud. I understand that perhaps the author has succumbed to epistemic helplessness and given up on having computers work without optimism or belief, but computers do not operate on any ruleset which includes hope, and we should not encourage magical thinking.
评论 #16532114 未加载
评论 #16533551 未加载
philip1209大约 7 年前
When we used Bazel at Staffjoy, we had two main issues:<p>(1) NPM dependency management was hard. We ended up committing built dist files, like index.html<p>(2) We ended up duplicating dependencies between Bazel and Glide because tools like goimports and linters could not read the Bazel remote dependencies system.<p>We open-sourced the repo with Bazel when we shut down -&gt; <a href="http:&#x2F;&#x2F;github.com&#x2F;staffjoy&#x2F;v2" rel="nofollow">http:&#x2F;&#x2F;github.com&#x2F;staffjoy&#x2F;v2</a>
Aissen大约 7 年前
<i>It added a dependency on the JVM. (I probably have an overly painful past with the JVM in production), suffice to say we had to bump up the RAM on the build machines.</i><p>This alone is a reason not to use Bazel. It&#x27;s designed for the enterprise in mind, where JVMs are common, sharing a common build environment in a team is easy (or at least, the setup time isn&#x27;t an issue).<p>For a community project, this type of thing wouldn&#x27;t fly. There&#x27;s a reason Meson is winning the latest build-systems war: it only depends on python3 &amp; ninja.
评论 #16529668 未加载
ggambetta大约 7 年前
&gt; Hope is a strategy [...] At some point we have to hope and assume. for example eventually we hope the compiler authors did a good job with the next version we are about to use, or we assume that the kernel fix was good.<p>Or you can do a very slow, controlled rollout of the new version and see what happens. With all the systems I worked with while at Google, both as a SRE and a SWE, whenever we had a new version to release, we&#x27;d update <i>one task in one cluster</i>, let it run for a day or two, check the logs and the metrics... if it was OK, update one job in one cluster, then repeat the process with an entire cluster (the designated canary cluster), and only then release to the rest of the clusters. If any of these went wrong, we&#x27;d rollback or patch, depending on the severity. We rarely missed our weekly releases.<p>I&#x27;m sure the same applies to a new compiler version or a new kernel fix. You don&#x27;t need to assume anything.
评论 #16529718 未加载
sarabande大约 7 年前
Thanks for the comments on Bazel -- I am evaluating a proper build system for us right now for a data science codebase almost entirely in Python, with a lot of scientific computing dependencies. Bazel doesn&#x27;t yet seem to have first-class support for Python, so that&#x27;s out, and I&#x27;m running into a lot of problems with Twitter Pants, although their Slack channel is really helpful.<p>Did you ever try using Pants or Buck, or a more barebones approach like Ninja?<p>P.S.: An explanation of the pun on &quot;Basil Fawlty&quot; (as a non-Brit, I thought, what on earth is that?) in the article might be helpful.
评论 #16528500 未加载
评论 #16528457 未加载
评论 #16530969 未加载
评论 #16529645 未加载
评论 #16528754 未加载
评论 #16528801 未加载
评论 #16529864 未加载
erain大约 7 年前
For your docker container needs: &quot;Bazel should in theory be able to decide if a docker image should be rebuilt&quot;<p>You can checkout Bazel&#x27;s docker rule: <a href="https:&#x2F;&#x2F;github.com&#x2F;bazelbuild&#x2F;rules_docker" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;bazelbuild&#x2F;rules_docker</a><p>Also, go already has a very good build sysmtem build-in, and hazel really shines when: - you have a complex codebase with multi-languages: one can build a tool in one language and use it as tool for a another language. - you simply have a really large code base - you can work on the path &#x2F;&#x2F;service1&#x2F;my&#x2F;service and your colleague can work on &#x2F;&#x2F;service2&#x2F;their&#x2F;service, and only the path got changed needs to rebuild every time.
评论 #16528780 未加载
pvg大约 7 年前
What&#x27;s the context for this - as in, the &#x27;we&#x27; in question and the thing they were building with bazel? And are they really posting from March 16, 2018?
评论 #16528767 未加载
评论 #16528538 未加载
meanmrmustard92大约 7 年前
After Python and Bazel, I fully expect a programming framework named &#x27;Wanda&#x27; to crop up somewhere. Cleese would be so confused.
kemenaran大约 7 年前
Interesting to have feedback on Bazel usage outside of Google. Bazel looks like a great tool, but it&#x27;s good to see the community starting to explore its sweet spots and drawbacks.