Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
254 changes: 124 additions & 130 deletions src/rust/Cargo.lock

Large diffs are not rendered by default.

13 changes: 7 additions & 6 deletions src/rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ bincode = "=1.3.3"
bollard = "0.18.1"
byteorder = "1.5"
bytes = "1.11.1"
chrono = "0.4.43"
chrono = "0.4.44"
clap = "4.6.0"
colored = "3.1.1"
console = "0.16.3"
Expand Down Expand Up @@ -191,9 +191,9 @@ prodash = { git = "https://github.com/stuhood/prodash", rev = "stuhood/raw-messa
"render-line",
"render-line-termion",
] }
prost = "0.13"
prost-build = "0.13"
prost-types = "0.13"
prost = "0.14.3"
prost-build = "0.14.3"
prost-types = "0.14.3"
pyo3 = { version = "0.28.3", features = ["parking_lot"] }
pyo3-build-config = "0.28.3"
rand = "0.10.0"
Expand Down Expand Up @@ -226,8 +226,9 @@ tokio-rustls = "0.26"
tokio-stream = "0.1.18"
tokio-util = "0.7.18"
toml = "0.8"
tonic = "0.12"
tonic-build = "0.12"
tonic = "0.14.5"
tonic-prost = "0.14.5"
tonic-prost-build = "0.14.5"
tower = "0.5.3"
tower-layer = "0.3"
tower-service = "0.3"
Expand Down
5 changes: 3 additions & 2 deletions src/rust/grpc_util/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ rustls-pemfile = { workspace = true }
tokio = { workspace = true, features = ["net", "process", "rt-multi-thread", "sync", "time"] }
tokio-rustls = { workspace = true }
tokio-stream = { workspace = true }
tonic = { workspace = true, features = ["transport", "codegen", "tls", "tls-roots", "prost"] }
tonic = { workspace = true, features = ["transport", "codegen", "tls-ring", "tls-native-roots"] }
tonic-prost = { workspace = true }
tower = { workspace = true, features = ["limit", "timeout"] }
tower-layer = { workspace = true }
tower-service = { workspace = true }
Expand All @@ -40,7 +41,7 @@ prost-types = { workspace = true }

[build-dependencies]
prost-build = { workspace = true }
tonic-build = { workspace = true }
tonic-prost-build = { workspace = true }

[lints]
workspace = true
8 changes: 2 additions & 6 deletions src/rust/grpc_util/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,10 @@
// Licensed under the Apache License, Version 2.0 (see LICENSE).

fn main() -> Result<(), Box<dyn std::error::Error>> {
use prost_build::Config;

let config = Config::new();

tonic_build::configure()
tonic_prost_build::configure()
.build_client(true)
.build_server(true)
.compile_protos_with_config(config, &["protos/test.proto"], &["protos"])?;
.compile_protos(&["protos/test.proto"], &["protos"])?;

Ok(())
}
18 changes: 9 additions & 9 deletions src/rust/grpc_util/src/channel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use hyper_util::client::legacy::{
};
use hyper_util::rt::TokioExecutor;
use rustls::ClientConfig;
use tonic::body::BoxBody;
use tonic::body::Body;
use tower_service::Service;

// Inspired by https://github.com/LucioFranco/tonic-openssl/blob/master/example/src/client2.rs.
Expand All @@ -21,8 +21,8 @@ use tower_service::Service;
/// `Channel`.
#[derive(Clone, Debug)]
pub enum Client {
Plain(HyperClient<HttpConnector, BoxBody>),
Tls(HyperClient<HttpsConnector<HttpConnector>, BoxBody>),
Plain(HyperClient<HttpConnector, Body>),
Tls(HyperClient<HttpsConnector<HttpConnector>, Body>),
}

/// A communication channel which may either communicate using HTTP or HTTP over TLS. This
Expand Down Expand Up @@ -75,7 +75,7 @@ impl Channel {
}
}

