aurae-runtime / aurae

Distributed systems runtime daemon written in Rust.
https://aurae.io
Apache License 2.0
1.84k stars 91 forks source link

Don't run `buf generate` if api directory is unchanged #346

Closed future-highway closed 1 year ago

future-highway commented 1 year ago

Currently, our makefile will run buf generate even when the files in the api directory are unchanged. This PR prevents buf generate from running when nothing has changed by leveraging a rust build.rs and cargo's rerun hints.

The benefit is that for local development, crates that depend on the output of buf generate will have a better chance of caching their builds.

The drawback is that if someone alters the generated files, buf generate won't run to revert the changes. They would need to run make clean first.

future-highway commented 1 year ago

348