Skip to content

Commit e4890cb

Browse files
committed
Upgrade protobuf to pick up new zlib. Centralize C++17 copt.
Upgrade utf8_range to latest fix a build issue. Signed-off-by: Martijn Stevenson <[email protected]>
1 parent 79ed828 commit e4890cb

File tree

4 files changed

+19
-11
lines changed

4 files changed

+19
-11
lines changed

.bazelrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Required for emsdk: https://github.com/emscripten-core/emsdk/blob/main/bazel/README.md
2+
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: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ cc_library(
1313
"proxy_wasm_api.h",
1414
"proxy_wasm_externs.h",
1515
],
16-
copts = ["-std=c++17"],
1716
deps = [
1817
":common_lib",
1918
"@com_google_protobuf//:protobuf_lite",
@@ -26,7 +25,6 @@ cc_library(
2625
"proxy_wasm_common.h",
2726
"proxy_wasm_enums.h",
2827
],
29-
copts = ["-std=c++17"],
3028
)
3129

3230
cc_library(
@@ -41,7 +39,6 @@ cc_library(
4139
"proxy_wasm_externs.h",
4240
"proxy_wasm_intrinsics.h",
4341
],
44-
copts = ["-std=c++17"],
4542
visibility = ["//visibility:public"],
4643
)
4744

@@ -65,7 +62,6 @@ proto_library(
6562
cc_library(
6663
name = "proxy_wasm_intrinsics_lite",
6764
hdrs = ["proxy_wasm_intrinsics_lite.h"],
68-
copts = ["-std=c++17"],
6965
defines = ["PROXY_WASM_PROTOBUF_LITE"],
7066
visibility = ["//visibility:public"],
7167
deps = [
@@ -79,7 +75,6 @@ cc_library(
7975
cc_library(
8076
name = "proxy_wasm_intrinsics_full",
8177
hdrs = ["proxy_wasm_intrinsics_full.h"],
82-
copts = ["-std=c++17"],
8378
defines = ["PROXY_WASM_PROTOBUF_FULL"],
8479
visibility = ["//visibility:public"],
8580
deps = [

bazel/repositories.bzl

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,18 @@ def proxy_wasm_cpp_sdk_repositories():
3030
maybe(
3131
http_archive,
3232
name = "com_google_protobuf",
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",
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",
3647
)

example/BUILD

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,16 @@ 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"],
98
)
109

1110
proxy_wasm_cc_binary(
1211
name = "http_wasm_example_with_protobuf_lite.wasm",
1312
srcs = ["http_wasm_example.cc"],
14-
copts = ["-std=c++17"],
1513
protobuf = "lite",
1614
)
1715

1816
proxy_wasm_cc_binary(
1917
name = "http_wasm_example_with_protobuf_full.wasm",
2018
srcs = ["http_wasm_example.cc"],
21-
copts = ["-std=c++17"],
2219
protobuf = "full",
2320
)

0 commit comments

Comments
 (0)