rbs
supports. Each follows the same pattern as Python and the JVM: declare a hermetic
toolchain in WORKSPACE.rbs, then define targets in BUILD.rbs.
C
C builds use Zig as the hermetic compiler (zig cc) — no system clang or gcc
required. Rules produce real dependency wiring: headers propagate to dependents,
shared libraries are linked and made discoverable at runtime.
Toolchain
c_toolchain — the C rules resolve the compiler by that name.
Rules
Shared attributes:
rbs run works without any environment setup.
The C rules cover compiling, linking, and shared-library workflows within your
workspace. There is no dedicated
c_test rule and no external package registry
integration for C — dependencies are targets you define in the workspace.C++
The C++ rules are the direct counterpart of the C rules, backed byzig c++.
Toolchain
cxx_toolchain — the C++ rules resolve the compiler by that
name.
Rules
cxx_binary, cxx_library, and cxx_shared_library take the same attributes as
their C equivalents, with cxxflags in place of cflags:
As with C, there is no dedicated test rule or external package registry for C++ yet.
.NET
rbs downloads the .NET SDK and builds C# applications through dotnet publish,
wrapping the resulting DLL in a runnable launcher.
Toolchain
dotnet — the rules resolve the SDK by that name.
Rules
dotnet_binary
Builds a .NET application from C# sources plus a project file. The build runsdotnet publish (Release configuration), so NuGet PackageReference entries in your
.csproj are restored as part of the build.
dotnet_library
Packages C# sources (and optionally a.csproj) so binaries can depend on them; the
sources are compiled as part of the consuming binary’s publish.
.NET support is early. There is no
dotnet_test rule yet and no standalone NuGet
dependency rule — package dependencies are declared in your .csproj and restored
during the build.Protocol Buffers
Proto support is split into a shared toolchain, a language-neutralproto_library
rule, and per-language code-generation rules.
Toolchain
Declare it once inWORKSPACE.rbs. It downloads protoc (v27.0) for every supported
platform along with the gRPC code-generation plugins for Java, Kotlin, Python, and Go:
proto_library
Declares a set of.proto files. Other proto libraries can be listed as deps, and
their files become available as imports. Load it from @rbs//java/proto.rbs
(the rule itself is language-neutral):
Language bindings
Each language has a generation rule that consumes aproto_library and produces
source code plus the runtime dependencies your targets need — the protobuf runtime is
always included, and the gRPC libraries are added when enable_grpc = True:
All three share the same attributes:
A complete example — proto definitions, generated code, and an application using
them:
go_proto_library from @rbs//go/proto.rbs); they are
covered with the Go rules.