Skip to content

Commit 5cca1a8

Browse files
committed
wasmtime: update to v39.0.1
Release notes: https://github.com/bytecodealliance/wasmtime/releases/tag/v39.0.1 The original goal: * Allow wasmtime to instantiate AOT precompiled wasm modules (e.g. with `wasmtime compile`). * Update wasmtime to a recent version for performance testing. * Add resource limiting to bring it to parity with V8. In order to make the resource limiting changes, I needed to use the wasmtime C api rather than the wasm-c-api. I migrated the wasmtime implementation to use the C++ API and migrated the C-api to use the prefixed version by default (required to use the C++ API). Other yak shaving changes required to make this change: 1. Update rules_rust to use a more recent rust toolchain required by wasmtime. 2. Update platforms, rules_cc, and bazel to permit a more recent rules_rust Signed-off-by: Matt Leon <mattleon@google.com>
1 parent c8868da commit 5cca1a8

File tree

260 files changed

+18152
-3676
lines changed

Some content is hidden

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

260 files changed

+18152
-3676
lines changed

.bazelversion

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
6.5.0
1+
7.7.1

BUILD

Lines changed: 1 addition & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -186,10 +186,10 @@ cc_library(
186186
name = "wasmtime_lib",
187187
srcs = [
188188
"src/common/types.h",
189-
"src/wasmtime/types.h",
190189
"src/wasmtime/wasmtime.cc",
191190
],
192191
hdrs = ["include/proxy-wasm/wasmtime.h"],
192+
includes = ["@com_github_bytecodealliance_wasmtime//:wasmtime_lib"],
193193
copts = [
194194
"-DWASM_API_EXTERN=",
195195
],
@@ -221,65 +221,6 @@ cc_library(
221221
],
222222
)
223223

224-
genrule(
225-
name = "prefixed_wasmtime_sources",
226-
srcs = [
227-
"src/wasmtime/types.h",
228-
"src/wasmtime/wasmtime.cc",
229-
],
230-
outs = [
231-
"src/wasmtime/prefixed_types.h",
232-
"src/wasmtime/prefixed_wasmtime.cc",
233-
],
234-
cmd = """
235-
for file in $(SRCS); do
236-
sed -e 's/wasm_/wasmtime_wasm_/g' \
237-
-e 's/include\\/wasm.h/include\\/prefixed_wasm.h/g' \
238-
-e 's/wasmtime\\/types.h/wasmtime\\/prefixed_types.h/g' \
239-
$$file >$(@D)/$$(dirname $$file)/prefixed_$$(basename $$file)
240-
done
241-
""",
242-
)
243-
244-
cc_library(
245-
name = "prefixed_wasmtime_lib",
246-
srcs = [
247-
"src/common/types.h",
248-
"src/wasmtime/prefixed_types.h",
249-
"src/wasmtime/prefixed_wasmtime.cc",
250-
],
251-
hdrs = ["include/proxy-wasm/wasmtime.h"],
252-
copts = [
253-
"-DWASM_API_EXTERN=",
254-
],
255-
defines = [
256-
"PROXY_WASM_HAS_RUNTIME_WASMTIME",
257-
"PROXY_WASM_HOST_ENGINE_WASMTIME",
258-
],
259-
# See: https://bytecodealliance.github.io/wasmtime/c-api/
260-
linkopts = select({
261-
"@platforms//os:macos": [],
262-
"@platforms//os:windows": [
263-
"ws2_32.lib",
264-
"advapi32.lib",
265-
"userenv.lib",
266-
"ntdll.lib",
267-
"shell32.lib",
268-
"ole32.lib",
269-
"bcrypt.lib",
270-
],
271-
"//conditions:default": [
272-
"-ldl",
273-
"-lm",
274-
"-lpthread",
275-
],
276-
}),
277-
deps = [
278-
":wasm_vm_headers",
279-
"//external:prefixed_wasmtime",
280-
],
281-
)
282-
283224
cc_library(
284225
name = "lib",
285226
deps = [
@@ -294,6 +235,5 @@ cc_library(
294235
[":wasmedge_lib"],
295236
) + proxy_wasm_select_engine_wasmtime(
296237
[":wasmtime_lib"],
297-
[":prefixed_wasmtime_lib"],
298238
),
299239
)

bazel/cargo/wasmtime/BUILD.bazel

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ exports_files(
2323

2424
# Run this target to regenerate cargo_lockfile and vendor_path/*.
2525
# $ bazelisk run bazel/cargo/wasmtime:crates_vendor -- --repin
26+
# NOTE: You must change the wasmtime-c-api-impl to rust_static_library after repinning:
27+
# `sed -i.bak -e 's/rust_library/rust_static_library/g' bazel/cargo/wasmtime/remote/BUILD.wasmtime-c-api-impl-*.bazel`
2628
crates_vendor(
2729
name = "crates_vendor",
2830
cargo_lockfile = ":Cargo.Bazel.lock",

0 commit comments

Comments
 (0)