nativelink
nativelink copied to clipboard
Stop vendoring protos
Since rules_rust 0.25 introduced prost/tonic rules it's now theoretically possible to remove the entire proto directory and trivially generate the current proto target with this:
rust_tonic_library(
name = "remote_execution",
proto = "@remote-apis//build/bazel/remote/execution/v2:remote_execution_proto",
)
Modulo some toolchain setup/configuration and adjustments to bring turbo-cache in sync with the upstream proto this will give us a net gain of over 6k LoC. Fantastic :heart_eyes:
There seems to be one bug remaining in 0.25 that prevents us from implementing this and we'll probably have to wait for 0.25.1 or 0.26, but we're getting close:
- https://github.com/bazelbuild/rules_rust/pull/2033#issuecomment-1616796884
I'll have to think about this. I find it useful to have the generated proto files at my finger tips sometimes, especially when debugging complicated code.
I'm not saying no, I'm simply questioning the value it will bring at this point.
I very much agree that this is only a good change if it doesn't complicate debugging. I'll send a draft PR when there is a resolution for https://github.com/bazelbuild/rules_rust/pull/2047, but let's drop this if it turns out to be bad dev-UX.
For a data point, I peeked into the generated files today when making gzip optional (https://github.com/allada/turbo-cache/commit/f4fcff29ea6274356d501b3791940ce5c1346ec7).