Comment by hansvm

4 months ago

Bazel solves a ton of problems other systems don't, but it introduces a ton of its own. If you can afford (or are currently accidentally affording) 2-3 FTEs managing builds, that's all you need to scale Bazel indefinitely and solve basically all of the rest of your build problems. If you can't afford a dedicated Bazel team then it's absolutely not worth using on anything more than a single "team" (people talking to each other every day, a dedicated Bazel xoogler, probably 5-13 people).

As to the actual "why", even little things like BUILD files requiring you to enumerate dependency graphs gives you a leg up that you _can_ implement in other build systems, but likely won't. Whether you're a "monorepo" or not, you still have all your code living _somewhere_ as a monorepo, and the only question is how good your tooling is. How easy is it in your system to "run all tests properly depending on the set of changed files"? That's easy in Bazel and hard in every other solution I've seen (possible of course, but those sorts of constraints aren't the happy path for other build systems, so teams don't tend to build that way without a very solid lead imposing that strategy).

I've recently had bazel inflicted on me.

I don't get it, at all.

What should I read that will make me happier at having to use it?

  • It's mostly happy for people who don't have to deal with it.

    If you are an "end user" who just wants to run your damn code without caring about your dev environment, then `bazel run|build|test //thing/to/run:target` is about as good as you can get! _If bazel is already set up_, I don't have to worry about my environment! It just works.

    If your environment has a lot of churn and there isn't a team who makes sure bazel is actually configured correctly, then, yea, it is massive overkill for a lot of things and if you try to do things how you normally would and not the bazel way, you'll have a bad time.

    There are other benefits - sometimes you want public APIs so it _can_ be used, but you want visibility rules to limit _who_ can use it. It is great for it's cacheability and dependency tracking - if you need advanced build tooling, it has what you need!

    But there is a very real chance you don't need any of these things and so the cost is not worth it.

    (I, personally, hate dev environment churn, so just having the CLI tooling uniformity is enough for me.)