Live data from Hacker News

Scaling Rust Builds with Bazel

mmapped.blog

61–70 of 133 posts

Re: Scaling Rust Builds with Bazel

#61
post #12

Hey, what a surprise, ex-google engineers dragging everyone into bazel... Maybe you have some really complicated use case that makes cargo insufficient, but really, it's pretty damn nice and it's integrated with everything. There are languages that need bazel, rust isn't one of them

In addition to the problems stated in the article that you're ignoring here, in any large enough system, you are going to use multiple languages. Cargo isn't built for that. Bazel is.

Re: Scaling Rust Builds with Bazel

#62
post #12

Hey, what a surprise, ex-google engineers dragging everyone into bazel... Maybe you have some really complicated use case that makes cargo insufficient, but really, it's pretty damn nice and it's integrated with everything. There are languages that need bazel, rust isn't one of them

> Maybe you have some really complicated use case that makes cargo insufficient, but really, it's pretty damn nice and it's integrated with everything. I feel like our use case at Grapl wasn't particularly crazy. It was just slightly more than "I'm a dev building a library and publishing it" - we had a workspace with multiple devs and CI/CD. CI/CD was really slow - issues with caching, rerunning unnecessary tests, et…

This. As soon as you have to integrate multiple languages, jumping from the native build tool to an integrated build tool is a must. Why? So that you can saturate all your threads in an efficient way.

Re: Scaling Rust Builds with Bazel

#63
I think this would have been useful with some code. My experience with Bazel is that you need a BUILD file in each subdirectory or something like that and every time I add a file I have to add it to that BUILD file.

Exceedingly tedious to use and has poor support in Clion.

It is likely that I don't have the constraints that this company has. The last time I tried this in Java I had to replicate my package dependency graph in Bazel. It was exceedingly pointless.

I found an example repo for rust and Bazel and it is just as tedious as I recall https://github.com/laramiel/bazel-example-rust

Re: Scaling Rust Builds with Bazel

#64
post #12

Hey, what a surprise, ex-google engineers dragging everyone into bazel... Maybe you have some really complicated use case that makes cargo insufficient, but really, it's pretty damn nice and it's integrated with everything. There are languages that need bazel, rust isn't one of them

Bazel isn't about a particular language needing its build facilities - its about ALL of your organizations languages being built with one tool, ideally in one monorepository. Its very attractive when you have lots of microservices that would otherwise live in disparate repositories. Using a monorepo and Bazel allows you to share api definitions (proto files) across your entire code base (rules_proto, rules_grpc) , so you see immediately what api changes impact existing code across your entire organization, regardless of what languages each component is coded in.It allows you to containerize (rules_docker) and deploy (rules_k8s) only the components that need to be redeployed with every commit. It allows your entire development team to live, code, test, build, and deploy in harmony.

Re: Scaling Rust Builds with Bazel

#65
post #12

Hey, what a surprise, ex-google engineers dragging everyone into bazel... Maybe you have some really complicated use case that makes cargo insufficient, but really, it's pretty damn nice and it's integrated with everything. There are languages that need bazel, rust isn't one of them

> Maybe you have some really complicated use case that makes cargo insufficient, but really, it's pretty damn nice and it's integrated with everything. I feel like our use case at Grapl wasn't particularly crazy. It was just slightly more than "I'm a dev building a library and publishing it" - we had a workspace with multiple devs and CI/CD. CI/CD was really slow - issues with caching, rerunning unnecessary tests, et…

Hey Colin :wave: (I hope you're bringing Rust to DD)

To add onto this, Grapl had a moderate sized codebase with less than 10 engineers. I do think we could have done some optimizations in cargo, but it's simply much easier to use a tool like Bazel/pants etc that does the work for you as long as it supports your language of choice.

Re: Scaling Rust Builds with Bazel

#66
post #42

Earlier quoted context omitted.

At the only job I've had where Bazel was in use, we had a team of 4-5 engineers dedicated to maintaining Bazel for a larger team of about 25. Bazel is a nightmare . I wouldn't wish it on my worst enemy.

I worked at a company where a DevOps team was 5 to support a team of 35. They hired someone incredibly talented, knowledgeable and driven for change. They shrunk in size and are still over capacity and could now be 2 only. Don't look at headcount to gauge complexity, difficulty, etc. What I've experienced is the larger the team the more likely to have dilution of ownership. The less ownership the less likely each per…

Oddly, I'd say headcount can often be a driver of complexity.

In two ways, one being that more people legit need a more complicated system. You want that so that they interact with the system, not with each other.

The other being a bit of a Parkinson's Law. That is specifically that you will expand work to fit the allocated time; but I posit that you will also expand work to fit the people doing it. So, more people pushing ideas into the codebase will keep more ideas in the codebase. Even if fewer would work.

Re: Scaling Rust Builds with Bazel

#68
post #3

If you want something similar thats written in Rust instead of Java, look at Buck2 https://github.com/facebook/buck2

I would rather have a look at Pants since it's now developed for the needs of Toolchain's customers, and not following the roadmap of a big company with a pretty unique infra. Its engine was also rewritten from Java to Rust.

I cannot wait until Pants supports Rust as a target language (they were looking for rust consumers as of 3-6 months ago if I recall). For our python needs it was a real breath of fresh air. I'm now at a shop without it and need to deal with slow dependency installs and dependency conflicts again :'(

Re: Scaling Rust Builds with Bazel

#69
post #5

The joy of tooling. If there's one tool it's not a mature ecosystem, if there's two, there's no standard way to do things. "Cargo is not a build system" reminded me of "Cabal is not a package manager" https://ivanmiljenovic.wordpress.com/2010/03/15/repeat-after...

Wait til you see the eight ways Nix has of packaging Rust applications! https://nixos.wiki/wiki/Rust#Packaging_Rust_projects_with_ni...

And they’re all horrible

Re: Scaling Rust Builds with Bazel

#70
post #3

If you want something similar thats written in Rust instead of Java, look at Buck2 https://github.com/facebook/buck2

I was wondering the same. I’ve heard of Buck2 the other day and it seems much better. Anyone has tried both?
Post reply on HN