bep

The bep tool is a powerful utility for analyzing Bazel builds. It generates detailed reports in the Build Event Protocol (BEP) format, which provides a structured stream of events about a build's execution. This data is invaluable for debugging build failures, analyzing dependency graphs, and understanding build performance.

The tool operates by running the bazel fetch or bazel build command for specified targets within the containerized build-env. The output is a collection of JSON files, one for each target, which can be consumed by other analysis and visualization tools.

If no specific targets are provided, the tool will analyze all targets within the workspace (//...).

Usage

usage: bep [-h] [--targets TARGETS [TARGETS ...]] [--command {fetch,build}]
           [--output_dir OUTPUT_DIR]

Generates Bazel Build Event Protocol (BEP) JSON files for a list of targets.

options:
  -h, --help            Show this help message and exit.
  --targets TARGETS [TARGETS ...]
                        A list of Bazel targets to process.
  --command {fetch,build}
                        The Bazel command to run ('fetch' or 'build').
  --output_dir OUTPUT_DIR
                        Output directory for BEP logs.

Example

devkit/bep --target BUILD --command fetch --output_dir bep_report/