protoc
protoc is a dependency that provisions an official Protobuf compiler package and puts its executable directory first in PATH. It is not a function and takes no arguments. Use protobuf_generate for built-in code generators.
Load an exact stable release version in x.y or x.y.z form, without a leading v. Versions before 3.0.0 are unsupported. Package availability also varies by host:
- Linux x86-64 packages start at
3.0.0. - Linux ARM64 packages start at
3.5.0. - Windows x86-64 packages start at
3.7.0. - Windows ARM64 uses the x86-64
win64package through Windows 11 emulation and starts at3.7.0; no native Windows ARM64 package exists yet. - macOS ARM64 packages exist for
3.20.0through3.20.2, disappear for later3.20.xreleases, and return at21.0.
On first use, xx downloads and verifies the official compiler package. Later runs reuse it. Bundled standard .proto includes are available to code generation without a separate installation.
Example
load("@[email protected]", "protoc")
load("@os@1", "os_run")
os_run(("protoc", "--version"), deps=[protoc])