Right now, Protobuf Rust bindings are generated via build.rs in the Cargo build pipeline. However, the Protobuf definitions are updated quite infrequently. The current build process imposes some constraints on people that want to build graph-node as they require the full toolchain to compile Protobuf to Rust so valid protoc, seems that rustfmt was required also. Lot's of issue recently (like #4240) were having problem building due to incorrect protoc version.
What is the expected behavior?
Protobuf Rust bindings generation should be an ad-hoc task that is done manually by the developer when the Protobuf definition changes. This way, only then the toolchain is required and everyone else don't need to care about this.
Some ideas (could be "mixed" together):
Using https://buf.build (could even think about using remote worker)
Do some of the following but use https://github.com/matklad/cargo-xtask to integrate into a specific cargo task to run cargo protogen something like that.
Do you want to request a feature or report a bug?
Feature
What is the current behavior?
Right now, Protobuf Rust bindings are generated via
build.rs
in the Cargo build pipeline. However, the Protobuf definitions are updated quite infrequently. The current build process imposes some constraints on people that want to buildgraph-node
as they require the full toolchain to compile Protobuf to Rust so validprotoc
, seems thatrustfmt
was required also. Lot's of issue recently (like #4240) were having problem building due to incorrectprotoc
version.What is the expected behavior?
Protobuf Rust bindings generation should be an ad-hoc task that is done manually by the developer when the Protobuf definition changes. This way, only then the toolchain is required and everyone else don't need to care about this.
Some ideas (could be "mixed" together):
near-firehose-indexer
(see https://github.com/streamingfast/near-firehose-indexer)cargo protogen
something like that.