instrumentisto / medea-jason

Mozilla Public License 2.0
2 stars 2 forks source link

Set `tonic_build::Builder::emit_rerun_if_changed(false)` to avoid rebuilding #86

Closed ilslv closed 2 years ago

ilslv commented 2 years ago

Synopsis

Since tonic-build 0.8 it automatically adds cargo:rerun_if_changed. This leads to constant rebuilding of every crate that depends on medea-control-api-proto

Checklist

ilslv commented 2 years ago

FCM

Set `tonic_build::Builder::emit_rerun_if_changed(false)` (#86)

- avoid constant rebuilding of every crate that depends on `medea-control-api-proto`
tyranron commented 2 years ago

@ilslv I don't see the problem with cargo:rerun_if_changed. Actually, it should be quite useful - whenever .proto sources are changed, to automatically regenerate the code. But the question is: why it procs every time rather than whenever .proto files are changed?

tyranron commented 2 years ago

As @ilslv has pointed out in private conversation:
We have our own cargo:rerun_if_changed being set, while tonic-build adds additional cargo:rerun_if_changed with too wide scope, which is the cause of the invalidation.