Skip to content

hushrun and Bazel

Updated

Bazel is a build system that reuses builds and test results from every target's declared inputs, across a large codebase in many languages. hushrun wraps the commands you already have, and skips one when the repository's files already passed. Bazel is far more precise, and takes far more to adopt.

Bazelhushrun
SetupBUILD files for each package, with rules for each languageOne hushrun run per command
KeyEvery action's declared inputsThe repository's files or a scope's, the check's name, the exact command and the directory
A one-file changeReruns what depends on that fileRuns every check, unless you set scopes
On a hitReuses outputs from the cacheSkips the command and restores nothing
Promotion to productionNoYes

How Bazel reuses results

Bazel's remote cache is an action cache and a content-addressable store, over HTTP or gRPC. Sharing works when an action's outputs depend only on its declared inputs. With --cache_test_results=auto, a test reruns when it or a dependency changes, when it's marked external, with --runs_per_test, or after a failure.

Precision comes from describing the project. A package is a directory with a BUILD file, and each target lists its inputs. Hermetic builds are what make the results trustworthy.

How hushrun differs

  • Adoption takes minutes. One wrapper, not a migration. Bazel is a project of its own for most teams.
  • Precision is coarser. hushrun has no dependency graph: it knows the files, and the scopes you draw. In a repository where most changes touch a few of thousands of targets, Bazel wins.
  • It trusts you on what's outside the files. Bazel can isolate a test from undeclared inputs. hushrun can't: a check that reads an environment variable needs a name per variant.
  • It goes on to deploy. Promotion deploys the artifact staging validated, by digest, with signed evidence.

Using both

Bazel already skips work inside a run, so wrapping it saves the rest: analysis, and fetching from the cache, on code that already passed.

package.json
"scripts": {
  "test": "hushrun run -- bazel test //..."
}

Which to choose

  • Choose Bazel for a large, multi-language codebase with a team that can own the build.
  • Choose hushrun when you want repeated checks gone without changing how the repository builds.
  • If you're looking for a Bazel alternative because the migration is too much: hushrun gets you the reuse of passing checks, not faster builds. Bazel's FAQ compares it with Make, Ninja, Maven, Gradle, Pants and Buck, and Nx or Turborepo suit JavaScript monorepos.
Markdown