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

Upgrade gRPC to 1.25 which has gRPC STS feature #145

Merged
merged 3 commits into from
Feb 13, 2020
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
4 changes: 4 additions & 0 deletions bazel/dependency_imports.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ load("@rules_foreign_cc//:workspace_definitions.bzl", "rules_foreign_cc_dependen
load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")
load("@envoy_build_tools//toolchains:rbe_toolchains_config.bzl", "rbe_toolchains_config")
load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies", "go_repository")
load("@build_bazel_rules_apple//apple:repositories.bzl", "apple_rules_dependencies")
load("@upb//bazel:repository_defs.bzl", upb_bazel_version_repository = "bazel_version_repository")

# go version for rules_go
GO_VERSION = "1.13.3"
Expand All @@ -12,6 +14,8 @@ def envoy_dependency_imports(go_version = GO_VERSION):
go_register_toolchains(go_version)
rbe_toolchains_config()
gazelle_dependencies()
apple_rules_dependencies()
upb_bazel_version_repository(name = "upb_bazel_version")

go_repository(
name = "org_golang_google_grpc",
Expand Down
56 changes: 0 additions & 56 deletions bazel/grpc-protoinfo-1.patch

This file was deleted.

32 changes: 0 additions & 32 deletions bazel/grpc-protoinfo-2.patch

This file was deleted.

31 changes: 0 additions & 31 deletions bazel/grpc-protoinfo-3.patch

This file was deleted.

78 changes: 0 additions & 78 deletions bazel/grpc-rename-gettid.patch

This file was deleted.

28 changes: 9 additions & 19 deletions bazel/repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ def envoy_dependencies(skip_targets = []):
_com_github_jbeder_yaml_cpp()
_com_github_libevent_libevent()
_com_github_luajit_luajit()
_com_github_nanopb_nanopb()
_com_github_nghttp2_nghttp2()
_com_github_nodejs_http_parser()
_com_github_tencent_rapidjson()
Expand All @@ -157,6 +156,7 @@ def envoy_dependencies(skip_targets = []):
_com_lightstep_tracer_cpp()
_io_opentracing_cpp()
_net_zlib()
_upb()
_repository_impl("com_googlesource_code_re2")
_com_google_cel_cpp()
_repository_impl("bazel_toolchains")
Expand Down Expand Up @@ -650,19 +650,8 @@ def _org_llvm_releases_compiler_rt():
)

def _com_github_grpc_grpc():
_repository_impl(
"com_github_grpc_grpc",
patches = [
# Workaround for https://github.com/envoyproxy/envoy/issues/7863
"@envoy//bazel:grpc-protoinfo-1.patch",
"@envoy//bazel:grpc-protoinfo-2.patch",
# Pre-integration of https://github.com/grpc/grpc/pull/19860
"@envoy//bazel:grpc-protoinfo-3.patch",
# Pre-integration of https://github.com/grpc/grpc/pull/18950
"@envoy//bazel:grpc-rename-gettid.patch",
],
patch_args = ["-p1"],
)
_repository_impl("com_github_grpc_grpc")
_repository_impl("build_bazel_rules_apple")

# Rebind some stuff to match what the gRPC Bazel is expecting.
native.bind(
Expand Down Expand Up @@ -693,15 +682,16 @@ def _com_github_grpc_grpc():
actual = "@com_github_grpc_grpc//test/core/tsi/alts/fake_handshaker:fake_handshaker_lib",
)

def _com_github_nanopb_nanopb():
def _upb():
_repository_impl(
name = "com_github_nanopb_nanopb",
build_file = "@com_github_grpc_grpc//third_party:nanopb.BUILD",
name = "upb",
patches = ["@envoy//bazel:upb.patch"],
patch_args = ["-p1"],
)

native.bind(
name = "nanopb",
actual = "@com_github_nanopb_nanopb//:nanopb",
name = "upb_lib",
actual = "@upb//:upb",
)

def _com_github_google_jwt_verify():
Expand Down
21 changes: 13 additions & 8 deletions bazel/repository_locations.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ REPOSITORY_LOCATIONS = dict(
"https://mirror.bazel.build/github.com/bazelbuild/bazel-toolchains/archive/1.1.0.tar.gz",
],
),
build_bazel_rules_apple = dict(
urls = ["https://github.com/bazelbuild/rules_apple/archive/b869b0d3868d78a1d4ffd866ccb304fb68aa12c3.tar.gz"],
strip_prefix = "rules_apple-b869b0d3868d78a1d4ffd866ccb304fb68aa12c3",
sha256 = "bdc8e66e70b8a75da23b79f1f8c6207356df07d041d96d2189add7ee0780cf4e",
),
envoy_build_tools = dict(
sha256 = "d0f88bef8bd7f76c3684407977f5673f3d06a6c50d4ddaffb8f0e7df6b0ef69e",
strip_prefix = "envoy-build-tools-a6b28555badcb18d6be924c8fc1bea49971656b8",
Expand Down Expand Up @@ -103,20 +108,15 @@ REPOSITORY_LOCATIONS = dict(
urls = ["https://github.com/gperftools/gperftools/archive/fc00474ddc21fff618fc3f009b46590e241e425e.tar.gz"],
),
com_github_grpc_grpc = dict(
sha256 = "cce1d4585dd017980d4a407d8c5e9f8fc8c1dbb03f249b99e88a387ebb45a035",
strip_prefix = "grpc-1.22.1",
urls = ["https://github.com/grpc/grpc/archive/v1.22.1.tar.gz"],
sha256 = "bbc8f020f4e85ec029b047fab939b8c81f3d67254b5c724e1003a2bc49ddd123",
strip_prefix = "grpc-d8f4928fa779f6005a7fe55a176bdb373b0f910f",
urls = ["https://github.com/grpc/grpc/archive/d8f4928fa779f6005a7fe55a176bdb373b0f910f.tar.gz"],
),
com_github_luajit_luajit = dict(
sha256 = "409f7fe570d3c16558e594421c47bdd130238323c9d6fd6c83dedd2aaeb082a8",
strip_prefix = "LuaJIT-2.1.0-beta3",
urls = ["https://github.com/LuaJIT/LuaJIT/archive/v2.1.0-beta3.tar.gz"],
),
com_github_nanopb_nanopb = dict(
sha256 = "cbc8fba028635d959033c9ba8d8186a713165e94a9de02a030a20b3e64866a04",
strip_prefix = "nanopb-0.3.9.4",
urls = ["https://github.com/nanopb/nanopb/archive/0.3.9.4.tar.gz"],
),
com_github_nghttp2_nghttp2 = dict(
sha256 = "25b623cd04dc6a863ca3b34ed6247844effe1aa5458229590b3f56a6d53cd692",
strip_prefix = "nghttp2-1.39.1",
Expand Down Expand Up @@ -308,4 +308,9 @@ REPOSITORY_LOCATIONS = dict(
strip_prefix = "compiler-rt-9.0.0.src/lib/fuzzer",
urls = ["http://releases.llvm.org/9.0.0/compiler-rt-9.0.0.src.tar.xz"],
),
upb = dict(
sha256 = "61d0417abd60e65ed589c9deee7c124fe76a4106831f6ad39464e1525cef1454",
strip_prefix = "upb-9effcbcb27f0a665f9f345030188c0b291e32482",
urls = ["https://github.com/protocolbuffers/upb/archive/9effcbcb27f0a665f9f345030188c0b291e32482.tar.gz"],
),
)
27 changes: 27 additions & 0 deletions bazel/upb.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# https://github.com/protocolbuffers/upb/pull/226
diff --git a/bazel/upb_proto_library.bzl b/bazel/upb_proto_library.bzl
index f148745be..21ed34b48 100644
--- a/bazel/upb_proto_library.bzl
+++ b/bazel/upb_proto_library.bzl
@@ -8,7 +8,7 @@ load("@bazel_tools//tools/cpp:toolchain_utils.bzl", "find_cpp_toolchain")

# copybara:strip_for_google3_begin
load("@bazel_skylib//lib:versions.bzl", "versions")
-load("@bazel_version//:bazel_version.bzl", "bazel_version")
+load("@upb_bazel_version//:bazel_version.bzl", "bazel_version")
# copybara:strip_end

# Generic support code #########################################################
diff --git a/bazel/workspace_deps.bzl b/bazel/workspace_deps.bzl
index 39bf524a7..aabbc3411 100644
--- a/bazel/workspace_deps.bzl
+++ b/bazel/workspace_deps.bzl
@@ -5,7 +5,7 @@ load("//bazel:repository_defs.bzl", "bazel_version_repository")

def upb_deps():
bazel_version_repository(
- name = "bazel_version",
+ name = "upb_bazel_version",
)

git_repository(
6 changes: 3 additions & 3 deletions source/common/http/async_client_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,9 @@ class AsyncStreamImpl : public AsyncClient::Stream,
}
absl::optional<std::chrono::milliseconds> maxInterval() const override { return absl::nullopt; }

const std::vector<uint32_t> retriable_status_codes_;
const std::vector<Http::HeaderMatcherSharedPtr> retriable_headers_;
const std::vector<Http::HeaderMatcherSharedPtr> retriable_request_headers_;
const std::vector<uint32_t> retriable_status_codes_{};
const std::vector<Http::HeaderMatcherSharedPtr> retriable_headers_{};
const std::vector<Http::HeaderMatcherSharedPtr> retriable_request_headers_{};
};

struct NullShadowPolicy : public Router::ShadowPolicy {
Expand Down