graphprotocol / graphprotocol/graph-node
Stop generating Protobuf Rust bindings on `build.rs`
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Rust
- Sterne
- 3.2k
- Forks
- 1.1k
- Ø Merge
- 4 T. 1 Std.
- Gemergte PRs (30 T.)
- 1
Beschreibung
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 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)
- Create a bash script that invokes the required commands, this is how we work in firehose-XXXX chain like (see https://github.com/streamingfast/firehose-ethereum/blob/develop/types/pb/generate.sh#L22)
- Having a dedicated crate in Rust that invokes tonic build, this is how we do it today in
near-firehose-indexer(see https://github.com/streamingfast/near-firehose-indexer) - Do some of the following but use https://github.com/matklad/cargo-xtask to integrate into a specific cargo task to run
cargo protogensomething like that.
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne mit der Untersuchung der vorhandenen build.rs und der Cargo-Build-Pipeline, die die Protobuf-Rust-Bindings generiert. Vergleiche die vorgeschlagenen manuellen, skriptbasierten oder dedizierten Task-Ansätze und lege anschließend fest, wie die Bindings bei Änderungen an den Definitionen neu generiert werden, und überprüfe, dass normale graph-node-Builds die Protobuf-Toolchain nicht mehr benötigen.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- rust
- Bereich
- build-system, developer-experience
- Issue-Typ
- Feature
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100