Skip to content

Add Wasmtime runtime. #73

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

Merged
merged 44 commits into from
Nov 10, 2020
Merged
Show file tree
Hide file tree
Changes from 37 commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
eaee9b8
add wasmtime runtime
mathetake Oct 22, 2020
e7c9980
enhance signature message
mathetake Oct 22, 2020
34a1cc5
enhance clone test
mathetake Oct 23, 2020
5965603
add trap test
mathetake Oct 23, 2020
8b4277b
tiny fix
mathetake Oct 23, 2020
f6498a6
add windows flag
mathetake Oct 23, 2020
a5e340b
fix memory leak: partially
mathetake Oct 23, 2020
1d2d26f
use wrapper type
mathetake Oct 23, 2020
cfdecf3
add leak test
mathetake Oct 23, 2020
d720410
remove actual wat
mathetake Oct 24, 2020
ee9e1ce
fix
mathetake Oct 24, 2020
dc8b76f
remove MEMORY_DATA, MEMORY_SIZE macro
mathetake Oct 25, 2020
e309791
add wasmtime build files
mathetake Oct 26, 2020
cb46647
ignore wasmtime by default
mathetake Oct 27, 2020
ef079e0
generalize runtime tests, use raw rust files for testcases instead of…
mathetake Oct 27, 2020
e12c85b
remove wat, wasmtime specifc dependency
mathetake Oct 27, 2020
b953ae1
remove unnecessary patch
mathetake Oct 27, 2020
ec3e51e
add license headers
mathetake Oct 27, 2020
e68d514
remove patch
mathetake Oct 27, 2020
f441b25
rename
mathetake Oct 27, 2020
e49c0c7
review: styles
mathetake Nov 4, 2020
4bae094
revert change in v8
mathetake Nov 4, 2020
1012dd8
wasmtime: strip precompile_ sections
mathetake Nov 4, 2020
f7eecd3
review: move original code initialization
mathetake Nov 4, 2020
c6da16b
do not copy original
mathetake Nov 4, 2020
ef1f149
add initializer to DeleterType
mathetake Nov 4, 2020
30c55ba
review: tidy up files
mathetake Nov 4, 2020
f79f667
add Cargo.toml for wasmtime
mathetake Nov 4, 2020
5883fb1
review: CSmartType
mathetake Nov 4, 2020
11f8a02
add raze prefix for avoiding potential collision in host repository
mathetake Nov 4, 2020
dcc40ae
fix remote crate func name
mathetake Nov 4, 2020
8ad4032
use wastmime archive header files
mathetake Nov 4, 2020
3b116ad
fix url of wasmtime-c-api
mathetake Nov 5, 2020
4a0bbd8
Merge branch 'master' into wasmtime
mathetake Nov 6, 2020
9db64d5
disable jit-dump and cache feature in wasmtime
mathetake Nov 7, 2020
fcfd971
Merge branch 'wasmtime' of github.com:mathetake/proxy-wasm-cpp-host i…
mathetake Nov 7, 2020
eab25dd
update wasmtime to 0.21.0
mathetake Nov 8, 2020
2f819ee
update rules_rust version
mathetake Nov 9, 2020
ffe359e
download wasmtime from cargo instead of git
mathetake Nov 10, 2020
92ad8a3
use wasm-c-api
mathetake Nov 10, 2020
ba07309
add wasm-c-api.BUILD
mathetake Nov 10, 2020
2bdf58f
Merge branch 'master' into wasmtime
mathetake Nov 10, 2020
a584bd1
review: re cargo generate-lockfile
mathetake Nov 10, 2020
ba7df1b
Merge branch 'master' into wasmtime
mathetake Nov 10, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 5 additions & 33 deletions BUILD
Original file line number Diff line number Diff line change
@@ -1,18 +1,9 @@
load("//:bazel/variables.bzl", "COPTS", "LINKOPTS")

licenses(["notice"]) # Apache 2

package(default_visibility = ["//visibility:public"])

COPTS = select({
"@bazel_tools//src/conditions:windows": [
"/std:c++17",
"-DWITHOUT_ZLIB",
],
"//conditions:default": [
"-std=c++17",
"-DWITHOUT_ZLIB",
],
})

cc_library(
name = "include",
hdrs = glob(["include/proxy-wasm/**/*.h"]),
Expand All @@ -21,6 +12,8 @@ cc_library(
],
)

