File tree Expand file tree Collapse file tree 12 files changed +747
-1
lines changed Expand file tree Collapse file tree 12 files changed +747
-1
lines changed Original file line number Diff line number Diff line change @@ -160,6 +160,13 @@ jobs:
160
160
os : macos-11
161
161
arch : x86_64
162
162
action : test
163
+ - name : ' WasmEdge on Linux/x86_64'
164
+ engine : ' wasmedge'
165
+ repo : ' com_github_wasmedge_wasmedge'
166
+ os : ubuntu-20.04
167
+ arch : x86_64
168
+ action : test
169
+ flags : --config=clang
163
170
- name : ' Wasmtime on Linux/x86_64'
164
171
engine : ' wasmtime'
165
172
repo : ' com_github_bytecodealliance_wasmtime'
Original file line number Diff line number Diff line change 4
4
"proxy_wasm_select_engine_null" ,
5
5
"proxy_wasm_select_engine_v8" ,
6
6
"proxy_wasm_select_engine_wamr" ,
7
+ "proxy_wasm_select_engine_wasmedge" ,
7
8
"proxy_wasm_select_engine_wasmtime" ,
8
9
"proxy_wasm_select_engine_wavm" ,
9
10
)
@@ -178,6 +179,28 @@ cc_library(
178
179
}),
179
180
)
180
181
182
+ cc_library (
183
+ name = "wasmedge_lib" ,
184
+ srcs = [
185
+ "src/common/types.h" ,
186
+ "src/wasmedge/types.h" ,
187
+ "src/wasmedge/wasmedge.cc" ,
188
+ ],
189
+ hdrs = ["include/proxy-wasm/wasmedge.h" ],
190
+ defines = [
191
+ "PROXY_WASM_HAS_RUNTIME_WASMEDGE" ,
192
+ "PROXY_WASM_HOST_ENGINE_WASMEDGE" ,
193
+ ],
194
+ linkopts = [
195
+ "-lrt" ,
196
+ "-ldl" ,
197
+ ],
198
+ deps = [
199
+ ":wasm_vm_headers" ,
200
+ "//external:wasmedge" ,
201
+ ],
202
+ )
203
+
181
204
cc_library (
182
205
name = "wavm_lib" ,
183
206
srcs = [
@@ -209,6 +232,8 @@ cc_library(
209
232
[":v8_lib" ],
210
233
) + proxy_wasm_select_engine_wamr (
211
234
[":wamr_lib" ],
235
+ ) + proxy_wasm_select_engine_wasmedge (
236
+ [":wasmedge_lib" ],
212
237
) + proxy_wasm_select_engine_wasmtime (
213
238
[":wasmtime_lib" ],
214
239
) + proxy_wasm_select_engine_wavm (
Original file line number Diff line number Diff line change @@ -15,6 +15,11 @@ config_setting(
15
15
values = {"define" : "engine=wamr" },
16
16
)
17
17
18
+ config_setting (
19
+ name = "engine_wasmedge" ,
20
+ values = {"define" : "engine=wasmedge" },
21
+ )
22
+
18
23
config_setting (
19
24
name = "engine_wasmtime" ,
20
25
values = {"define" : "engine=wasmtime" },
Original file line number Diff line number Diff line change
1
+ load("@rules_foreign_cc//foreign_cc:defs.bzl", "cmake")
2
+
3
+ licenses(["notice"]) # Apache 2
4
+
5
+ package(default_visibility = ["//visibility:public"])
6
+
7
+ filegroup(
8
+ name = "srcs",
9
+ srcs = glob(["**"]),
10
+ )
11
+
12
+ cmake(
13
+ name = "wasmedge_lib",
14
+ cache_entries = {
15
+ "WASMEDGE_BUILD_AOT_RUNTIME": "Off",
16
+ "WASMEDGE_BUILD_SHARED_LIB": "Off",
17
+ "WASMEDGE_BUILD_STATIC_LIB": "On",
18
+ "WASMEDGE_BUILD_TOOLS": "Off",
19
+ "WASMEDGE_FORCE_DISABLE_LTO": "On",
20
+ },
21
+ generate_args = ["-GNinja"],
22
+ lib_source = ":srcs",
23
+ out_static_libs = ["libwasmedge_c.a"],
24
+ )
Original file line number Diff line number Diff line change @@ -229,3 +229,17 @@ def proxy_wasm_cpp_host_repositories():
229
229
patches = ["@proxy_wasm_cpp_host//bazel/external:llvm.patch" ],
230
230
patch_args = ["-p1" ],
231
231
)
232
+
233
+ maybe (
234
+ http_archive ,
235
+ name = "com_github_wasmedge_wasmedge" ,
236
+ build_file = "@proxy_wasm_cpp_host//bazel/external:wasmedge.BUILD" ,
237
+ sha256 = "6724955a967a1457bcf5dc1787a8da95feaba45d3b498ae42768ebf48f587299" ,
238
+ strip_prefix = "WasmEdge-proxy-wasm-0.9.1" ,
239
+ url = "https://github.com/WasmEdge/WasmEdge/archive/refs/tags/proxy-wasm/0.9.1.tar.gz" ,
240
+ )
241
+
242
+ native .bind (
243
+ name = "wasmedge" ,
244
+ actual = "@com_github_wasmedge_wasmedge//:wasmedge_lib" ,
245
+ )
Original file line number Diff line number Diff line change @@ -33,6 +33,12 @@ def proxy_wasm_select_engine_wamr(xs):
33
33
"//conditions:default" : [],
34
34
})
35
35
36
+ def proxy_wasm_select_engine_wasmedge (xs ):
37
+ return select ({
38
+ "@proxy_wasm_cpp_host//bazel:engine_wasmedge" : xs ,
39
+ "//conditions:default" : [],
40
+ })
41
+
36
42
def proxy_wasm_select_engine_wasmtime (xs ):
37
43
return select ({
38
44
"@proxy_wasm_cpp_host//bazel:engine_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/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 WasmEdgeExecutorPtr = common::CSmartPtr<WasmEdge_ExecutorContext, WasmEdge_ExecutorDelete>;
26
+ using WasmEdgeASTModulePtr = common::CSmartPtr<WasmEdge_ASTModuleContext, WasmEdge_ASTModuleDelete>;
27
+
28
+ } // namespace WasmEdge
29
+ } // namespace proxy_wasm
You can’t perform that action at this time.
0 commit comments