nativelink icon indicating copy to clipboard operation
nativelink copied to clipboard

Stop vendoring protos

Open aaronmondal opened this issue 2 years ago • 3 comments
trafficstars

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

aaronmondal avatar Jul 02 '23 20:07 aaronmondal

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.

allada avatar Jul 02 '23 21:07 allada

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.

aaronmondal avatar Jul 04 '23 22:07 aaronmondal

For a data point, I peeked into the generated files today when making gzip optional (https://github.com/allada/turbo-cache/commit/f4fcff29ea6274356d501b3791940ce5c1346ec7).

allada avatar Jul 04 '23 22:07 allada