Scaling Rust Builds with Bazel

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

Our great sponsors
  • CodiumAI - TestGPT | Generating meaningful tests for busy devs
  • Sonar - Write Clean Java Code. Always.
  • ONLYOFFICE ONLYOFFICE Docs — document collaboration in your environment
  • InfluxDB - Access the most powerful time series database as a service
  • Bazel

    a fast, scalable, multi-language and extensible build system

    > "yeah this was written for a Google project, that other use case didn't apply to our project"

    Not only is that a very narrow set of use cases (Read: they only deploy statically linked binaries on mostly unix-y environments), Even the fixes for those very basic use cases take for ever.

    Eg. This 7 year old issue is still open: https://github.com/bazelbuild/bazel/issues/1920 . To be able to create a statically linked library, we had to use: https://github.com/hotg-ai/librunecoral/blob/master/runecora... . Had to use some weird hack to build shared libraries too. Overall, it was just annoying.

  • buck2

    Build system, successor to Buck

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

  • CodiumAI

    TestGPT | Generating meaningful tests for busy devs. Get non-trivial tests (and trivial, too!) suggested right inside your IDE, so you can code smart, create more value, and stay confident when you push.

  • depot

    @ghuntley's personal monorepo [Moved to: https://github.com/ghuntley/ghuntley] (by ghuntley)

    hmm. this migration would have been possible with staying with nix and developing a rules_rust equivalent (maybe it already exists) - see https://github.com/ghuntley/depot/tree/trunk/nix/buildGo for example but for golang. provides a simple dsl over nix and hides nix.

  • bazel-example-rust

    An example repository demonstrating Bazel rust_binary and rust_library build targets.

    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.

    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

  • envoy

    Cloud-native high-performance edge/middle/service proxy

  • rules_jvm

    Contributed Bazel rules that make working with java projects more pleasant

    It is super tedious but for some languages a tool called Gazelle can auto-generate these for you. I know Go works well and there is a Java plugin too [0]. There is definitely some level rust support because that is how external crates are handled.

    0 - https://github.com/bazel-contrib/rules_jvm/tree/main/java/ga...

  • opentelemetry-cpp

    The OpenTelemetry C++ Client (by malkia)

    This is my own fork of OpenTelemetry C++ that builds (using bazel with my changes) OpenTelemetry C++ .dll for Windows - https://github.com/malkia/opentelemetry-cpp

    to show how awesome bazel is - in one step it can build (compile) and package them into a .zip file ready to deploy to NuGet-like repo or other place.

  • Sonar

    Write Clean Java Code. Always.. Sonar helps you commit clean code every time. With over 600 unique rules to find Java bugs, code smells & vulnerabilities, Sonar finds the issues while you focus on the work.

  • librunecoral

    > "yeah this was written for a Google project, that other use case didn't apply to our project"

    Not only is that a very narrow set of use cases (Read: they only deploy statically linked binaries on mostly unix-y environments), Even the fixes for those very basic use cases take for ever.

    Eg. This 7 year old issue is still open: https://github.com/bazelbuild/bazel/issues/1920 . To be able to create a statically linked library, we had to use: https://github.com/hotg-ai/librunecoral/blob/master/runecora... . Had to use some weird hack to build shared libraries too. Overall, it was just annoying.

  • bazel-ex-20230324

    Not sure if this is what you're looking for exactly, but: https://github.com/jvolkman/bazel-ex-20230324

  • magma

    Platform for building access networks and modular network services

  • bazel

    Correct, reproducible, and fast builds for everyone. (by ulfjack)

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts