graphprotocol / graphprotocol/graph-node
Stop generating Protobuf Rust bindings on `build.rs`
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- Rust
- Estrellas
- 3.2k
- Forks
- 1.1k
- Merge medio
- 4 d 1 h
- PR fusionados (30 d)
- 1
Descripción
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.
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Comienza inspeccionando el build.rs existente y la canalización de compilación de Cargo que generan los bindings de Rust de Protobuf. Compara los enfoques propuestos basados en procesos manuales, scripts o tareas dedicadas; después, define cómo se regeneran los bindings cuando cambian las definiciones y verifica que las compilaciones normales de graph-node ya no requieran la toolchain de Protobuf.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- rust
- Área
- build-system, developer-experience
- Tipo de issue
- Nueva funcionalidad
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 35/100