Skip to content

Commit

Permalink
*: update grpc to 1.56.0 (#621)
Browse files Browse the repository at this point in the history
* grpcio-sys: update to 1.56.0

Signed-off-by: Jay Lee <BusyJayLee@gmail.com>
  • Loading branch information
BusyJay committed Jul 19, 2023
1 parent 4b76b86 commit 455bc4b
Show file tree
Hide file tree
Showing 10 changed files with 314 additions and 276 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- run: choco install -y llvm
- run: refreshenv
- run: Import-Module $env:ChocolateyInstall\helpers\chocolateyProfile.psm1
- run: go version ; cargo version ; cmake --version
- run: cargo xtask submodule
- run: cargo build
Expand Down
2 changes: 1 addition & 1 deletion compiler/src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ impl<'a> Iterator for NameSpliter<'a> {
let mut meet_lower = false;
for i in self.pos..self.name.len() {
let c = self.name[i];
if (b'A'..=b'Z').contains(&c) {
if c.is_ascii_uppercase() {
if meet_lower {
// So it should be AaA or aaA
pos = i;
Expand Down
8 changes: 6 additions & 2 deletions grpc-sys/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "grpcio-sys"
version = "0.12.1+1.46.5-patched"
version = "0.12.1+1.56.2-patched"
authors = ["The TiKV Project Developers"]
license = "Apache-2.0"
keywords = ["grpc", "bindings"]
Expand Down Expand Up @@ -45,6 +45,10 @@ exclude = [
"!grpc/test/core/security/*.cc",
"!grpc/test/core/util/cmdline.cc",
"grpc/test/cpp",
"!grpc/test/core/**/*.proto",
# fool cmake to not update submodules.
"!grpc/third_party/envoy-api/README.md",
"!grpc/third_party/googleapis/README.md",
]

[dependencies]
Expand Down Expand Up @@ -73,4 +77,4 @@ pkg-config = "0.3"
walkdir = "2.2.9"
# Because of rust-lang/cargo#5237, bindgen should not be upgraded util a minor or major release.
bindgen = { version = "0.59.0", default-features = false, optional = true, features = ["runtime"] }
boringssl-src = { version = "0.5.0", optional = true }
boringssl-src = { version = "0.6.0", optional = true }
538 changes: 278 additions & 260 deletions grpc-sys/bindings/bindings.rs

Large diffs are not rendered by default.

11 changes: 6 additions & 5 deletions grpc-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,9 @@ fn list_packages(dst: &Path) {
let mut grpc_unsecure_libs: HashSet<_> = grpc_unsecure.libs.iter().cloned().collect();

// grpc_unsecure.pc is not accurate, see also grpc/grpc#24512. Should also include "address_sorting", "upb", "cares", "z".
grpc_unsecure_libs.extend(
["address_sorting", "upb", "cares", "z"]
.iter()
.map(|s| s.to_string()),
);
const EXTRA_LIBS: [&str; 5] = ["address_sorting", "upb", "cares", "r2", "z"];
grpc_unsecure_libs.extend(EXTRA_LIBS.iter().map(ToString::to_string));
grpc_libs.extend(EXTRA_LIBS.iter().map(ToString::to_string));
// There is no "rt" on Windows and MacOS.
grpc_libs.remove("rt");
grpc_unsecure_libs.remove("rt");
Expand Down Expand Up @@ -222,6 +220,8 @@ fn build_grpc(cc: &mut cc::Build, library: &str) {
config.define("gRPC_BUILD_CODEGEN", "false");
// We don't need to build benchmarks.
config.define("gRPC_BENCHMARK_PROVIDER", "none");
// Check https://github.com/protocolbuffers/protobuf/issues/12185
config.define("ABSL_ENABLE_INSTALL", "ON");

// `package` should only be set for secure feature, otherwise cmake will always search for
// ssl library.
Expand Down Expand Up @@ -451,6 +451,7 @@ fn config_binding_path() {
let file_path: PathBuf = match target.as_str() {
"x86_64-unknown-linux-gnu"
| "x86_64-unknown-linux-musl"
| "aarch64-unknown-linux-musl"
| "aarch64-unknown-linux-gnu"
| "x86_64-apple-darwin"
| "aarch64-apple-darwin" => {
Expand Down
2 changes: 1 addition & 1 deletion grpc-sys/grpc
Submodule grpc updated from 996605 to 84edf1
17 changes: 16 additions & 1 deletion grpc-sys/link-deps.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,22 @@ const COMMON_DEPS: &[&str] = &[
"absl_cordz_functions",
"absl_cordz_handle",
"absl_cordz_info",
"absl_crc32c",
"absl_crc_cord_state",
"absl_crc_cpu_detect",
"absl_crc_internal",
"absl_debugging_internal",
"absl_demangle_internal",
"absl_exponential_biased",
"absl_flags",
"absl_flags_commandlineflag",
"absl_flags_commandlineflag_internal",
"absl_flags_config",
"absl_flags_internal",
"absl_flags_marshalling",
"absl_flags_private_handle_accessor",
"absl_flags_program_name",
"absl_flags_reflection",
"absl_graphcycles_internal",
"absl_hash",
"absl_hashtablez_sampler",
Expand All @@ -39,6 +52,7 @@ const COMMON_DEPS: &[&str] = &[
"absl_status",
"absl_statusor",
"absl_str_format_internal",
"absl_strerror",
"absl_strings",
"absl_strings_internal",
"absl_symbolize",
Expand All @@ -49,8 +63,9 @@ const COMMON_DEPS: &[&str] = &[
"address_sorting",
"cares",
"gpr",
"re2",
"upb",
"z",
];
const GRPC_DEPS: &[&str] = &["grpc", "re2"];
const GRPC_DEPS: &[&str] = &["grpc"];
const GRPC_UNSECURE_DEPS: &[&str] = &["grpc_unsecure"];
6 changes: 3 additions & 3 deletions src/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ fn normalize_key(key: &str, binary: bool) -> Result<Cow<'_, str>> {
let mut is_upper_case = false;
for b in key.as_bytes() {
let b = *b;
if (b'A'..=b'Z').contains(&b) {
if b.is_ascii_uppercase() {
is_upper_case = true;
continue;
} else if (b'a'..=b'z').contains(&b)
|| (b'0'..=b'9').contains(&b)
} else if b.is_ascii_lowercase()
|| b.is_ascii_digit()
|| b == b'_'
|| b == b'-'
|| b == b'.'
Expand Down
2 changes: 1 addition & 1 deletion tests-and-examples/tests/cases/misc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ mod unix_domain_socket {
let req = HelloRequest::default();
let resp = client.say_hello(&req).unwrap();

assert_eq!(resp.get_message(), path, "{resp:?}");
assert_eq!(resp.get_message(), "unix:", "{resp:?}");
}

#[test]
Expand Down
2 changes: 1 addition & 1 deletion xtask/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ fn cmd_in(c: impl AsRef<OsStr>, dir: &str) -> Command {

fn submodule() {
exec(cmd("git").args(&["submodule", "update", "--init", "grpc-sys/grpc"]));
for dir in &["cares/cares", "abseil-cpp", "re2"] {
for dir in &["cares/cares", "abseil-cpp", "envoy-api", "googleapis", "opencensus-proto", "re2", "xds"] {
exec(cmd_in("git", "grpc-sys/grpc/third_party").args(&[
"submodule",
"update",
Expand Down

0 comments on commit 455bc4b

Please sign in to comment.