File tree Expand file tree Collapse file tree 12 files changed +726
-1
lines changed Expand file tree Collapse file tree 12 files changed +726
-1
lines changed Original file line number Diff line number Diff line change 79
79
- name : ' WAMR on macOS'
80
80
runtime : ' wamr'
81
81
os : macos-11
82
+ - name : ' WasmEdge on Linux'
83
+ runtime : ' wasmedge'
84
+ os : ubuntu-20.04
82
85
- name : ' Wasmtime on Linux'
83
86
runtime : ' wasmtime'
84
87
os : ubuntu-20.04
Original file line number Diff line number Diff line change 3
3
"@proxy_wasm_cpp_host//bazel:select.bzl" ,
4
4
"proxy_wasm_select_runtime_v8" ,
5
5
"proxy_wasm_select_runtime_wamr" ,
6
+ "proxy_wasm_select_runtime_wasmedge" ,
6
7
"proxy_wasm_select_runtime_wasmtime" ,
7
8
"proxy_wasm_select_runtime_wavm" ,
8
9
)
@@ -118,6 +119,25 @@ cc_library(
118
119
],
119
120
)
120
121
122
+ cc_library (
123
+ name = "wasmedge_lib" ,
124
+ srcs = [
125
+ "src/common/types.h" ,
126
+ "src/wasmedge/types.h" ,
127
+ "src/wasmedge/wasmedge.cc" ,
128
+ ],
129
+ hdrs = ["include/proxy-wasm/wasmedge.h" ],
130
+ defines = ["PROXY_WASM_HAS_RUNTIME_WASMEDGE" ],
131
+ linkopts = [
132
+ "-lrt" ,
133
+ "-ldl" ,
134
+ ],
135
+ deps = [
136
+ ":wasm_vm_headers" ,
137
+ "//external:wasmedge" ,
138
+ ],
139
+ )
140
+
121
141
cc_library (
122
142
name = "wasmtime_lib" ,
123
143
srcs = [
@@ -160,6 +180,8 @@ cc_library(
160
180
[":v8_lib" ],
161
181
) + proxy_wasm_select_runtime_wamr (
162
182
[":wamr_lib" ],
183
+ ) + proxy_wasm_select_runtime_wasmedge (
184
+ [":wasmedge_lib" ],
163
185
) + proxy_wasm_select_runtime_wasmtime (
164
186
[":wasmtime_lib" ],
165
187
) + proxy_wasm_select_runtime_wavm (
Original file line number Diff line number Diff line change @@ -10,6 +10,11 @@ config_setting(
10
10
values = {"define" : "runtime=wamr" },
11
11
)
12
12
13
+ config_setting (
14
+ name = "runtime_wasmedge" ,
15
+ values = {"define" : "runtime=wasmedge" },
16
+ )
17
+
13
18
config_setting (
14
19
name = "runtime_wasmtime" ,
15
20
values = {"define" : "runtime=wasmtime" },
Original file line number Diff line number Diff line change
1
+ load("@rules_cc//cc:defs.bzl", "cc_library")
2
+
3
+ licenses(["notice"]) # Apache 2
4
+
5
+ package(default_visibility = ["//visibility:public"])
6
+
7
+ cc_library(
8
+ name = "wasmedge_lib",
9
+ srcs = ["lib64/libwasmedge_c.so"],
10
+ hdrs = ["include/wasmedge.h"],
11
+ strip_include_prefix = "include/",
12
+ )
Original file line number Diff line number Diff line change @@ -184,3 +184,16 @@ def proxy_wasm_cpp_host_repositories():
184
184
],
185
185
sha256 = "c6966ec828da198c5d9adbaa94c05e3a1c7f21bd012a0b29ba8ddbccb2c93b0d" ,
186
186
)
187
+
188
+ http_archive (
189
+ name = "com_github_wasmedge_wasmedge" ,
190
+ build_file = "@proxy_wasm_cpp_host//bazel/external:wasmedge.BUILD" ,
191
+ sha256 = "48c15893f036b86b0f28d96e6269a4ac75d9697a30c44b171e254c83409afb30" ,
192
+ strip_prefix = "WasmEdge-0.8.2-Linux" ,
193
+ url = "https://github.com/WasmEdge/WasmEdge/releases/download/0.8.2/WasmEdge-0.8.2-manylinux2014_x86_64.tar.gz" ,
194
+ )
195
+
196
+ native .bind (
197
+ name = "wasmedge" ,
198
+ actual = "@com_github_wasmedge_wasmedge//:wasmedge_lib" ,
199
+ )
Original file line number Diff line number Diff line change @@ -24,6 +24,12 @@ def proxy_wasm_select_runtime_wamr(xs):
24
24
"//conditions:default" : [],
25
25
})
26
26
27
+ def proxy_wasm_select_runtime_wasmedge (xs ):
28
+ return select ({
29
+ "@proxy_wasm_cpp_host//bazel:runtime_wasmedge" : xs ,
30
+ "//conditions:default" : [],
31
+ })
32
+
27
33
def proxy_wasm_select_runtime_wasmtime (xs ):
28
34
return select ({
29
35
"@proxy_wasm_cpp_host//bazel:runtime_wasmtime" : xs ,
Original file line number Diff line number Diff line change
1
+ // Copyright 2016-2019 Envoy Project Authors
2
+ // Copyright 2020 Google LLC
3
+ //
4
+ // Licensed under the Apache License, Version 2.0 (the "License");
5
+ // you may not use this file except in compliance with the License.
6
+ // You may obtain a copy of the License at
7
+ //
8
+ // http://www.apache.org/licenses/LICENSE-2.0
9
+ //
10
+ // Unless required by applicable law or agreed to in writing, software
11
+ // distributed under the License is distributed on an "AS IS" BASIS,
12
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ // See the License for the specific language governing permissions and
14
+ // limitations under the License.
15
+
16
+ #pragma once
17
+
18
+ #include < memory>
19
+
20
+ #include " include/proxy-wasm/wasm_vm.h"
21
+
22
+ namespace proxy_wasm {
23
+
24
+ std::unique_ptr<WasmVm> createWasmEdgeVm ();
25
+
26
+ } // namespace proxy_wasm
Original file line number Diff line number Diff line change
1
+ // Copyright 2020 Google LLC
2
+ //
3
+ // Licensed under the Apache License, Version 2.0 (the "License");
4
+ // you may not use this file except in compliance with the License.
5
+ // You may obtain a copy of the License at
6
+ //
7
+ // http://www.apache.org/licenses/LICENSE-2.0
8
+ //
9
+ // Unless required by applicable law or agreed to in writing, software
10
+ // distributed under the License is distributed on an "AS IS" BASIS,
11
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ // See the License for the specific language governing permissions and
13
+ // limitations under the License.
14
+
15
+ #include " src/common/types.h"
16
+ #include " wasmedge.h"
17
+
18
+ namespace proxy_wasm {
19
+ namespace WasmEdge {
20
+
21
+ using WasmEdgeStorePtr = common::CSmartPtr<WasmEdge_StoreContext, WasmEdge_StoreDelete>;
22
+ using WasmEdgeVMPtr = common::CSmartPtr<WasmEdge_VMContext, WasmEdge_VMDelete>;
23
+ using WasmEdgeLoaderPtr = common::CSmartPtr<WasmEdge_LoaderContext, WasmEdge_LoaderDelete>;
24
+ using WasmEdgeValidatorPtr = common::CSmartPtr<WasmEdge_ValidatorContext, WasmEdge_ValidatorDelete>;
25
+ using WasmEdgeInterpreterPtr =
26
+ common::CSmartPtr<WasmEdge_InterpreterContext, WasmEdge_InterpreterDelete>;
27
+ using WasmEdgeASTModulePtr = common::CSmartPtr<WasmEdge_ASTModuleContext, WasmEdge_ASTModuleDelete>;
28
+
29
+ } // namespace WasmEdge
30
+ } // namespace proxy_wasm
You can’t perform that action at this time.
0 commit comments