Skip to content

Commit 44c28d0

Browse files
committed
Merge remote-tracking branch 'upstream/master'
into nullvm-s390x
2 parents 9e644e8 + 4fcf895 commit 44c28d0

File tree

134 files changed

+4372
-1015
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

134 files changed

+4372
-1015
lines changed

.bazelrc

Lines changed: 28 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,37 +8,49 @@ build:clang --action_env=BAZEL_COMPILER=clang
88
build:clang --action_env=CC=clang
99
build:clang --action_env=CXX=clang++
1010

11+
# Common flags for Clang sanitizers.
12+
build:clang-xsan --config=clang
13+
build:clang-xsan --copt -O1
14+
build:clang-xsan --copt -fno-omit-frame-pointer
15+
build:clang-xsan --copt -fno-optimize-sibling-calls
16+
build:clang-xsan --copt -fno-sanitize-recover=all
17+
build:clang-xsan --linkopt -fsanitize-link-c++-runtime
18+
build:clang-xsan --linkopt -fuse-ld=lld
19+
build:clang-xsan --linkopt -rtlib=compiler-rt
20+
build:clang-xsan --linkopt --unwindlib=libgcc
21+
1122
# Use Clang compiler with Address and Undefined Behavior Sanitizers.
12-
build:clang-asan --config=clang
23+
build:clang-asan --config=clang-xsan
1324
build:clang-asan --copt -DADDRESS_SANITIZER=1
1425
build:clang-asan --copt -DUNDEFINED_SANITIZER=1
15-
build:clang-asan --copt -O1
16-
build:clang-asan --copt -fno-omit-frame-pointer
17-
build:clang-asan --copt -fno-optimize-sibling-calls
1826
build:clang-asan --copt -fsanitize=address,undefined
1927
build:clang-asan --copt -fsanitize-address-use-after-scope
2028
build:clang-asan --linkopt -fsanitize=address,undefined
2129
build:clang-asan --linkopt -fsanitize-address-use-after-scope
22-
build:clang-asan --linkopt -fsanitize-link-c++-runtime
23-
build:clang-asan --linkopt -fuse-ld=lld
2430
build:clang-asan --test_env=ASAN_OPTIONS=check_initialization_order=1:detect_stack_use_after_return=1:strict_init_order=1:strict_string_checks=1
25-
build:clang-asan --test_env=UBSAN_OPTIONS=halt_on_error=1:print_stacktrace=1
31+
build:clang-asan --test_env=UBSAN_OPTIONS=print_stacktrace=1
2632
build:clang-asan --test_env=ASAN_SYMBOLIZER_PATH
2733

2834
# Use Clang compiler with Address and Undefined Behavior Sanitizers (strict version).
2935
build:clang-asan-strict --config=clang-asan
30-
build:clang-asan-strict --copt -fsanitize=integer
31-
build:clang-asan-strict --linkopt -fsanitize=integer
36+
build:clang-asan-strict --copt -fsanitize=integer,local-bounds,nullability
37+
build:clang-asan-strict --linkopt -fsanitize=integer,local-bounds,nullability
38+
39+
# Use Honggfuzz with Address and Undefined Behavior Sanitizers (strict version).
40+
build:clang-asan-honggfuzz --config=clang-asan-strict
41+
build:clang-asan-honggfuzz --@rules_fuzzing//fuzzing:cc_engine=@rules_fuzzing//fuzzing/engines:honggfuzz
42+
build:clang-asan-honggfuzz --@rules_fuzzing//fuzzing:cc_engine_instrumentation=honggfuzz
43+
44+
# Use LibFuzzer with Address and Undefined Behavior Sanitizers (strict version).
45+
build:clang-asan-libfuzzer --config=clang-asan-strict
46+
build:clang-asan-libfuzzer --@rules_fuzzing//fuzzing:cc_engine=@rules_fuzzing//fuzzing/engines:libfuzzer
47+
build:clang-asan-libfuzzer --@rules_fuzzing//fuzzing:cc_engine_instrumentation=libfuzzer
3248