impl Service<http::Request<BoxBody>> for Channel {
impl Service<http::Request<Body>> for Channel {
type Response = http::Response<Incoming>;
type Error = HyperClientError;
type Future =
Expand All @@ -85,7 +85,7 @@ impl Service<http::Request<BoxBody>> for Channel {
Poll::Ready(Ok(()))
}

fn call(&mut self, mut req: http::Request<BoxBody>) -> Self::Future {
fn call(&mut self, mut req: http::Request<Body>) -> Self::Future {
// Apparently the schema and authority do not get set by Hyper. Thus, the examples generally
// copy the URI and replace the scheme and authority with the ones from the initial URI used
// to configure the client.
Expand Down Expand Up @@ -129,7 +129,7 @@ mod tests {
use tower::ServiceExt;
use tower_service::Service;

use super::Channel;
use super::{Body, Channel};
use crate::tls::NoVerifier;

const TEST_RESPONSE: &[u8] = b"xyzzy";
Expand Down Expand Up @@ -159,7 +159,7 @@ mod tests {

let request = Request::builder()
.uri(format!("http://{addr}"))
.body(tonic::body::empty_body())
.body(Body::empty())
.unwrap();

channel.ready().await.unwrap();
Expand Down Expand Up @@ -210,7 +210,7 @@ mod tests {

let request = Request::builder()
.uri(format!("https://{addr}"))
.body(tonic::body::empty_body())
.body(Body::empty())
.unwrap();

channel.ready().await.unwrap();
Expand Down Expand Up @@ -361,7 +361,7 @@ mod tests {
);
let request = Request::builder()
.uri(format!("https://{addr}"))
.body(tonic::body::empty_body())
.body(Body::empty())
.unwrap();

channel.ready().await.unwrap();
Expand Down
2 changes: 1 addition & 1 deletion src/rust/process_execution/remote/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ async-oncecell = { workspace = true }
prost = { workspace = true }
prost-types = { workspace = true }
rand = { workspace = true }
tonic = { workspace = true, features = ["transport", "codegen", "tls", "tls-roots", "prost"] }
tonic = { workspace = true, features = ["transport", "codegen", "tls-ring", "tls-native-roots"] }
process_execution = { path = ".." }
strum = { workspace = true }
strum_macros = { workspace = true }
Expand Down
5 changes: 3 additions & 2 deletions src/rust/protos/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ hashing = { path = "../hashing" }
prost = { workspace = true }
prost-build = { workspace = true }
prost-types = { workspace = true }
tonic = { workspace = true, features = ["transport", "codegen", "tls", "tls-roots"] }
tonic = { workspace = true, features = ["transport", "codegen", "tls-ring", "tls-native-roots"] }
tonic-prost = { workspace = true }

[build-dependencies]
prost-build = { workspace = true }
tonic-build = { workspace = true, features = ["prost"] }
tonic-prost-build = { workspace = true }
4 changes: 2 additions & 2 deletions src/rust/protos/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
"google.rpc.QuotaFailure.Violation.subject",
]);

tonic_build::configure()
tonic_prost_build::configure()
.protoc_arg("--experimental_allow_proto3_optional")
.build_client(true)
.build_server(true)
.compile_protos_with_config(
.compile_with_config(
config,
&[
"protos/bazelbuild_remote-apis/build/bazel/remote/execution/v2/remote_execution.proto",
Expand Down
7 changes: 5 additions & 2 deletions src/rust/testutil/mock/src/execution_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,10 +196,13 @@ impl Drop for TestServer {
}
}

pub trait DebugMessage: prost::Message + Debug {}
impl<T: prost::Message + Debug> DebugMessage for T {}

#[derive(Debug)]
pub struct ReceivedMessage {
pub message_type: String,
pub message: Box<dyn prost::Message>,
pub message: Box<dyn DebugMessage>,
pub received_at: Instant,
pub headers: MetadataMap,
}
Expand All @@ -220,7 +223,7 @@ impl MockResponder {
}
}

fn log<T: prost::Message + Clone + Sized + 'static>(&self, request: &Request<T>) {
fn log<T: DebugMessage + Clone + Sized + 'static>(&self, request: &Request<T>) {
let headers = request.metadata().clone();

let message = request.get_ref().clone();
Expand Down
Loading