Skip to content

Commit 6efffe9

Browse files
committed
Revert the protobuf update, which had broad fallout.
Instead, silence a zlib warning in the emsdk transition. Signed-off-by: Martijn Stevenson <[email protected]>
1 parent e4890cb commit 6efffe9

File tree

5 files changed

+19
-19
lines changed

5 files changed

+19
-19
lines changed

.bazelrc

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# Required for emsdk: https://github.com/emscripten-core/emsdk/blob/main/bazel/README.md
1+
# Claimed to be required for emsdk:
2+
# https://github.com/emscripten-core/emsdk/blob/main/bazel/README.md
23
build --incompatible_enable_cc_toolchain_resolution
3-
4-
# C++14 or higher is required by Abseil, which is included from protobuf.
5-
build --cxxopt=-std=c++17 --host_cxxopt=-std=c++17

BUILD

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ cc_library(
1313
"proxy_wasm_api.h",
1414
"proxy_wasm_externs.h",
1515
],
16+
copts = ["-std=c++17"],
1617
deps = [
1718
":common_lib",
1819
"@com_google_protobuf//:protobuf_lite",
@@ -25,6 +26,7 @@ cc_library(
2526
"proxy_wasm_common.h",
2627
"proxy_wasm_enums.h",
2728
],
29+
copts = ["-std=c++17"],
2830
)
2931

3032
cc_library(
@@ -39,6 +41,7 @@ cc_library(
3941
"proxy_wasm_externs.h",
4042
"proxy_wasm_intrinsics.h",
4143
],
44+
copts = ["-std=c++17"],
4245
visibility = ["//visibility:public"],
4346
)
4447

@@ -62,6 +65,7 @@ proto_library(
6265
cc_library(
6366
name = "proxy_wasm_intrinsics_lite",
6467
hdrs = ["proxy_wasm_intrinsics_lite.h"],
68+
copts = ["-std=c++17"],
6569
defines = ["PROXY_WASM_PROTOBUF_LITE"],
6670
visibility = ["//visibility:public"],
6771
deps = [
@@ -75,6 +79,7 @@ cc_library(
7579
cc_library(
7680
name = "proxy_wasm_intrinsics_full",
7781
hdrs = ["proxy_wasm_intrinsics_full.h"],
82+
copts = ["-std=c++17"],
7883
defines = ["PROXY_WASM_PROTOBUF_FULL"],
7984
visibility = ["//visibility:public"],
8085
deps = [

bazel/defs.bzl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,13 @@ def _optimized_wasm_cc_binary_transition_impl(settings, attr):
2222
# Define STANDALONE_WASM at compile time as well as link time (below).
2323
# This influences Abseil libraries using conditional dependencies.
2424
# TODO(martijneken): Remove after Abseil stops using this define.
25+
#
26+
# Disable warning -Wdeprecated-non-prototype for zlib:
27+
# https://github.com/madler/zlib/issues/633
28+
# This is fixed in more recent versions of zlib / protobuf.
29+
# TODO(martijneken): Remove after protobuf version update.
2530
return {
26-
"//command_line_option:copt": ["-O3", "-DSTANDALONE_WASM"],
31+
"//command_line_option:copt": ["-O3", "-DSTANDALONE_WASM", "-Wno-deprecated-non-prototype"],
2732
"//command_line_option:cxxopt": [],
2833
"//command_line_option:linkopt": [],
2934
"//command_line_option:collect_code_coverage": False,

bazel/repositories.bzl

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,7 @@ def proxy_wasm_cpp_sdk_repositories():
3030
maybe(
3131
http_archive,
3232
name = "com_google_protobuf",
33-
sha256 = "a700a49470d301f1190a487a923b5095bf60f08f4ae4cac9f5f7c36883d17971",
34-
strip_prefix = "protobuf-23.4",
35-
url = "https://github.com/protocolbuffers/protobuf/releases/download/v23.4/protobuf-23.4.tar.gz",
36-
)
37-
38-
# Update protobuf dependency to fix unused function CodepointSkipBackwards.
39-
# https://github.com/protocolbuffers/utf8_range/commit/d863bc33e15cba6d873c878dcca9e6fe52b2f8cb
40-
# TODO(martijneken): Remove this when protobuf picks up the fix.
41-
maybe(
42-
http_archive,
43-
name = "utf8_range",
44-
sha256 = "568988b5f7261ca181468dba38849fabf59dd9200fb2ed4b2823da187ef84d8c",
45-
strip_prefix = "utf8_range-d863bc33e15cba6d873c878dcca9e6fe52b2f8cb",
46-
url = "https://github.com/protocolbuffers/utf8_range/archive/d863bc33e15cba6d873c878dcca9e6fe52b2f8cb.zip",
33+
sha256 = "77ad26d3f65222fd96ccc18b055632b0bfedf295cb748b712a98ba1ac0b704b2",
34+
strip_prefix = "protobuf-3.17.3",
35+
url = "https://github.com/protocolbuffers/protobuf/releases/download/v3.17.3/protobuf-all-3.17.3.tar.gz",
4736
)

example/BUILD

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,19 @@ licenses(["notice"]) # Apache 2
55
proxy_wasm_cc_binary(
66
name = "http_wasm_example.wasm",
77
srcs = ["http_wasm_example.cc"],
8+
copts = ["-std=c++17"],
89
)
910

1011
proxy_wasm_cc_binary(
1112
name = "http_wasm_example_with_protobuf_lite.wasm",
1213
srcs = ["http_wasm_example.cc"],
14+
copts = ["-std=c++17"],
1315
protobuf = "lite",
1416
)
1517

1618
proxy_wasm_cc_binary(
1719
name = "http_wasm_example_with_protobuf_full.wasm",
1820
srcs = ["http_wasm_example.cc"],
21+
copts = ["-std=c++17"],
1922
protobuf = "full",
2023
)

0 commit comments

Comments
 (0)