forked from pool/grpc-httpjson-transcoding
200 lines
6.5 KiB
Diff
200 lines
6.5 KiB
Diff
![]() |
From f41ed4ccb3b563a2d44d856c6b9582baeddde4ed Mon Sep 17 00:00:00 2001
|
||
|
From: Michal Rostecki <mrostecki@opensuse.org>
|
||
|
Date: Tue, 5 Nov 2019 14:22:18 +0100
|
||
|
Subject: [PATCH] bazel: Update googleapis and do not define custom BUILD file
|
||
|
|
||
|
This change updates googleapis to the version which is currently used by
|
||
|
Envoy and which has its own set of BUILD files exposing proto libraries.
|
||
|
|
||
|
Signed-off-by: Michal Rostecki <mrostecki@opensuse.org>
|
||
|
---
|
||
|
WORKSPACE | 20 +++++++++++
|
||
|
repositories.bzl | 104 +++++++++++++------------------------------------------
|
||
|
2 files changed, 44 insertions(+), 80 deletions(-)
|
||
|
|
||
|
diff --git a/WORKSPACE b/WORKSPACE
|
||
|
index 34f40fe..9c2bb13 100644
|
||
|
--- a/WORKSPACE
|
||
|
+++ b/WORKSPACE
|
||
|
@@ -20,6 +20,7 @@ load(
|
||
|
"absl_repositories",
|
||
|
"protobuf_repositories",
|
||
|
"googletest_repositories",
|
||
|
+ "grpc_repositories",
|
||
|
"googleapis_repositories",
|
||
|
)
|
||
|
|
||
|
@@ -30,3 +31,22 @@ protobuf_repositories()
|
||
|
googletest_repositories()
|
||
|
|
||
|
googleapis_repositories()
|
||
|
+
|
||
|
+grpc_repositories()
|
||
|
+
|
||
|
+load("@com_github_grpc_grpc//bazel:grpc_deps.bzl", "grpc_deps")
|
||
|
+
|
||
|
+grpc_deps()
|
||
|
+
|
||
|
+load("@io_bazel_rules_go//go:deps.bzl", "go_rules_dependencies", "go_register_toolchains")
|
||
|
+go_rules_dependencies()
|
||
|
+go_register_toolchains()
|
||
|
+
|
||
|
+load("@googleapis_git//:repository_rules.bzl", "switched_rules_by_language")
|
||
|
+
|
||
|
+switched_rules_by_language(
|
||
|
+ name = "com_google_googleapis_imports",
|
||
|
+ cc = True,
|
||
|
+ go = True,
|
||
|
+ grpc = True,
|
||
|
+)
|
||
|
diff --git a/repositories.bzl b/repositories.bzl
|
||
|
index b8d3fc7..833385f 100644
|
||
|
--- a/repositories.bzl
|
||
|
+++ b/repositories.bzl
|
||
|
@@ -92,10 +92,12 @@ cc_library(
|
||
|
build_file_content = BUILD,
|
||
|
)
|
||
|
|
||
|
-
|
||
|
BAZEL_SKYLIB_RELEASE = "0.8.0"
|
||
|
BAZEL_SKYLIB_SHA256 = "2ef429f5d7ce7111263289644d233707dba35e39696377ebab8b0bc701f7818e"
|
||
|
|
||
|
+RULES_PROTO_COMMIT = "97d8af4dc474595af3900dd85cb3a29ad28cc313" # August 02, 2019
|
||
|
+RULES_PROTO_SHA256 = "602e7161d9195e50246177e7c55b2f39950a9cf7366f74ed5f22fd45750cd208"
|
||
|
+
|
||
|
PROTOBUF_COMMIT = "3.9.0" # July 10, 2019
|
||
|
PROTOBUF_SHA256 = "2ee9dcec820352671eb83e081295ba43f7a4157181dad549024d7070d079cf65"
|
||
|
|
||
|
@@ -108,6 +110,13 @@ def protobuf_repositories(bind=True):
|
||
|
sha256 = BAZEL_SKYLIB_SHA256,
|
||
|
)
|
||
|
|
||
|
+ http_archive(
|
||
|
+ name = "rules_proto",
|
||
|
+ strip_prefix = "rules_proto-" + RULES_PROTO_COMMIT,
|
||
|
+ urls = ["https://github.com/bazelbuild/rules_proto/archive/" + RULES_PROTO_COMMIT + ".tar.gz"],
|
||
|
+ sha256 = RULES_PROTO_SHA256,
|
||
|
+ )
|
||
|
+
|
||
|
http_archive(
|
||
|
name = "protobuf_git",
|
||
|
strip_prefix = "protobuf-" + PROTOBUF_COMMIT,
|
||
|
@@ -235,100 +244,35 @@ cc_library(
|
||
|
actual = "@googletest_git//:googletest_prod",
|
||
|
)
|
||
|
|
||
|
-GOOGLEAPIS_COMMIT = "32a10f69e2c9ce15bba13ab1ff928bacebb25160" # May 20, 2019
|
||
|
-GOOGLEAPIS_SHA256 = "6861efa8619579e06e70dd4765cdf6cef1ecad6a1a2026ad750541e99552bf71"
|
||
|
+GRPC_VERSION = "1.23.0"
|
||
|
+GRPC_SHA256 = "f56ced18740895b943418fa29575a65cc2396ccfa3159fa40d318ef5f59471f9"
|
||
|
|
||
|
-def googleapis_repositories(protobuf_repo="@protobuf_git//", bind=True):
|
||
|
- BUILD = """
|
||
|
-# Copyright 2016 Google Inc. All Rights Reserved.
|
||
|
-#
|
||
|
-# Licensed under the Apache License, Version 2.0 (the "License");
|
||
|
-# you may not use this file except in compliance with the License.
|
||
|
-# You may obtain a copy of the License at
|
||
|
-#
|
||
|
-# http://www.apache.org/licenses/LICENSE-2.0
|
||
|
-#
|
||
|
-# Unless required by applicable law or agreed to in writing, software
|
||
|
-# distributed under the License is distributed on an "AS IS" BASIS,
|
||
|
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
|
-# See the License for the specific language governing permissions and
|
||
|
-# limitations under the License.
|
||
|
-#
|
||
|
-################################################################################
|
||
|
-#
|
||
|
-
|
||
|
-licenses(["notice"])
|
||
|
-
|
||
|
-load("{0}:protobuf.bzl", "cc_proto_library")
|
||
|
-
|
||
|
-exports_files(glob(["google/**"]))
|
||
|
-
|
||
|
-cc_proto_library(
|
||
|
- name = "http_api_protos",
|
||
|
- srcs = [
|
||
|
- "google/api/annotations.proto",
|
||
|
- "google/api/http.proto",
|
||
|
- ],
|
||
|
- default_runtime = "//external:protobuf",
|
||
|
- protoc = "//external:protoc",
|
||
|
- visibility = ["//visibility:public"],
|
||
|
- deps = ["{0}:cc_wkt_protos"],
|
||
|
-)
|
||
|
+def grpc_repositories():
|
||
|
+ http_archive(
|
||
|
+ name = "com_github_grpc_grpc",
|
||
|
+ strip_prefix = "grpc-" + GRPC_VERSION,
|
||
|
+ url = "https://github.com/grpc/grpc/archive/v" + GRPC_VERSION + ".tar.gz",
|
||
|
+ sha256 = GRPC_SHA256,
|
||
|
+ )
|
||
|
|
||
|
-cc_proto_library(
|
||
|
- name = "service_config",
|
||
|
- srcs = [
|
||
|
- "google/api/auth.proto",
|
||
|
- "google/api/backend.proto",
|
||
|
- "google/api/billing.proto",
|
||
|
- "google/api/consumer.proto",
|
||
|
- "google/api/context.proto",
|
||
|
- "google/api/control.proto",
|
||
|
- "google/api/documentation.proto",
|
||
|
- "google/api/endpoint.proto",
|
||
|
- "google/api/label.proto",
|
||
|
- "google/api/launch_stage.proto",
|
||
|
- "google/api/log.proto",
|
||
|
- "google/api/logging.proto",
|
||
|
- "google/api/metric.proto",
|
||
|
- "google/api/experimental/experimental.proto",
|
||
|
- "google/api/experimental/authorization_config.proto",
|
||
|
- "google/api/monitored_resource.proto",
|
||
|
- "google/api/monitoring.proto",
|
||
|
- "google/api/resource.proto",
|
||
|
- "google/api/quota.proto",
|
||
|
- "google/api/service.proto",
|
||
|
- "google/api/source_info.proto",
|
||
|
- "google/api/system_parameter.proto",
|
||
|
- "google/api/usage.proto",
|
||
|
- ],
|
||
|
- include = ".",
|
||
|
- visibility = ["//visibility:public"],
|
||
|
- deps = [
|
||
|
- ":http_api_protos",
|
||
|
- "//external:cc_wkt_protos",
|
||
|
- ],
|
||
|
- protoc = "//external:protoc",
|
||
|
- default_runtime = "//external:protobuf",
|
||
|
-)
|
||
|
-""".format(protobuf_repo)
|
||
|
+GOOGLEAPIS_COMMIT = "be480e391cc88a75cf2a81960ef79c80d5012068" # Jul 24, 2019
|
||
|
+GOOGLEAPIS_SHA256 = "c1969e5b72eab6d9b6cfcff748e45ba57294aeea1d96fd04cd081995de0605c2"
|
||
|
|
||
|
+def googleapis_repositories(protobuf_repo="@protobuf_git//", bind=True):
|
||
|
http_archive(
|
||
|
name = "googleapis_git",
|
||
|
- patch_cmds = ["find . -type f -name '*BUILD*' | xargs rm"],
|
||
|
strip_prefix = "googleapis-" + GOOGLEAPIS_COMMIT,
|
||
|
url = "https://github.com/googleapis/googleapis/archive/" + GOOGLEAPIS_COMMIT + ".tar.gz",
|
||
|
- build_file_content = BUILD,
|
||
|
sha256 = GOOGLEAPIS_SHA256,
|
||
|
)
|
||
|
|
||
|
if bind:
|
||
|
native.bind(
|
||
|
name = "service_config",
|
||
|
- actual = "@googleapis_git//:service_config",
|
||
|
+ actual = "@googleapis_git//google/api:service_cc_proto",
|
||
|
)
|
||
|
|
||
|
native.bind(
|
||
|
name = "http_api_protos",
|
||
|
- actual = "@googleapis_git//:http_api_protos",
|
||
|
+ actual = "@googleapis_git//google/api:annotations_cc_proto",
|
||
|
)
|
||
|
--
|
||
|
2.16.4
|
||
|
|