Aspect Build, built on Bazel

Alex Eagle's photo
Alex Eagle

Published on Nov 17, 2021

3 min read

We've been hard at work building a great consulting business at Aspect. We are helping some large companies like Robinhood and Boston Dynamics migrate their build, test, and CI systems to Bazel. However, it's clear from all our engagements that Bazel itself is incomplete. We are excited to announce some products we've built to help fill in this gap.

Rules Docsite

Bazel doesn't come with "batteries included". It only understands a few languages in the built-in distribution like Java, Python, and C++. For everything else, it relies on plugins called "rulesets".

The first problem our customers found with rulesets is that the documentation is lacking. There is usually a very simple example of usage, and then as soon as you need something more real, you are stuck reading sources. So we've launched the first Bazel rules docsite, at

docs.aspect.dev

Our docsite scrapes the generated API output of canonical rulesets, using the resulting protocol buffers to drive a custom site. It's blazing fast because the content is all build-time pre-rendered. Other features of our docsite:

  • Unified: All the Bazel rules documented in a single place.
  • Search: You can search across the documentation for all rulesets.
  • Versioned: Every documentation page is permalinked to an exact version and won't change. You can select the version of a ruleset that you use.
  • Deep-links: You can link directly to an attribute of a rule, so it's quicker to help out your fellow humans.

Ultimately our goal is to improve the upstream documentation across the rulesets by making the documentation easy to edit in-place, with the convenience of a wiki, through a standard pull request process.

BUILD file generation

Bazel's BUILD files are wonderfully explicit and self-contained, but largely mirror dependency information that was already evident in the source files. At most clients we've observed that Product Engineers don't want to learn about build systems, and we think they shouldn't need to.

Aspect is making a big investment in Gazelle, which automates maintenance of BUILD files. We upstreamed the Python Gazelle plugin to rules_python and have started work on plugins for TypeScript and other languages.

Rules Authors SIG

We've long been the core maintainers of rules_nodejs and also help to maintain rules_python and rules_docker. After working with our clients, we have a much better appreciation for how much companies depend on these rules, yet how little maintenance effort goes into them.

Sadly many corporate contributors haven't been able to get their changes merged, and maintainers haven't benefitted from the resources these large companies can provide. For this reason, we led the creation of the first Special Interest Group (SIG) under Bazel's new SIG program. Find it at SIG Rules Authors.

More usable CLI

We see that most engineers interact with Bazel on the command-line, and many are baffled by its complex error messages and unfamiliar terminology. It's an expert tool, being used by engineers who would rather not become build system experts.

aspect is a new command-line interface wrapping Bazel. The aspect CLI is interactive, and customizable for your organization's developer workflows. It's compatible with bazel so you can switch back and forth easily. While it's currently a pre-release, we are excited for the future of this tool.

Read more at https://aspect.build.

We can't wait to build a better Bazel!

If you're as excited about build tooling as we are, then let's work together! You can join our team on the Aspect careers page or participate in the SIG as a funder or a coder.

 
Share this