Events
Bazel has a fairly sophisticated protocol for reporting events that occur during the progress of a build. Bzl acts as a bes_backend
and typically runs via the following flags:
--bes_backend=localhost:1080
--bes_timeout=5s
--build_event_publish_all_actions=true
Events are streamed back up into the browser and presented in a timeline view that allows you to see:
- all events by time
- all events of a particular type
- specific time window
To view events in realtime during a build or test invocation, click the [Build] or [Test] buttons:
Dragging a window/level will filter the event within that time window:
You can clear the selection by clicking away, or use the menu:
Click on an event type to filter to only that type:
Event Types
A brief explanation of the types of build events (not an exhaustive list):
- Started: provides a summary of the build metadata including start time, the version of bazel, the command, description of options. This is a good overview.
- Structured Command Line: an exhaustive list of the precise configuration provided by the bazel client. Use this to see the exact set of flags used during the build.
- Options Parsed: another view of the options.
- Build Metadata: user configurable metadata about the build. Can be populated with the
--build_metadata
flag (e.g.--build_metdata=JOB_ID=12345
). - Progress: console logging, typically delivered via stderr.
- Workspace Configuration: provides the execution root.
- Configuration: the configuration for the build including such things as
cpu
andplatform
. - Configured: the rule and label after the configuration has been resolved.
- Workspace Status: key value pairs populated via the
--workspace_status_command
. - Named Set of Files: a set of files. In order to be efficient, bazel groups files into sets to avoid duplication where possible.
- Action: the individual units of work involved in a build. Each one represents a process that was executed either on the local workstation or a remote machine. Each action has a
mnemonic
, an action key hash, a command line to execute, and a list of environment variables. The mnemonic is sort of like a type name that works with flags such as--spawn_strategy
and others. - Test Result: an event that reports test success or failure, whether it was cached, and links to the log file.
- Build Metrics: a summary of actions executed, memory usage, etc.
- Build Tool Logs: a summary of the time spent including the critical path.
- Completed: reports files outputted by a target in their respective output groups.
- Aborted: if the build was aborted.
- Finished: overall success or failure.
These represent the inner Bazel Build Events. Each one is wrapped in an outer Ordered Build Event envelope that represents a more generic event container that imposes a sequencing mechanism.