From fd0be8405db25de0264bdb78fae3a82668c03782 Mon Sep 17 00:00:00 2001 From: Piotr Sikora Date: Thu, 24 Jun 2021 15:35:47 -0700 Subject: [PATCH] Fix protobuf dependency. (#122) While there, update protobuf to v3.17.3. Signed-off-by: Piotr Sikora --- BUILD | 6 +++++- bazel/dep/deps.bzl | 26 +++----------------------- bazel/dep/deps_extra.bzl | 7 ++----- proxy_wasm_api.h | 4 ++++ 4 files changed, 14 insertions(+), 29 deletions(-) diff --git a/BUILD b/BUILD index a2e8e0d..ea654ea 100644 --- a/BUILD +++ b/BUILD @@ -1,3 +1,6 @@ +load("@rules_cc//cc:defs.bzl", "cc_library", "cc_proto_library") +load("@rules_proto//proto:defs.bzl", "proto_library") + licenses(["notice"]) # Apache 2 package(default_visibility = ["//visibility:public"]) @@ -12,6 +15,7 @@ cc_library( ], deps = [ ":common_lib", + "@com_google_protobuf//:protobuf_lite", ], ) @@ -63,7 +67,7 @@ cc_library( deps = [ ":proxy_wasm_intrinsics", ":proxy_wasm_intrinsics_lite_cc_proto", - "@com_google_protobuf//:protobuf", + "@com_google_protobuf//:protobuf_lite", ], ) diff --git a/bazel/dep/deps.bzl b/bazel/dep/deps.bzl index 183af0a..0ec42e4 100644 --- a/bazel/dep/deps.bzl +++ b/bazel/dep/deps.bzl @@ -27,31 +27,11 @@ def wasm_dependencies(): sha256 = "ce7a5c76e8b425aca874cea329fd9ac44b203b777053453b6a37b4496c5ce34f" ) - # required by com_google_protobuf - _http_archive( - name = "bazel_skylib", - sha256 = "97e70364e9249702246c0e9444bccdc4b847bed1eb03c5a3ece4f83dfe6abc44", - urls = [ - "https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.0.2/bazel-skylib-1.0.2.tar.gz", - "https://github.com/bazelbuild/bazel-skylib/releases/download/1.0.2/bazel-skylib-1.0.2.tar.gz", - ], - ) - - _http_archive( - name = "rules_proto", - sha256 = "9fc210a34f0f9e7cc31598d109b5d069ef44911a82f507d5a88716db171615a8", - strip_prefix = "rules_proto-f7a30f6f80006b591fa7c437fe5a951eb10bcbcf", - urls = [ - "https://mirror.bazel.build/github.com/bazelbuild/rules_proto/archive/f7a30f6f80006b591fa7c437fe5a951eb10bcbcf.tar.gz", - "https://github.com/bazelbuild/rules_proto/archive/f7a30f6f80006b591fa7c437fe5a951eb10bcbcf.tar.gz", - ], - ) - _http_archive( name = "com_google_protobuf", - sha256 = "6dd0f6b20094910fbb7f1f7908688df01af2d4f6c5c21331b9f636048674aebf", - strip_prefix = "protobuf-3.14.0", - url = "https://github.com/protocolbuffers/protobuf/releases/download/v3.14.0/protobuf-all-3.14.0.tar.gz", + sha256 = "77ad26d3f65222fd96ccc18b055632b0bfedf295cb748b712a98ba1ac0b704b2", + strip_prefix = "protobuf-3.17.3", + url = "https://github.com/protocolbuffers/protobuf/releases/download/v3.17.3/protobuf-all-3.17.3.tar.gz", ) def _http_archive(name, **kwargs): diff --git a/bazel/dep/deps_extra.bzl b/bazel/dep/deps_extra.bzl index de66bf9..58bdac1 100644 --- a/bazel/dep/deps_extra.bzl +++ b/bazel/dep/deps_extra.bzl @@ -12,11 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace") -load("@rules_proto//proto:repositories.bzl", "rules_proto_dependencies", "rules_proto_toolchains") +load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps") # Wasm deps that rely on a first stage of dependency loading in wasm_dependencies(). def wasm_dependencies_extra(): - bazel_skylib_workspace() - rules_proto_dependencies() - rules_proto_toolchains() + protobuf_deps() diff --git a/proxy_wasm_api.h b/proxy_wasm_api.h index 5e8d88d..166b49c 100644 --- a/proxy_wasm_api.h +++ b/proxy_wasm_api.h @@ -21,6 +21,10 @@ // NOLINT(namespace-envoy) #pragma once +#ifdef PROXY_WASM_PROTOBUF +#include "google/protobuf/message_lite.h" +#endif + #include #include #include