Closed daviddrysdale closed 4 years ago
One further thing: we actually generate three different chunks of Rust code from our .proto
files:
struct
s for messages.tonic-build
.The last of these is needed for clients of Oak Applications that are written in Rust. That certainly includes the trusted_information_retrieval
Rust client, but after #1038 will also include all of the integration tests for example applications.
I think this is now done (with #1108 and friends)
We currently generate two different things from our
.proto
files:struct
s to match protocol buffer message definitions. These are generated by Prost in the standard way.struct
s,trait
s and methods that correspond to gRPC service definitions. These are produced by an Oak-specific generator, and the generated code is intended for use inside an Oak Node; in particular, it relies on the existence of the Oak SDK.For protobufs used in communication with the Runtime, the message definitions are effectively part of the Oak ABI, and so belong in the
oak_abi
crate.However, the generated service code is not part of the ABI; it belongs in the SDK and can't be part of
oak_abi
(because it would induce a dependency cycleoak_abi
->oak
->oak_abi
).So these two types of generated code should be separate. A large fraction of this is covered by #1086, which allows the generation of just the message definitions in a
.proto
file.However, it would be nice to tidy up and complete the process – for example, after #1086 the message definitions for the Roughtime service are in two places:
oak_abi
: message definitions on their ownoak
: message definitions and gRPC service code.Ideally the latter would just have the gRPC service code, and would import the message definitions from the former.