3349
# Use Clang compiler with Thread Sanitizer.
34-
build:clang-tsan --config=clang
50+
build:clang-tsan --config=clang-xsan
3551
build:clang-tsan --copt -DTHREAD_SANITIZER=1
36-
build:clang-tsan --copt -O1
37-
build:clang-tsan --copt -fno-omit-frame-pointer
38-
build:clang-tsan --copt -fno-optimize-sibling-calls
3952
build:clang-tsan --copt -fsanitize=thread
4053
build:clang-tsan --linkopt -fsanitize=thread
41-
build:clang-tsan --linkopt -fuse-ld=lld
4254

4355
# Use Clang-Tidy tool.
4456
build:clang-tidy --aspects @bazel_clang_tidy//clang_tidy:clang_tidy.bzl%clang_tidy_aspect
@@ -69,5 +81,6 @@ build:linux --cxxopt=-std=c++17
6981
build:macos --cxxopt=-std=c++17
7082
build:windows --cxxopt="/std:c++17"
7183

72-
# Enable runfiles on Windows (enabled by default on other platforms).
84+
# Enable symlinks and runfiles on Windows (enabled by default on other platforms).
85+
startup --windows_enable_symlinks
7386
build:windows --enable_runfiles

.bazelversion

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
5.0.0
1+
5.2.0

.github/workflows/format.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,14 +84,18 @@ jobs:
8484
- name: Install dependencies
8585
run: cargo install cargo-raze --version 0.14.1
8686

87+
- name: Format (bazel query)
88+
run: |
89+
bazel query 'deps(//bazel/cargo/...)'
90+
8791
- name: Format (cargo raze)
8892
working-directory: bazel/cargo
8993
run: |
9094
cd wasmsign && cargo raze && cd ..
9195
cd wasmtime && cargo raze && cd ..
9296
# Ignore manual changes in "errno" and "rustix" crates until fixed in cargo-raze.
9397
# See: https://github.com/google/cargo-raze/issues/451
94-
git diff --exit-code -- ':!wasmtime/remote/BUILD.errno-0.2.8.bazel' ':!wasmtime/remote/BUILD.rustix-0.33.4.bazel'
98+
git diff --exit-code -- ':!wasmtime/remote/BUILD.errno-0.*.bazel' ':!wasmtime/remote/BUILD.rustix-0.*.bazel'
9599
96100
clang_format:
97101
name: check format with clang-format

