This guide summarizes the essential workflows and policies for contributing to and maintaining the BCR.
Each module is organized under the modules/ directory:
modules/<name>/metadata.json: Module-level info (maintainers, versions, homepage).modules/<name>/<version>/:MODULE.bazel: The module's dependency definition.source.json: Source archive URL, integrity (SHA-256), and optionalpatchesoroverlay.presubmit.yml: CI configuration (platforms, build/test targets).patches/:.patchfiles to modify upstream source.overlay/: Files to add or overwrite in the upstream source.
- Add-only: The BCR is immutable. Never modify an existing version.
- Registry Fixes: If a fix is registry-only (e.g., fixing compatibility with a new Bazel version), append
.bcr.<N>to the version (e.g.,1.2.3->1.2.3.bcr.1). - Bazel 9 Compatibility: Native rules (like
cc_library) are being removed.- Add
bazel_dep(name = "rules_cc", version = "...")toMODULE.bazel. - Use
load("@rules_cc//cc:defs.bzl", "cc_library", ...)inBUILDfiles via patches.
- Add
- Overlays: When using
overlay/, includebazel_compatibility = [">=7.2.1"]inMODULE.bazel. - Target Names: C++ modules should ideally expose a target with the same name as the module to allow
@module_namesyntax.
//tools:add_module: Interactive scaffolding.//tools:update_integrity: SHA-256 automation.//tools:bcr_validation: Local CI check.//tools:setup_presubmit_repos: Local build reproduction.