Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update prost to version 0.13 #651

Merged
merged 3 commits into from
Aug 13, 2024
Merged
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
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ futures-executor = "0.3"
futures-util = { version = "0.3", default-features = false, features = ["std", "sink"] }
protobuf = { version = "2.0", optional = true }
protobufv3 = { package = "protobuf", version = "3.2", optional = true }
prost = { version = "0.12", optional = true }
prost = { version = "0.13", optional = true }
bytes = { version = "1.0", optional = true }
log = "0.4"
parking_lot = "0.12"
Expand Down
6 changes: 3 additions & 3 deletions compiler/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ prost-codec = ["prost-build", "prost-types", "prost", "derive-new", "tempfile"]

[dependencies]
protobuf = { version = "2", optional = true }
prost = { version = "0.12", optional = true }
prost-build = { version = "0.12", optional = true }
prost-types = { version = "0.12", optional = true }
prost = { version = "0.13", optional = true }
prost-build = { version = "0.13", optional = true }
prost-types = { version = "0.13", optional = true }
derive-new = { version = "0.6", optional = true }
tempfile = { version = "3.0", optional = true }

Expand Down
4 changes: 2 additions & 2 deletions compiler/src/codegen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@ impl<'a> ServiceGen<'a> {

fn write_client(&self, w: &mut CodeWriter) {
w.write_line("#[derive(Clone)]");
w.pub_struct(&self.client_name(), |w| {
w.pub_struct(self.client_name(), |w| {
// This can also be exposed by a method. But it may introduce a name conflict
// between service definition and method name. Marking it public may put extra
// restrict on compatability, but it should not be an issue.
Expand All @@ -583,7 +583,7 @@ impl<'a> ServiceGen<'a> {

w.write_line("");

w.impl_self_block(&self.client_name(), |w| {
w.impl_self_block(self.client_name(), |w| {
w.pub_fn("new(channel: ::grpcio::Channel) -> Self", |w| {
w.expr_block(&self.client_name(), |w| {
w.field_entry("client", "::grpcio::Client::new(channel)");
Expand Down
10 changes: 0 additions & 10 deletions grpc-sys/bindings/bindings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -704,16 +704,6 @@ pub struct grpc_server {
pub struct grpc_call {
_unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct grpc_socket_mutator {
_unused: [u8; 0],
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct grpc_socket_factory {
_unused: [u8; 0],
}
#[repr(u32)]
#[doc = " Type specifier for grpc_arg"]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
Expand Down
1 change: 1 addition & 0 deletions grpc-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,7 @@ fn bindgen_grpc(file_path: &Path) {
.blocklist_type(r"gpr_mu")
.blocklist_type(r"gpr_cv")
.blocklist_type(r"gpr_once")
.blocklist_type(r"grpc_socket_.*")
.constified_enum_module(r"grpc_status_code")
.layout_tests(gen_tests)
.default_enum_style(bindgen::EnumVariation::Rust {
Expand Down
2 changes: 1 addition & 1 deletion health/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ prost-codec = ["grpcio/prost-codec", "prost"]
futures-executor = "0.3"
futures-util = { version = "0.3", default-features = false, features = ["std"] }
grpcio = { path = "..", version = "0.13.0", default-features = false }
prost = { version = "0.12", optional = true }
prost = { version = "0.13", optional = true }
protobuf = { version = "2", optional = true }
protobufv3 = { package = "protobuf", version = "3.2", optional = true }
log = "0.4"
1 change: 1 addition & 0 deletions health/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
//! assert_eq!(statuss_resp.status, ServingStatus::Serving);
//! ```

#[allow(renamed_and_removed_lints)]
pub mod proto;
mod service;

Expand Down
2 changes: 1 addition & 1 deletion health/src/proto/prost/grpc.health.v1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ pub struct HealthCheckRequest {
pub service: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct HealthCheckResponse {
#[prost(enumeration = "health_check_response::ServingStatus", tag = "1")]
pub status: i32,
Expand Down
4 changes: 2 additions & 2 deletions health/src/proto/protobuf_v3/health.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// This file is generated by rust-protobuf 3.4.0. Do not edit
// This file is generated by rust-protobuf 3.5.0. Do not edit
// @generated

// https://github.com/rust-lang/rust-clippy/issues/702
Expand All @@ -22,7 +22,7 @@

/// Generated files are compatible only with the same version
/// of protobuf runtime.
const _PROTOBUF_VERSION_CHECK: () = ::protobufv3::VERSION_3_4_0;
const _PROTOBUF_VERSION_CHECK: () = ::protobufv3::VERSION_3_5_0;

// @@protoc_insertion_point(message:grpc.health.v1.HealthCheckRequest)
#[derive(PartialEq,Clone,Default,Debug)]
Expand Down
2 changes: 0 additions & 2 deletions interop/tests/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,9 @@ macro_rules! mk_test {
mk_test!(empty_unary);
mk_test!(large_unary);
// FIXME(#305) Intermittent test.
#[cfg(not(feature = "openssl"))]
mk_test!(client_streaming);
mk_test!(server_streaming);
// FIXME(#306) Intermittent test.
#[cfg(not(feature = "openssl"))]
mk_test!(ping_pong);
mk_test!(custom_metadata);
mk_test!(empty_stream);
Expand Down
8 changes: 4 additions & 4 deletions proto/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ prost-codec = ["prost-build", "prost-derive", "prost-types", "bytes", "lazy_stat
[dependencies]
grpcio = { path = "..", features = ["boringssl"], version = "0.13.0", default-features = false }
bytes = { version = "1.0", optional = true }
prost = { version = "0.12", optional = true }
prost-derive = { version = "0.12", optional = true }
prost-types = { version = "0.12", optional = true }
prost = { version = "0.13", optional = true }
prost-derive = { version = "0.13", optional = true }
prost-types = { version = "0.13", optional = true }
protobuf = { version = "2", optional = true }
protobufv3 = { package = "protobuf", version = "3.2", optional = true }
lazy_static = { version = "1.3", optional = true }

[build-dependencies]
prost-build = { version = "0.12", optional = true }
prost-build = { version = "0.13", optional = true }
walkdir = "2.2"
1 change: 1 addition & 0 deletions proto/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Copyright 2019 TiKV Project Authors. Licensed under Apache-2.0.

#[allow(renamed_and_removed_lints)]
mod proto;

#[cfg(any(feature = "protobuf-codec", feature = "protobufv3-codec"))]
Expand Down
6 changes: 3 additions & 3 deletions proto/src/proto/prost/example/routeguide.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
/// Latitudes should be in the range +/- 90 degrees and longitude should be in
/// the range +/- 180 degrees (inclusive).
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct Point {
#[prost(int32, tag = "1")]
pub latitude: i32,
Expand All @@ -14,7 +14,7 @@ pub struct Point {
/// A latitude-longitude rectangle, represented as two diagonally opposite
/// points "lo" and "hi".
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct Rectangle {
/// One corner of the rectangle.
#[prost(message, optional, tag = "1")]
Expand Down Expand Up @@ -53,7 +53,7 @@ pub struct RouteNote {
/// detected features, and the total distance covered as the cumulative sum of
/// the distance between each point.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct RouteSummary {
/// The number of points received.
#[prost(int32, tag = "1")]
Expand Down
46 changes: 23 additions & 23 deletions proto/src/proto/prost/testing/grpc.testing.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
// This file is @generated by prost-build.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct ByteBufferParams {
#[prost(int32, tag = "1")]
pub req_size: i32,
#[prost(int32, tag = "2")]
pub resp_size: i32,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct SimpleProtoParams {
#[prost(int32, tag = "1")]
pub req_size: i32,
Expand All @@ -18,18 +18,18 @@ pub struct SimpleProtoParams {
/// TODO (vpai): Fill this in once the details of complex, representative
/// protos are decided
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct ComplexProtoParams {}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct PayloadConfig {
#[prost(oneof = "payload_config::Payload", tags = "1, 2, 3")]
pub payload: ::core::option::Option<payload_config::Payload>,
}
/// Nested message and enum types in `PayloadConfig`.
pub mod payload_config {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
#[derive(Clone, Copy, PartialEq, ::prost::Oneof)]
pub enum Payload {
#[prost(message, tag = "1")]
BytebufParams(super::ByteBufferParams),
Expand All @@ -40,7 +40,7 @@ pub mod payload_config {
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct ServerStats {
/// wall clock time change in seconds since last reset
#[prost(double, tag = "1")]
Expand All @@ -64,7 +64,7 @@ pub struct ServerStats {
}
/// Histogram params based on grpc/support/histogram.c
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct HistogramParams {
/// first bucket is [0, 1 + resolution)
#[prost(double, tag = "1")]
Expand All @@ -91,7 +91,7 @@ pub struct HistogramData {
pub count: f64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct RequestResultCount {
#[prost(int32, tag = "1")]
pub status_code: i32,
Expand Down Expand Up @@ -121,7 +121,7 @@ pub struct ClientStats {
/// Parameters of poisson process distribution, which is a good representation
/// of activity coming in from independent identical stationary sources.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct PoissonParams {
/// The rate of arrivals (a.k.a. lambda parameter of the exp distribution).
#[prost(double, tag = "1")]
Expand All @@ -130,18 +130,18 @@ pub struct PoissonParams {
/// Once an RPC finishes, immediately start a new one.
/// No configuration parameters needed.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct ClosedLoopParams {}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct LoadParams {
#[prost(oneof = "load_params::Load", tags = "1, 2")]
pub load: ::core::option::Option<load_params::Load>,
}
/// Nested message and enum types in `LoadParams`.
pub mod load_params {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
#[derive(Clone, Copy, PartialEq, ::prost::Oneof)]
pub enum Load {
#[prost(message, tag = "1")]
ClosedLoop(super::ClosedLoopParams),
Expand Down Expand Up @@ -234,7 +234,7 @@ pub struct ClientStatus {
}
/// Request current stats
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct Mark {
/// if true, the stats will be reset after taking their snapshot.
#[prost(bool, tag = "1")]
Expand Down Expand Up @@ -312,7 +312,7 @@ pub mod server_args {
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct ServerStatus {
#[prost(message, optional, tag = "1")]
pub stats: ::core::option::Option<ServerStats>,
Expand All @@ -324,17 +324,17 @@ pub struct ServerStatus {
pub cores: i32,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct CoreRequest {}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct CoreResponse {
/// Number of cores available on the server
#[prost(int32, tag = "1")]
pub cores: i32,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct Void {}
/// A single performance scenario: input to qps_json_driver
#[allow(clippy::derive_partial_eq_without_eq)]
Expand Down Expand Up @@ -375,7 +375,7 @@ pub struct Scenarios {
/// Basic summary that can be computed from ClientStats and ServerStats
/// once the scenario has finished.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct ScenarioResultSummary {
/// Total number of operations per second over all clients.
#[prost(double, tag = "1")]
Expand Down Expand Up @@ -565,13 +565,13 @@ impl RpcType {
/// };
///
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct Empty {}
/// TODO(dgq): Go back to using well-known types once
/// <https://github.com/grpc/grpc/issues/6980> has been fixed.
/// import "google/protobuf/wrappers.proto";
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct BoolValue {
/// The bool value.
#[prost(bool, tag = "1")]
Expand Down Expand Up @@ -664,15 +664,15 @@ pub struct StreamingInputCallRequest {
}
/// Client-streaming response.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct StreamingInputCallResponse {
/// Aggregated size of payloads received from the client.
#[prost(int32, tag = "1")]
pub aggregated_payload_size: i32,
}
/// Configuration for a particular response.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct ResponseParameters {
/// Desired payload sizes in responses from the server.
#[prost(int32, tag = "1")]
Expand Down Expand Up @@ -720,7 +720,7 @@ pub struct StreamingOutputCallResponse {
/// For reconnect interop test only.
/// Client tells server what reconnection parameters it used.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct ReconnectParams {
#[prost(int32, tag = "1")]
pub max_reconnect_backoff_ms: i32,
Expand Down
4 changes: 2 additions & 2 deletions proto/src/proto/protobuf_v3/example/helloworld.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// This file is generated by rust-protobuf 3.4.0. Do not edit
// This file is generated by rust-protobuf 3.5.0. Do not edit
// @generated

// https://github.com/rust-lang/rust-clippy/issues/702
Expand All @@ -22,7 +22,7 @@

/// Generated files are compatible only with the same version
/// of protobuf runtime.
const _PROTOBUF_VERSION_CHECK: () = ::protobufv3::VERSION_3_4_0;
const _PROTOBUF_VERSION_CHECK: () = ::protobufv3::VERSION_3_5_0;

// @@protoc_insertion_point(message:helloworld.HelloRequest)
#[derive(PartialEq,Clone,Default,Debug)]
Expand Down
4 changes: 2 additions & 2 deletions proto/src/proto/protobuf_v3/example/route_guide.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// This file is generated by rust-protobuf 3.4.0. Do not edit
// This file is generated by rust-protobuf 3.5.0. Do not edit
// @generated

// https://github.com/rust-lang/rust-clippy/issues/702
Expand All @@ -22,7 +22,7 @@

/// Generated files are compatible only with the same version
/// of protobuf runtime.
const _PROTOBUF_VERSION_CHECK: () = ::protobufv3::VERSION_3_4_0;
const _PROTOBUF_VERSION_CHECK: () = ::protobufv3::VERSION_3_5_0;

// @@protoc_insertion_point(message:routeguide.Point)
#[derive(PartialEq,Clone,Default,Debug)]
Expand Down
Loading
Loading