Scaling Rust Builds with Bazel

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

Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • SaaSHub - Software Alternatives and Reviews
  • 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

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
  • depot

    Discontinued @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.

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • 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.

  • 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