-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for WebAssembly Micro Runtime (WAMR). #142
Merged
Merged
Changes from 18 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
b9d4772
Add wamr proxy-wasm header file
ce55a00
Add type convert for WAMR
2c3e791
Implement the proxy-wasm interface wasm_vm
9724c96
Bazel build the runtime from external WAMR repo
ac6b4ad
Format the c/c++ files and build files
564b3c1
Fix symbol link error when testing runtime
3031f9a
compile WAMR from source code
lum1n0us 2ea172c
Implement the proxy-wasm interface wasm_vm
2ad5f18
Bazel build the runtime from external WAMR repo
05502ed
Fix sha256 check and format
fa6fd6f
Update to the latest branch and drop the merge pull
7eadc8d
Update WAMR implementation based on Common utils
e707a1f
Set runtime not cloneable
f8bf470
Revert the BUILD and remove local configuration
aac1394
Avoid unnecessary log level checks
b1cd9bc
dont use smart pointers to transfer vector data
lum1n0us 86ee01b
Update to the latest repo
f569d10
Apply the latest WAMR repo as dependency
55cdd8e
Match the build params
676d245
Merge branch 'master' into master
PiotrSikora File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
licenses(["notice"]) # Apache 2 | ||
|
||
load("@rules_foreign_cc//foreign_cc:defs.bzl", "cmake") | ||
|
||
package(default_visibility = ["//visibility:public"]) | ||
|
||
filegroup( | ||
name = "srcs", | ||
srcs = glob(["**"]), | ||
visibility = ["//visibility:public"], | ||
) | ||
|
||
cmake( | ||
name = "libiwasm", | ||
cache_entries = { | ||
"WAMR_BUILD_AOT": "0", | ||
"WAMR_BUILD_SIMD": "0", | ||
"WAMR_BUILD_MULTI_MODULE": "1", | ||
"WAMR_BUILD_LIBC_WASI": "0", | ||
}, | ||
lib_source = ":srcs", | ||
out_shared_libs = ["libiwasm.so"], | ||
) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't we need LLVM dependency like in Envoy? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// Copyright 2016-2019 Envoy Project Authors | ||
// Copyright 2020 Google LLC | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
#pragma once | ||
|
||
#include <memory> | ||
|
||
#include "include/proxy-wasm/wasm_vm.h" | ||
|
||
namespace proxy_wasm { | ||
|
||
std::unique_ptr<WasmVm> createWamrVm(); | ||
|
||
} // namespace proxy_wasm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// Copyright 2020 Google LLC | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
#include "src/common/types.h" | ||
#include "wasm_c_api.h" | ||
|
||
namespace proxy_wasm { | ||
namespace wamr { | ||
|
||
using WasmEnginePtr = common::CSmartPtr<wasm_engine_t, wasm_engine_delete>; | ||
using WasmFuncPtr = common::CSmartPtr<wasm_func_t, wasm_func_delete>; | ||
using WasmStorePtr = common::CSmartPtr<wasm_store_t, wasm_store_delete>; | ||
using WasmModulePtr = common::CSmartPtr<wasm_module_t, wasm_module_delete>; | ||
using WasmMemoryPtr = common::CSmartPtr<wasm_memory_t, wasm_memory_delete>; | ||
using WasmTablePtr = common::CSmartPtr<wasm_table_t, wasm_table_delete>; | ||
using WasmInstancePtr = common::CSmartPtr<wasm_instance_t, wasm_instance_delete>; | ||
using WasmFunctypePtr = common::CSmartPtr<wasm_functype_t, wasm_functype_delete>; | ||
using WasmTrapPtr = common::CSmartPtr<wasm_trap_t, wasm_trap_delete>; | ||
using WasmExternPtr = common::CSmartPtr<wasm_extern_t, wasm_extern_delete>; | ||
|
||
using WasmByteVec = | ||
common::CSmartType<wasm_byte_vec_t, wasm_byte_vec_new_empty, wasm_byte_vec_delete>; | ||
using WasmImporttypeVec = common::CSmartType<wasm_importtype_vec_t, wasm_importtype_vec_new_empty, | ||
wasm_importtype_vec_delete>; | ||
using WasmExportTypeVec = common::CSmartType<wasm_exporttype_vec_t, wasm_exporttype_vec_new_empty, | ||
wasm_exporttype_vec_delete>; | ||
using WasmExternVec = | ||
common::CSmartType<wasm_extern_vec_t, wasm_extern_vec_new_empty, wasm_extern_vec_delete>; | ||
using WasmValtypeVec = | ||
common::CSmartType<wasm_valtype_vec_t, wasm_valtype_vec_new_empty, wasm_valtype_vec_delete>; | ||
|
||
} // namespace wamr | ||
|
||
} // namespace proxy_wasm |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please match it to options used in Envoy. At the very least, please add:
or does JIT work already?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✋ just curious, I didn't find any WAVM related BUILD file. Does it mean WAVM can not be linked in this repo yet?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct, currently you cannot build WAVM in this repo. We're slowly fixing this (see: #160), which is why it would be helpful if WAMR worked.