.github/workflows/test.yml

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,18 @@ jobs:
5656
--config=clang
5757
-c opt
5858
$(bazel query 'kind(was.*_rust_binary, //test/test_data/...)')
59+
$(bazel query 'kind(_optimized_wasm_cc_binary, //test/test_data/...)')
60+
61+
# Currently, in Github Action, "Bazel build step" creates `wasm_canary_check.wasm` directory as a temporal directory.
62+
# Since the name of this directory has "*.wasm" pattern, the step "Mangle build rules to use existing test data" fails.
63+
# So, here, we clear out the directories in test_data.
64+
- name: Clean up test data
65+
shell: bash
66+
run: |
67+
# Remove temporal directories
68+
for i in $(find bazel-bin/test/test_data/ -mindepth 1 -maxdepth 1 -type d); do \
69+
rm -rf $i; \
70+
done
5971
6072
- name: Upload test data
6173
uses: actions/upload-artifact@v2
@@ -113,6 +125,7 @@ jobs:
113125
os: windows-2019
114126
arch: x86_64
115127
action: test
128+
targets: -//test/fuzz/...
116129
- name: 'V8 on Linux/x86_64'
117130
engine: 'v8'
118131
repo: 'v8'
@@ -143,6 +156,7 @@ jobs:
143156
os: ubuntu-20.04
144157
arch: aarch64
145158
action: test
159+
targets: -//test/fuzz/...
146160
flags: --config=zig-cc-linux-aarch64 --@v8//bazel/config:v8_target_cpu=arm64
147161
deps: qemu-user-static libc6-arm64-cross
148162
cache: true
@@ -166,6 +180,13 @@ jobs:
166180
os: macos-11
167181
arch: x86_64
168182
action: test
183+
- name: 'WasmEdge on Linux/x86_64'
184+
engine: 'wasmedge'
185+
repo: 'com_github_wasmedge_wasmedge'
186+
os: ubuntu-20.04
187+
arch: x86_64
188+
action: test
189+
flags: --config=clang
169190
- name: 'Wasmtime on Linux/x86_64'
170191
engine: 'wasmtime'
171192
repo: 'com_github_bytecodealliance_wasmtime'
@@ -194,8 +215,8 @@ jobs:
194215
os: ubuntu-20.04
195216
arch: s390x
196217
action: test
197-
flags: --config=clang
198-
run_under: docker run --rm --env HOME=$HOME --env USER=$(id -un) --volume "$HOME:$HOME" --workdir $(pwd) --user $(id -u):$(id -g) --platform linux/s390x piotrsikora/build-tools:bazel-5.0.0-clang-13-gcc-11
218+
flags: --config=clang --test_timeout=1800
219+
run_under: docker run --rm --env HOME=$HOME --env USER=$(id -un) --volume "$HOME:$HOME" --workdir $(pwd) --user $(id -u):$(id -g) --platform linux/s390x piotrsikora/build-tools:bazel-5.2.0-clang-14-gcc-12
199220
cache: true
200221
- name: 'Wasmtime on macOS/x86_64'
201222
engine: 'wasmtime'
@@ -209,6 +230,7 @@ jobs:
209230
os: windows-2019
210231
arch: x86_64
211232
action: test
233+
targets: -//test/fuzz/...
212234
- name: 'WAVM on Linux/x86_64'
213235
engine: 'wavm'
214236
repo: 'com_github_wavm_wavm'
@@ -261,14 +283,15 @@ jobs:
261283
done
262284
263285
- name: Bazel build/test
286+
shell: bash
264287
run: >
265288
${{ matrix.run_under }}
266289
bazel ${{ matrix.action }}
267290
--verbose_failures
268291
--test_output=errors
269292
--define engine=${{ matrix.engine }}
270293
${{ matrix.flags }}
271-
//test/...
294+
-- //test/... ${{ matrix.targets }}
272295
273296
- name: Bazel build/test (signed Wasm module)
274297
if: ${{ matrix.engine != 'null' && !startsWith(matrix.os, 'windows') }}

