Skip to content

refactor(spider-proto-rust): Move protobuf codegen out of build.rs into a dedicated build binary and task #335

@coderabbitai

Description

@coderabbitai

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions