diff --git a/src/rust/Cargo.lock b/src/rust/Cargo.lock index 33a0627c99c..a22372d76eb 100644 --- a/src/rust/Cargo.lock +++ b/src/rust/Cargo.lock @@ -241,40 +241,13 @@ dependencies = [ "fs_extra", ] -[[package]] -name = "axum" -version = "0.7.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edca88bc138befd0323b20752846e6587272d3b03b0343c8ea28a6f819e6e71f" -dependencies = [ - "async-trait", - "axum-core 0.4.5", - "bytes", - "futures-util", - "http", - "http-body", - "http-body-util", - "itoa", - "matchit 0.7.3", - "memchr", - "mime", - "percent-encoding", - "pin-project-lite", - "rustversion", - "serde", - "sync_wrapper", - "tower 0.5.3", - "tower-layer", - "tower-service", -] - [[package]] name = "axum" version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b52af3cb4058c895d37317bb27508dccc8e5f2d39454016b297bf4a400597b8" dependencies = [ - "axum-core 0.5.6", + "axum-core", "bytes", "form_urlencoded", "futures-util", @@ -284,7 +257,7 @@ dependencies = [ "hyper", "hyper-util", "itoa", - "matchit 0.8.4", + "matchit", "memchr", "mime", "percent-encoding", @@ -295,32 +268,12 @@ dependencies = [ "serde_urlencoded", "sync_wrapper", "tokio", - "tower 0.5.3", + "tower", "tower-layer", "tower-service", "tracing", ] -[[package]] -name = "axum-core" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09f2bd6146b97ae3359fa0cc6d6b376d9539582c7b4220f041a33ec24c226199" -dependencies = [ - "async-trait", - "bytes", - "futures-util", - "http", - "http-body", - "http-body-util", - "mime", - "pin-project-lite", - "rustversion", - "sync_wrapper", - "tower-layer", - "tower-service", -] - [[package]] name = "axum-core" version = "0.5.6" @@ -608,9 +561,9 @@ dependencies = [ [[package]] name = "chrono" -version = "0.4.43" +version = "0.4.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fac4744fb15ae8337dc853fee7fb3f4e48c0fbaa23d0afe49c447b4fab126118" +checksum = "c673075a2e0e5f4a1dde27ce9dee1ea4558c7ffe648f576438a20ca1d2acc4b0" dependencies = [ "iana-time-zone", "js-sys", @@ -740,7 +693,7 @@ version = "0.0.1" dependencies = [ "deepsize", "log", - "prost", + "prost 0.14.3", "prost-types", "serde", "serde_derive", @@ -1117,7 +1070,7 @@ dependencies = [ "address", "async-trait", "async_latch", - "axum 0.8.8", + "axum", "axum-server", "bytes", "cache", @@ -1148,7 +1101,7 @@ dependencies = [ "pantsd", "parking_lot 0.12.5", "pe_nailgun", - "petgraph 0.8.3", + "petgraph", "process_execution", "protos", "pyo3", @@ -1546,7 +1499,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a10bd5b898cac1a4de4a882a754b2ccaafead449348cfb420b48cd5c00ffd08b" dependencies = [ - "prost", + "prost 0.13.5", ] [[package]] @@ -1592,7 +1545,7 @@ dependencies = [ "futures", "log", "parking_lot 0.12.5", - "petgraph 0.8.3", + "petgraph", "rand 0.10.0", "task_executor", "tokio", @@ -1604,7 +1557,7 @@ name = "grpc_util" version = "0.0.1" dependencies = [ "async-trait", - "axum 0.8.8", + "axum", "axum-server", "bytes", "either", @@ -1617,7 +1570,7 @@ dependencies = [ "itertools 0.14.0", "parking_lot 0.12.5", "pin-project", - "prost", + "prost 0.14.3", "prost-build", "prost-types", "rand 0.10.0", @@ -1629,8 +1582,9 @@ dependencies = [ "tokio-rustls", "tokio-stream", "tonic", - "tonic-build", - "tower 0.5.3", + "tonic-prost", + "tonic-prost-build", + "tower", "tower-layer", "tower-service", "workunit_store", @@ -1893,7 +1847,7 @@ dependencies = [ "libc", "percent-encoding", "pin-project-lite", - "socket2 0.5.9", + "socket2 0.6.3", "tokio", "tower-service", "tracing", @@ -2411,12 +2365,6 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3e2e65a1a2e43cfcb47a895c4c8b10d1f4a61097f9f254f183aee60cad9c651d" -[[package]] -name = "matchit" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" - [[package]] name = "matchit" version = "0.8.4" @@ -2501,7 +2449,7 @@ dependencies = [ "futures", "hashing", "parking_lot 0.12.5", - "prost", + "prost 0.14.3", "prost-types", "protos", "testutil", @@ -2679,7 +2627,7 @@ dependencies = [ "log", "md-5", "percent-encoding", - "prost", + "prost 0.13.5", "quick-xml", "reqsign", "reqwest", @@ -2915,16 +2863,6 @@ version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" -[[package]] -name = "petgraph" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3672b37090dbd86368a4145bc067582552b29c27377cad4e0a306c97f9bd7772" -dependencies = [ - "fixedbitset", - "indexmap 2.13.0", -] - [[package]] name = "petgraph" version = "0.8.3" @@ -3086,7 +3024,7 @@ dependencies = [ "mock", "nails", "parking_lot 0.12.5", - "prost", + "prost 0.14.3", "prost-types", "protos", "regex", @@ -3122,7 +3060,7 @@ dependencies = [ "hashing", "log", "process_execution", - "prost", + "prost 0.14.3", "protos", "remote", "shlex", @@ -3152,24 +3090,35 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2796faa41db3ec313a31f7624d9286acf277b52de526150b7e69f3debf891ee5" dependencies = [ "bytes", - "prost-derive", + "prost-derive 0.13.5", +] + +[[package]] +name = "prost" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2ea70524a2f82d518bce41317d0fae74151505651af45faf1ffbd6fd33f0568" +dependencies = [ + "bytes", + "prost-derive 0.14.3", ] [[package]] name = "prost-build" -version = "0.13.5" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be769465445e8c1474e9c5dac2018218498557af32d9ed057325ec9a41ae81bf" +checksum = "343d3bd7056eda839b03204e68deff7d1b13aba7af2b2fd16890697274262ee7" dependencies = [ "heck", "itertools 0.14.0", "log", "multimap", - "once_cell", - "petgraph 0.7.1", + "petgraph", "prettyplease", - "prost", + "prost 0.14.3", "prost-types", + "pulldown-cmark", + "pulldown-cmark-to-cmark", "regex", "syn 2.0.117", "tempfile", @@ -3188,13 +3137,26 @@ dependencies = [ "syn 2.0.117", ] +[[package]] +name = "prost-derive" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "27c6023962132f4b30eb4c172c91ce92d933da334c59c23cddee82358ddafb0b" +dependencies = [ + "anyhow", + "itertools 0.14.0", + "proc-macro2", + "quote", + "syn 2.0.117", +] + [[package]] name = "prost-types" -version = "0.13.5" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52c2c1bf36ddb1a1c396b3601a3cec27c2462e45f07c386894ec3ccf5332bd16" +checksum = "8991c4cbdb8bc5b11f0b074ffe286c30e523de90fee5ba8132f1399f23cb3dd7" dependencies = [ - "prost", + "prost 0.14.3", ] [[package]] @@ -3202,11 +3164,32 @@ name = "protos" version = "0.0.1" dependencies = [ "hashing", - "prost", + "prost 0.14.3", "prost-build", "prost-types", "tonic", - "tonic-build", + "tonic-prost", + "tonic-prost-build", +] + +[[package]] +name = "pulldown-cmark" +version = "0.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c3a14896dfa883796f1cb410461aef38810ea05f2b2c33c5aded3649095fdad" +dependencies = [ + "bitflags 2.9.0", + "memchr", + "unicase", +] + +[[package]] +name = "pulldown-cmark-to-cmark" +version = "22.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50793def1b900256624a709439404384204a5dc3a6ec580281bfaac35e882e90" +dependencies = [ + "pulldown-cmark", ] [[package]] @@ -3527,7 +3510,7 @@ dependencies = [ "mock", "parking_lot 0.12.5", "process_execution", - "prost", + "prost 0.14.3", "prost-types", "protos", "rand 0.10.0", @@ -3566,7 +3549,7 @@ dependencies = [ "http", "mock", "opendal", - "prost", + "prost 0.14.3", "protos", "remote_provider_traits", "tempfile", @@ -3589,7 +3572,7 @@ dependencies = [ "hashing", "mock", "parking_lot 0.12.5", - "prost", + "prost 0.14.3", "protos", "remote_provider_traits", "tempfile", @@ -3671,7 +3654,7 @@ dependencies = [ "tokio", "tokio-rustls", "tokio-util 0.7.18", - "tower 0.5.3", + "tower", "tower-http", "tower-service", "url", @@ -3716,7 +3699,7 @@ dependencies = [ "internment", "itertools 0.14.0", "log", - "petgraph 0.8.3", + "petgraph", "smallvec", ] @@ -3839,7 +3822,7 @@ dependencies = [ "tokio", "tokio-stream", "tonic", - "tower 0.5.3", + "tower", ] [[package]] @@ -4154,7 +4137,7 @@ dependencies = [ "mock", "num_cpus", "parking_lot 0.12.5", - "prost", + "prost 0.14.3", "protos", "remote_provider", "serde", @@ -4325,7 +4308,7 @@ dependencies = [ "fs", "grpc_util", "hashing", - "prost", + "prost 0.14.3", "protos", "tempfile", "tokio", @@ -4579,13 +4562,12 @@ checksum = "5d99f8c9a7727884afe522e9bd5edbfc91a3312b36a77b5fb8926e4c31a41801" [[package]] name = "tonic" -version = "0.12.3" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "877c5b330756d856ffcc4553ab34a5684481ade925ecc54bcd1bf02b1d0d4d52" +checksum = "fec7c61a0695dc1887c1b53952990f3ad2e3a31453e1f49f10e75424943a93ec" dependencies = [ - "async-stream", "async-trait", - "axum 0.7.9", + "axum", "base64 0.22.1", "bytes", "h2", @@ -4597,14 +4579,13 @@ dependencies = [ "hyper-util", "percent-encoding", "pin-project", - "prost", "rustls-native-certs", - "rustls-pemfile", - "socket2 0.5.9", + "socket2 0.6.3", + "sync_wrapper", "tokio", "tokio-rustls", "tokio-stream", - "tower 0.4.13", + "tower", "tower-layer", "tower-service", "tracing", @@ -4612,36 +4593,41 @@ dependencies = [ [[package]] name = "tonic-build" -version = "0.12.3" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9557ce109ea773b399c9b9e5dca39294110b74f1f342cb347a80d1fce8c26a11" +checksum = "1882ac3bf5ef12877d7ed57aad87e75154c11931c2ba7e6cde5e22d63522c734" dependencies = [ "prettyplease", "proc-macro2", - "prost-build", - "prost-types", "quote", "syn 2.0.117", ] [[package]] -name = "tower" -version = "0.4.13" +name = "tonic-prost" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" +checksum = "a55376a0bbaa4975a3f10d009ad763d8f4108f067c7c2e74f3001fb49778d309" dependencies = [ - "futures-core", - "futures-util", - "indexmap 1.9.3", - "pin-project", - "pin-project-lite", - "rand 0.8.5", - "slab", - "tokio", - "tokio-util 0.7.18", - "tower-layer", - "tower-service", - "tracing", + "bytes", + "prost 0.14.3", + "tonic", +] + +[[package]] +name = "tonic-prost-build" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3144df636917574672e93d0f56d7edec49f90305749c668df5101751bb8f95a" +dependencies = [ + "prettyplease", + "proc-macro2", + "prost-build", + "prost-types", + "quote", + "syn 2.0.117", + "tempfile", + "tonic-build", ] [[package]] @@ -4652,7 +4638,9 @@ checksum = "ebe5ef63511595f1344e2d5cfa636d973292adc0eec1f0ad45fae9f0851ab1d4" dependencies = [ "futures-core", "futures-util", + "indexmap 2.13.0", "pin-project-lite", + "slab", "sync_wrapper", "tokio", "tokio-util 0.7.18", @@ -4674,7 +4662,7 @@ dependencies = [ "http-body", "iri-string", "pin-project-lite", - "tower 0.5.3", + "tower", "tower-layer", "tower-service", ] @@ -4817,6 +4805,12 @@ dependencies = [ "libc", ] +[[package]] +name = "unicase" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbc4bc3a9f746d862c45cb89d705aa10f187bb96c76001afab07a0d35ce60142" + [[package]] name = "unicode-ident" version = "1.0.18" @@ -5549,7 +5543,7 @@ dependencies = [ "internment", "log", "parking_lot 0.12.5", - "petgraph 0.8.3", + "petgraph", "rand 0.10.0", "smallvec", "strum", diff --git a/src/rust/Cargo.toml b/src/rust/Cargo.toml index 2341748fa6b..2466cee41e3 100644 --- a/src/rust/Cargo.toml +++ b/src/rust/Cargo.toml @@ -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" @@ -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" @@ -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" diff --git a/src/rust/grpc_util/Cargo.toml b/src/rust/grpc_util/Cargo.toml index f3ada8133fa..0e67703ab69 100644 --- a/src/rust/grpc_util/Cargo.toml +++ b/src/rust/grpc_util/Cargo.toml @@ -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 } @@ -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 diff --git a/src/rust/grpc_util/build.rs b/src/rust/grpc_util/build.rs index 2ed96503911..be84bddf384 100644 --- a/src/rust/grpc_util/build.rs +++ b/src/rust/grpc_util/build.rs @@ -2,14 +2,10 @@ // Licensed under the Apache License, Version 2.0 (see LICENSE). fn main() -> Result<(), Box> { - 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(()) } diff --git a/src/rust/grpc_util/src/channel.rs b/src/rust/grpc_util/src/channel.rs index eb29ef75a6b..02fcc514c13 100644 --- a/src/rust/grpc_util/src/channel.rs +++ b/src/rust/grpc_util/src/channel.rs @@ -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. @@ -21,8 +21,8 @@ use tower_service::Service; /// `Channel`. #[derive(Clone, Debug)] pub enum Client { - Plain(HyperClient), - Tls(HyperClient, BoxBody>), + Plain(HyperClient), + Tls(HyperClient, Body>), } /// A communication channel which may either communicate using HTTP or HTTP over TLS. This @@ -75,7 +75,7 @@ impl Channel { } } -impl Service> for Channel { +impl Service> for Channel { type Response = http::Response; type Error = HyperClientError; type Future = @@ -85,7 +85,7 @@ impl Service> for Channel { Poll::Ready(Ok(())) } - fn call(&mut self, mut req: http::Request) -> Self::Future { + fn call(&mut self, mut req: http::Request) -> 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. @@ -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"; @@ -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(); @@ -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(); @@ -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(); diff --git a/src/rust/process_execution/remote/Cargo.toml b/src/rust/process_execution/remote/Cargo.toml index 7e2052a0756..c15097246f3 100644 --- a/src/rust/process_execution/remote/Cargo.toml +++ b/src/rust/process_execution/remote/Cargo.toml @@ -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 } diff --git a/src/rust/protos/Cargo.toml b/src/rust/protos/Cargo.toml index e82d650c18e..76948075150 100644 --- a/src/rust/protos/Cargo.toml +++ b/src/rust/protos/Cargo.toml @@ -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 } diff --git a/src/rust/protos/build.rs b/src/rust/protos/build.rs index cf0c87ed82c..5d99100ad15 100644 --- a/src/rust/protos/build.rs +++ b/src/rust/protos/build.rs @@ -13,11 +13,11 @@ fn main() -> Result<(), Box> { "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", diff --git a/src/rust/testutil/mock/src/execution_server.rs b/src/rust/testutil/mock/src/execution_server.rs index 97064901119..c5c453f8aae 100644 --- a/src/rust/testutil/mock/src/execution_server.rs +++ b/src/rust/testutil/mock/src/execution_server.rs @@ -196,10 +196,13 @@ impl Drop for TestServer { } } +pub trait DebugMessage: prost::Message + Debug {} +impl DebugMessage for T {} + #[derive(Debug)] pub struct ReceivedMessage { pub message_type: String, - pub message: Box, + pub message: Box, pub received_at: Instant, pub headers: MetadataMap, } @@ -220,7 +223,7 @@ impl MockResponder { } } - fn log(&self, request: &Request) { + fn log(&self, request: &Request) { let headers = request.metadata().clone(); let message = request.get_ref().clone();