BUILD

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ load(
44
"proxy_wasm_select_engine_null",
55
"proxy_wasm_select_engine_v8",
66
"proxy_wasm_select_engine_wamr",
7+
"proxy_wasm_select_engine_wasmedge",
78
"proxy_wasm_select_engine_wasmtime",
89
"proxy_wasm_select_engine_wavm",
910
)
@@ -22,6 +23,7 @@ filegroup(
2223
cc_library(
2324
name = "wasm_vm_headers",
2425
hdrs = [
26+
"include/proxy-wasm/limits.h",
2527
"include/proxy-wasm/wasm_vm.h",
2628
"include/proxy-wasm/word.h",
2729
],
@@ -50,6 +52,7 @@ cc_library(
5052
"src/bytecode_util.cc",
5153
"src/context.cc",
5254
"src/exports.cc",
55+
"src/pairs_util.cc",
5356
"src/shared_data.cc",
5457
"src/shared_data.h",
5558
"src/shared_queue.cc",
@@ -60,6 +63,7 @@ cc_library(
6063
],
6164
hdrs = [
6265
"include/proxy-wasm/bytecode_util.h",
66+
"include/proxy-wasm/pairs_util.h",
6367
"include/proxy-wasm/signature_util.h",
6468
],
6569
linkopts = select({
@@ -134,6 +138,28 @@ cc_library(
134138
],
135139
)
136140

141+
cc_library(
142+
name = "wasmedge_lib",
143+
srcs = [
144+
"src/common/types.h",
145+
"src/wasmedge/types.h",
146+
"src/wasmedge/wasmedge.cc",
147+
],
148+
hdrs = ["include/proxy-wasm/wasmedge.h"],
149+
defines = [
150+
"PROXY_WASM_HAS_RUNTIME_WASMEDGE",
151+
"PROXY_WASM_HOST_ENGINE_WASMEDGE",
152+
],
153+
linkopts = [
154+
"-lrt",
155+
"-ldl",
156+
],
157+
deps = [
158+
":wasm_vm_headers",
159+
"//external:wasmedge",
160+
],
161+
)
162+
137163
cc_library(
138164
name = "wasmtime_lib",
139165
srcs = [
@@ -270,6 +296,8 @@ cc_library(
270296
[":v8_lib"],
271297
) + proxy_wasm_select_engine_wamr(
272298
[":wamr_lib"],
299+
) + proxy_wasm_select_engine_wasmedge(
300+
[":wasmedge_lib"],
273301
) + proxy_wasm_select_engine_wasmtime(
274302
[":wasmtime_lib"],
275303
[":prefixed_wasmtime_lib"],

WORKSPACE

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,15 @@ proxy_wasm_cpp_host_repositories()
77
load("@proxy_wasm_cpp_host//bazel:dependencies.bzl", "proxy_wasm_cpp_host_dependencies")
88

99
proxy_wasm_cpp_host_dependencies()
10+
11+
load("@proxy_wasm_cpp_sdk//bazel:repositories.bzl", "proxy_wasm_cpp_sdk_repositories")
12+
13+
proxy_wasm_cpp_sdk_repositories()
14+
15+
load("@proxy_wasm_cpp_sdk//bazel:dependencies.bzl", "proxy_wasm_cpp_sdk_dependencies")
16+
17+
proxy_wasm_cpp_sdk_dependencies()
18+
19+
load("@proxy_wasm_cpp_sdk//bazel:dependencies_extra.bzl", "proxy_wasm_cpp_sdk_dependencies_extra")
20+
21+
proxy_wasm_cpp_sdk_dependencies_extra()

bazel/BUILD

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ config_setting(
1515
values = {"define": "engine=wamr"},
1616
)
1717

18+
config_setting(
19+
name = "engine_wasmedge",
20+
values = {"define": "engine=wasmedge"},
21+
)
22+
1823
config_setting(
1924
name = "engine_wasmtime",
2025
values = {"define": "engine=wasmtime"},

bazel/cargo/wasmtime/BUILD.bazel

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ licenses([
1414
# Aliased targets
1515
alias(
1616
name = "anyhow",
17-
actual = "@wasmtime__anyhow__1_0_56//:anyhow",
17+
actual = "@wasmtime__anyhow__1_0_58//:anyhow",
1818
tags = [
1919
"cargo-raze",
2020
"manual",
@@ -23,7 +23,7 @@ alias(
2323

2424
alias(
2525
name = "env_logger",
26-
actual = "@wasmtime__env_logger__0_8_4//:env_logger",
26+
actual = "@wasmtime__env_logger__0_9_0//:env_logger",
2727
tags = [
2828
"cargo-raze",
2929
"manual",
@@ -32,7 +32,7 @@ alias(
3232

3333
alias(
3434
name = "once_cell",
35-
actual = "@wasmtime__once_cell__1_10_0//:once_cell",
35+
actual = "@wasmtime__once_cell__1_13_0//:once_cell",
3636
tags = [
3737
"cargo-raze",
3838
"manual",
@@ -41,7 +41,7 @@ alias(
4141

4242
alias(
4343
name = "wasmtime",
44-
actual = "@wasmtime__wasmtime__0_35_1//:wasmtime",
44+
actual = "@wasmtime__wasmtime__0_39_1//:wasmtime",
4545
tags = [
4646
"cargo-raze",
4747
"manual",

0 commit comments

Comments
 (0)