Skip to main content

Changelog

The latest improvements to BuildBuddy.

·Maggie Lou

Configure the BuildBuddy CLI with .bbrc

You can now save BuildBuddy CLI options in a .bbrc file. It uses the same section and named-config syntax as a .bazelrc, but it configures bb rather than Bazel.

For example, this .bbrc enables streamed logs for every bb run and uses Linux runners for bb remote:

.bbrc
run --stream_run_logs
remote --os=linux
# Runs: bb run --stream_run_logs //app
bb run //app

# Runs: bb remote --os=linux test //...
bb remote test //...

You can also define named configs and select them with --bb_config:

.bbrc
remote:linux --os=linux
remote:linux --arch=amd64
bb remote --bb_config=linux test //...

The CLI automatically reads .bbrc from the workspace root and your home directory.

Only BuildBuddy CLI flags are allowed in .bbrc; regular Bazel options still belong in .bazelrc.

See the .bbrc documentation for more details.

·Maggie Lou

bb detect nondeterminism

You can now use the bb CLI to detect non-deterministic builds using the bb detect nondeterminism command.

The command runs a Bazel command twice with caching disabled, then compares the two compact execution logs with bb explain. Spans whose outputs differ between the two runs are reported as non-deterministic.

# By default, the command runs "build //...".
bb detect nondeterminism

# You can pass any Bazel command to run.
bb detect nondeterminism --bazel_command='build //foo:bar --config=linux'

Sending notifications​

To email all BuildBuddy org admins when non-determinism is detected, add --notify_email. To post a notification to a Slack channel, add --notify_slack=<SECRET_NAME>, where <SECRET_NAME> is the name of a BuildBuddy secret holding a Slack webhook URL.

Sending notifications requires an API key with the notification capability. Set it via the BB_NOTIFY_API_KEY environment variable:

BB_NOTIFY_API_KEY=<API_KEY> bb detect nondeterminism --notify_email

Running on a schedule​

To schedule a nightly nondeterminism check to catch regressions, you can configure a scheduled Workflow in your buildbuddy.yaml:

buildbuddy.yaml
actions:
- name: Nondeterminism check
triggers:
schedule:
crons:
- "0 8 * * *" # 8:00 AM UTC every day
steps:
- run: bb detect nondeterminism --notify_email --notify_slack=SLACK_WEBHOOK_SECRET_NAME
platform_properties:
# Caching is disabled for this check anyway, so recycling adds little.
recycle-runner: false
·Tyler French

End-to-end CDC support

We're excited to announce end-to-end content-defined chunking (CDC) support for Bazel remote caching in BuildBuddy.

With Bazel 9.1 and 8.7 support for --experimental_remote_cache_chunking, large outputs like linker artifacts can be uploaded and downloaded in content-defined chunks instead of as monolithic blobs. That lets BuildBuddy deduplicate similar artifacts across builds, reducing upload bandwidth and storage usage. In one benchmark on the BuildBuddy repo, this showed roughly 40% less uploaded data and a roughly 40% smaller disk cache. Breaking large blobs into smaller reusable pieces also means fewer long-running RPCs and more granular retries.

To enable it, add this flag to your .bazelrc:

common --experimental_remote_cache_chunking

To see the download-side savings, you should also set --disk_cache, since the downloaded chunks need to be stored somewhere in order to be reused locally. We also recommend setting --experimental_disk_cache_gc_max_age to a value below your remote cache TTL—for example, 3h, or 1d if your remote TTL is longer.

Bazel 9.1 and 8.7 support this flag.

For more background, see bazelbuild/bazel#28437.

For a deeper dive, see No More Large Outputs: Introducing Remote Cache CDC.

·Maggie Lou

Run log streaming

In addition to build logs, you can now use the bb CLI to stream bazel run executable output to our servers and view live-updating run logs from the UI.

run log streaming

This gives you a durable record of executable output, making it easy to share logs with teammates, or letting you monitor runs while away from your terminal.

To use it:

bb run //app:server --stream_run_logs

By default, if streaming fails, the executable will continue to run. To fail the command immediately, use --on_stream_run_logs_failure=fail.

·Dan Stowell

Improved handling of short-lived secrets in remote execution

BuildBuddy has supported passing short-lived secrets to remote actions via the env-overrides platform property, which redacts values from action cache entries. The new secret-env-overrides and secret-env-overrides-base64 properties extend this protection by also redacting values from workflow logs.

Pass secrets via remote exec headers so they're injected at invocation time without affecting the action hash:

bazel build //my:target \
--remote_exec_header=x-buildbuddy-platform.secret-env-overrides=API_KEY=sk-abc123,OTHER_KEY=val

For values containing commas or special characters, base64-encode each KEY=VALUE pair:

bazel build //my:target \
--remote_exec_header=x-buildbuddy-platform.secret-env-overrides-base64=$(echo -n 'CREDS={"token": "abc"}' | base64)

See the Secrets docs and RBE platform properties reference for more details.

·Fabian Meumertzheim

bb explain: understand why your build re-ran actions

bb explain shows a structural diff of two compact execution logs. It helps answer the common questions: "Why did Bazel re-execute that action?" and "What changed between these builds?"

bb explain

It can highlight non-hermetic outputs and differences in inputs, environment variables, and arguments.

It works with your last two builds automatically, or you can point it at any invocation IDs:

bb explain
bb explain --old <OLD_INVOCATION_ID> --new <NEW_INVOCATION_ID>

You can download the bb CLI here. More details in Fabian's BazelCon talk.

·Siggi Simonarson

Compare invocations: compare two builds side-by-side

The compare invocations view allows you to diff two invocations side-by-side.

It can help debug why two builds produced different results by showing exactly what changed: different flags, startup options, cache/remote execution settings, status, and more.

To compare invocations:

  1. From one invocation link, select Compare -> Select for comparison in the top right corner.
  2. From another invocation link, select Compare -> Compare with selected.
  3. For even more details on differences between the two invocations, click the Run bb explain button on the compare invocations page.
·Siggi Simonarson

Compare actions: compare two actions side-by-side

The compare actions view allows you to diff two actions side-by-side.

This can help pinpoint why two seemingly similar actions produced different results or didn't result in a cache hit.

To compare actions:

  1. From an invocation link, you can find the desired action either in the Cache or Remote Execution tabs.
  2. Click through to the Action Details view.
  3. Click Compare -> Select for comparison in the top right corner.
  4. Find the other action you want to compare it against.
  5. Click Compare -> Compare with selected in the top right corner of the second action.