Write extensions that subscribe to Bazel’s Build Events Service (BES). Set theDocumentation Index
Fetch the complete documentation index at: https://docs.aspect.build/llms.txt
Use this file to discover all available pages before exploring further.
events parameter to True in the ctx.bazel.build function to access build events through an iterator interface. Starlark delivers build events synchronously via this iterator, since it operates in a single-threaded environment. Each event includes a kind field that matches the event types defined in Bazel’s build_event_stream.proto protocol specification.
Build Event Stream ProtocolBuild events follow Bazel’s Build Event Stream (BES) protocol. For detailed specifications, access the following resources:
- Protocol definition: build_event_stream.proto
- API documentation: Buf Schema Registry
- Event ordering examples: Bazel BEP Documentation
payload field, whose type depends on which kind of event is produced.
Access the build_event kinds documentation to learn more about the available event kinds and their corresponding payload types.
For example:

