Skip to content

Commit aab1611

Browse files
committed
Patch proxy-wasm-cpp-sdk to work around g++ -std=c++20 compilation issue
Signed-off-by: Michael Warres <[email protected]>
1 parent fdb5e93 commit aab1611

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed
+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Address g++ -std=c++20 variadic template compilation issue:
2+
# https://github.com/proxy-wasm/proxy-wasm-cpp-host/pull/411#issuecomment-2295429152
3+
4+
diff --git a/proxy_wasm_api.h b/proxy_wasm_api.h
5+
index 166b49c..263d2b9 100644
6+
--- a/proxy_wasm_api.h
7+
+++ b/proxy_wasm_api.h
8+
@@ -1207,7 +1207,7 @@ struct SimpleHistogram {
9+
template <typename... Tags> struct Counter : public MetricBase {
10+
static Counter<Tags...> *New(std::string_view name, MetricTagDescriptor<Tags>... fieldnames);
11+
12+
- Counter<Tags...>(std::string_view name, MetricTagDescriptor<Tags>... descriptors)
13+
+ Counter(std::string_view name, MetricTagDescriptor<Tags>... descriptors)
14+
: Counter<Tags...>(std::string(name), std::vector<MetricTag>({toMetricTag(descriptors)...})) {
15+
}
16+
17+
@@ -1256,7 +1256,7 @@ inline Counter<Tags...> *Counter<Tags...>::New(std::string_view name,
18+
template <typename... Tags> struct Gauge : public MetricBase {
19+
static Gauge<Tags...> *New(std::string_view name, MetricTagDescriptor<Tags>... fieldnames);
20+
21+
- Gauge<Tags...>(std::string_view name, MetricTagDescriptor<Tags>... descriptors)
22+
+ Gauge(std::string_view name, MetricTagDescriptor<Tags>... descriptors)
23+
: Gauge<Tags...>(std::string(name), std::vector<MetricTag>({toMetricTag(descriptors)...})) {}
24+
25+
SimpleGauge resolve(Tags... f) {
26+
@@ -1302,6 +1302,6 @@ inline Gauge<Tags...> *Gauge<Tags...>::New(std::string_view name,
27+
template <typename... Tags> struct Histogram : public MetricBase {
28+
static Histogram<Tags...> *New(std::string_view name, MetricTagDescriptor<Tags>... fieldnames);
29+
30+
- Histogram<Tags...>(std::string_view name, MetricTagDescriptor<Tags>... descriptors)
31+
+ Histogram(std::string_view name, MetricTagDescriptor<Tags>... descriptors)
32+
: Histogram<Tags...>(std::string(name),
33+
std::vector<MetricTag>({toMetricTag(descriptors)...})) {}

bazel/repositories.bzl

+2
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,8 @@ def proxy_wasm_cpp_host_repositories():
132132
sha256 = "89792fc1abca331f29f99870476a04146de5e82ff903bdffca90e6729c1f2470",
133133
strip_prefix = "proxy-wasm-cpp-sdk-95bb82ce45c41d9100fd1ec15d2ffc67f7f3ceee",
134134
urls = ["https://github.com/proxy-wasm/proxy-wasm-cpp-sdk/archive/95bb82ce45c41d9100fd1ec15d2ffc67f7f3ceee.tar.gz"],
135+
patches = ["@proxy_wasm_cpp_host//bazel/external:proxy_wasm_cpp_sdk.patch"],
136+
patch_args = ["-p1"],
135137
)
136138

137139
# Test dependencies.

0 commit comments

Comments
 (0)