# TODO(mathetkae): once other runtimes(WAVM,V8) can be linked in this repos,
# use -define=wasm=v8|wavm|wasmtime and switch
cc_library(
name = "lib",
srcs = glob(
Expand All @@ -36,27 +29,6 @@ cc_library(
"@boringssl//:crypto",
"@com_google_protobuf//:protobuf_lite",
"@proxy_wasm_cpp_sdk//:api_lib",
],
)

cc_test(
name = "wasm_vm_test",
srcs = ["wasm_vm_test.cc"],
copts = COPTS,
deps = [
":lib",
"@com_google_googletest//:gtest",
"@com_google_googletest//:gtest_main",
],
)

cc_test(
name = "context_test",
srcs = ["context_test.cc"],
copts = COPTS,
deps = [
":include",
"@com_google_googletest//:gtest",
"@com_google_googletest//:gtest_main",
"@wasmtime_c_api//:lib",
],
)
39 changes: 39 additions & 0 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,28 @@ load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace")

bazel_skylib_workspace()

# rust rules
http_archive(
name = "io_bazel_rules_rust",
sha256 = "a9548f4d36082770e891149d68b17b7afe144b0b5321d603a5cb2c16027198ab",
strip_prefix = "rules_rust-9c889b057ddf4feddae7c5ae6913b7282154aa24",
url = "https://github.com/bazelbuild/rules_rust/archive/9c889b057ddf4feddae7c5ae6913b7282154aa24.tar.gz",
)

load("@io_bazel_rules_rust//rust:repositories.bzl", "rust_repositories")

rust_repositories()

load("@io_bazel_rules_rust//:workspace.bzl", "bazel_version", "rust_workspace")

rust_workspace()

bazel_version(name = "bazel_version")

load("//bazel/cargo:crates.bzl", "proxy_wasm_cpp_host_raze__fetch_remote_crates")

proxy_wasm_cpp_host_raze__fetch_remote_crates()

git_repository(
name = "com_google_protobuf",
commit = "655310ca192a6e3a050e0ca0b7084a2968072260",
Expand All @@ -51,3 +73,20 @@ http_archive(
strip_prefix = "googletest-release-1.10.0",
urls = ["https://github.com/google/googletest/archive/release-1.10.0.tar.gz"],
)

http_archive(
name = "wasmtime",
build_file = "@proxy_wasm_cpp_host//bazel/external:wasmtime.BUILD",
sha256 = "7874feb1026bbef06796bd5ab80e73f15b8e83752bde8dc93994f5bc039a4952",
strip_prefix = "wasmtime-0.21.0",
url = "https://github.com/bytecodealliance/wasmtime/archive/v0.21.0.tar.gz",
)

http_archive(
# used for extracting compatible header files
name = "wasmtime_c_api",
build_file = "@proxy_wasm_cpp_host//bazel/external:wasmtime-c-api.BUILD",
sha256 = "c0d4c9209ee25933665c2cfd9d5ff0956c02d4c52f57dfd61fb31fb7baa37f2a",
strip_prefix = "wasmtime-v0.21.0-x86_64-linux-c-api",
url = "https://github.com/bytecodealliance/wasmtime/releases/download/v0.21.0/wasmtime-v0.21.0-x86_64-linux-c-api.tar.xz",
)
76 changes: 76 additions & 0 deletions bazel/cargo/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
"""
@generated
cargo-raze workspace build file.

DO NOT EDIT! Replaced on runs of cargo-raze
"""

package(default_visibility = ["//visibility:public"])

licenses([
"notice", # See individual crates for specific licenses
])

# Aliased targets
alias(
name = "anyhow",
actual = "@proxy_wasm_cpp_host_raze___anyhow__1_0_34//:anyhow",
tags = [
"cargo-raze",
"manual",
],
)

alias(
name = "env_logger",
actual = "@proxy_wasm_cpp_host_raze___env_logger__0_8_1//:env_logger",
tags = [
"cargo-raze",
"manual",
],
)

alias(
name = "indexmap",
actual = "@proxy_wasm_cpp_host_raze___indexmap__1_1_0//:indexmap",
tags = [
"cargo-raze",
"manual",
],
)

alias(
name = "object",
actual = "@proxy_wasm_cpp_host_raze___object__0_21_1//:object",
tags = [
"cargo-raze",
"manual",
],
)

alias(
name = "once_cell",
actual = "@proxy_wasm_cpp_host_raze___once_cell__1_4_1//:once_cell",
tags = [
"cargo-raze",
"manual",
],
)

alias(
name = "wasmtime",
actual = "@proxy_wasm_cpp_host_raze___wasmtime__0_21_0//:wasmtime",
tags = [
"cargo-raze",
"manual",
],
)

alias(
name = "wasmtime_c_api_macros",
actual = "@proxy_wasm_cpp_host_raze___wasmtime_c_api_macros__0_19_0//:wasmtime_c_api_macros",
tags = [
"cargo-raze",
"manual",
],
)
Loading