Context
During review of #333, an offline discussion concluded that running protobuf code generation inside Cargo's build.rs is not the ideal approach.
Proposed Solution
- Introduce a dedicated build binary (e.g. a Cargo binary crate) responsible for protobuf code generation, rather than relying on
build.rs.
- Add a dedicated task (in the taskfiles) to invoke this binary and control when codegen runs.
- The generated code is written to a stable destination:
components/spider-proto-rust/src/generated.
- Use the task runner's checksum feature to determine whether codegen needs to be re-executed (i.e. only rerun when proto source files change).
Benefits
- Codegen is fully decoupled from Cargo's build lifecycle.
- Task checksums provide reliable, explicit caching.
- Simpler and more transparent build process.
References
Context
During review of #333, an offline discussion concluded that running protobuf code generation inside Cargo's
build.rsis not the ideal approach.Proposed Solution
build.rs.components/spider-proto-rust/src/generated.Benefits
References